Update NetscriptFunctions.js

This commit is contained in:
havocmayhem 2018-12-30 20:58:42 +05:30 committed by danielyxie
parent f2353dc052
commit 5758f874ad

@ -3572,6 +3572,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;}