Skip to content

Commit

Permalink
Merge pull request #1 from havocmayhem/havocmayhem-patch-1
Browse files Browse the repository at this point in the history
Update NetscriptFunctions.js
  • Loading branch information
havocmayhem authored Dec 30, 2018
2 parents cac4a48 + 7dd4444 commit 6bf5380
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/NetscriptFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3568,6 +3568,28 @@ function NetscriptFunctions(workerScript) {
}
return res;
},
getAugmentationPrereq : function(name) {
var ramCost = CONSTANTS.ScriptSingularityFn3RamCost;
if (Player.bitNodeN !== 4) {ramCost *= CONSTANTS.ScriptSingularityFnRamMult;}
if (workerScript.checkingRam) {
return updateStaticRam("getAugmentationPrereq", ramCost);
}
updateDynamicRam("getAugmentationPrereq", ramCost);
if (Player.bitNodeN != 4) {
if (!(hasSingularitySF && singularitySFLvl >= 3)) {
throw makeRuntimeRejectMsg(workerScript, "Cannot run getAugmentationPrereq(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");
return false;
}
}

if (!augmentationExists(name)) {
workerScript.scriptRef.log("ERROR: getAugmentationPrereq() failed. Invalid Augmentation name passed in (note: this is case-sensitive): " + name);
return [-1, -1];
}

var aug = Augmentations[name];
return aug.prereqs;
},
getAugmentationCost : function(name) {
var ramCost = CONSTANTS.ScriptSingularityFn3RamCost;
if (Player.bitNodeN !== 4) {ramCost *= CONSTANTS.ScriptSingularityFnRamMult;}
Expand Down

0 comments on commit 6bf5380

Please sign in to comment.