mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 21:07:04 +02:00
Refactored NetscriptJS to take in the NS environment as a parameter to main
This commit is contained in:
+11
-5
@@ -1031,6 +1031,14 @@ function purchaseAugmentation(aug, fac, sing=false) {
|
||||
var txt = "You must first purchase or install " + aug.prereqs.join(",") + " before you can " +
|
||||
"purchase this one.";
|
||||
if (sing) {return txt;} else {dialogBoxCreate(txt);}
|
||||
} else if (Player.money.lt(aug.baseCost * fac.augmentationPriceMult)) {
|
||||
let txt = "You don't have enough money to purchase " + aug.name;
|
||||
if (sing) {return txt;}
|
||||
dialogBoxCreate(txt);
|
||||
} else if (fac.playerReputation < aug.baseRepRequirement) {
|
||||
let txt = "You don't have enough faction reputation to purchase " + aug.name;
|
||||
if (sing) {return txt;}
|
||||
dialogBoxCreate(txt);
|
||||
} else if (Player.money.gte(aug.baseCost * fac.augmentationPriceMult)) {
|
||||
if (Player.firstAugPurchased === false) {
|
||||
Player.firstAugPurchased = true;
|
||||
@@ -1077,11 +1085,9 @@ function purchaseAugmentation(aug, fac, sing=false) {
|
||||
|
||||
displayFactionAugmentations(fac.name);
|
||||
} else {
|
||||
if (sing) {
|
||||
return "You don't have enough money to purchase " + aug.name;
|
||||
} else {
|
||||
dialogBoxCreate("You don't have enough money to purchase this Augmentation!");
|
||||
}
|
||||
dialogBoxCreate("Hmm, something went wrong when trying to purchase an Augmentation. " +
|
||||
"Please report this to the game developer with an explanation of how to " +
|
||||
"reproduce this.");
|
||||
}
|
||||
yesNoBoxClose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user