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.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.numAugmentations;
}

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

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

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