made travel cost a constant and prevent travelToCity from traveling if the player doesn't have enough money

This commit is contained in:
Olivier Gagnon
2018-06-03 21:09:12 -04:00
parent 5caa247c89
commit 4b6dbee628
3 changed files with 13 additions and 7 deletions
+5 -1
View File
@@ -2484,7 +2484,11 @@ function NetscriptFunctions(workerScript) {
case Locations.NewTokyo:
case Locations.Ishima:
case Locations.Volhaven:
Player.loseMoney(200000);
if(Player.money.lt(CONSTANTS.TravelCost)) {
workerScript.scriptRef.log("ERROR: not enough money to travel with travelToCity().");
throw makeRuntimeRejectMsg(workerScript, "ERROR: not enough money to travel with travelToCity().");
}
Player.loseMoney(CONSTANTS.TravelCost);
Player.city = cityname;
Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);
if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.travelToCity == null) {