Save Aliases object. Fixed bug when buying Neuroflux Governor

This commit is contained in:
Daniel Xie 2017-05-23 11:15:17 -05:00
parent a3c104ca4e
commit 9b83035187
4 changed files with 23 additions and 2 deletions

@ -1753,6 +1753,11 @@ applyAugmentation = function(aug, faction) {
aug.owned = true; aug.owned = true;
aug.factionInstalledBy = faction.name; aug.factionInstalledBy = faction.name;
if (aug.name == AugmentationNames.NeuroFluxGovernor &&
Player.augmentations.indexOf(AugmentationNames.NeuroFluxGovernor) != -1) {
//Already have this aug, just upgrade the level
return;
}
Player.augmentations.push(aug.name); Player.augmentations.push(aug.name);
++Player.numAugmentations; ++Player.numAugmentations;
} }

@ -43,7 +43,17 @@ loadGame = function(saveObj) {
Factions = JSON.parse(saveObj.FactionsSave, Reviver); Factions = JSON.parse(saveObj.FactionsSave, Reviver);
SpecialServerIps = JSON.parse(saveObj.SpecialServerIpsSave, Reviver); SpecialServerIps = JSON.parse(saveObj.SpecialServerIpsSave, Reviver);
Augmentations = JSON.parse(saveObj.AugmentationsSave, Reviver); Augmentations = JSON.parse(saveObj.AugmentationsSave, Reviver);
Aliases = JSON.parse(saveObj.AliasesSave, Reviver); if (saveObj.hasOwnProperty(AliasesSave)) {
try {
Aliases = JSON.parse(saveObj.AliasesSave, Reviver);
} catch(e) {
Aliases = {};
}
} else {
Aliases = {};
}
return true; return true;
} }

@ -732,6 +732,13 @@ var Terminal = {
} }
} }
break; break;
case "scan-analyze":
if (commandArray.length != 1) {
post("Incorrect number of arguments. Usage: scan-analyze");
} else {
Terminal.executeScanAnalyzeCommand();
}
break;
case "scp": case "scp":
//TODO //TODO
break; break;

@ -154,7 +154,6 @@ purchaseAugmentationBoxCreate = function(aug, fac) {
} }
} else if (Player.money >= (aug.baseCost * fac.augmentationPriceMult)) { } else if (Player.money >= (aug.baseCost * fac.augmentationPriceMult)) {
applyAugmentation(aug, fac); applyAugmentation(aug, fac);
//TODO Make this text better
dialogBoxCreate("You slowly drift to sleep as " + fac.name + "'s scientists put you under " + dialogBoxCreate("You slowly drift to sleep as " + fac.name + "'s scientists put you under " +
" in order to install the " + aug.name + " Augmentation. <br><br>" + " in order to install the " + aug.name + " Augmentation. <br><br>" +
"You wake up in your home...you feel different..."); "You wake up in your home...you feel different...");