SLEEVE: Add funds check for sleeve travel (#1298)

This makes it consistent with player behaviour. This also makes the function description more truthful in that it is now possible to return false.
This commit is contained in:
gmcew 2024-05-23 09:46:55 +01:00 committed by GitHub
parent b42f775493
commit 7f8757b536
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

@ -256,6 +256,10 @@ export class Sleeve extends Person implements SleevePerson {
/** Travel to another City. Costs money from player */
travel(newCity: CityName): boolean {
if (!Player.canAfford(CONSTANTS.TravelCost)) {
return false;
}
Player.loseMoney(CONSTANTS.TravelCost, "sleeves");
this.city = newCity;

@ -4473,7 +4473,7 @@ export interface Sleeve {
setToGymWorkout(sleeveNumber: number, gymName: string, stat: string): boolean;
/**
* Make a sleeve travel to another city.
* Make a sleeve travel to another city. The cost for using this function is the same as for a player.
* @remarks
* RAM cost: 4 GB
*