mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-07 19:14:37 +01:00
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:
@ -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;
|
||||
|
||||
|
2
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
2
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user