mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 12:45:45 +01:00
Merge pull request #387 from hydroflame/get-owned-source-files
added getOwnedAugmentation function
This commit is contained in:
commit
eb4fd7fe5a
@ -481,6 +481,17 @@ getOwnedAugmentations
|
|||||||
|
|
||||||
This function returns an array containing the names (as strings) of all Augmentations you have.
|
This function returns an array containing the names (as strings) of all Augmentations you have.
|
||||||
|
|
||||||
|
getOwnedSourceFiles
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
..js:function:: getOwnedSourceFiles()
|
||||||
|
|
||||||
|
If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function.
|
||||||
|
|
||||||
|
Returns an array of source files
|
||||||
|
[{n: 1, lvl: 3}, {n: 4, lvl: 3}]
|
||||||
|
|
||||||
|
|
||||||
getAugmentationsFromFaction
|
getAugmentationsFromFaction
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ let NetscriptFunctions =
|
|||||||
"getCompanyFavor|stopAction|getFactionFavor|" +
|
"getCompanyFavor|stopAction|getFactionFavor|" +
|
||||||
"checkFactionInvitations|joinFaction|workForFaction|getFactionRep|" +
|
"checkFactionInvitations|joinFaction|workForFaction|getFactionRep|" +
|
||||||
"createProgram|commitCrime|getCrimeChance|getOwnedAugmentations|" +
|
"createProgram|commitCrime|getCrimeChance|getOwnedAugmentations|" +
|
||||||
"getAugmentationsFromFaction|" +
|
"getOwnedSourceFiles|getAugmentationsFromFaction|" +
|
||||||
"getAugmentationCost|purchaseAugmentation|" +
|
"getAugmentationCost|purchaseAugmentation|" +
|
||||||
"installAugmentations|" +
|
"installAugmentations|" +
|
||||||
"getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" +
|
"getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" +
|
||||||
|
@ -3094,6 +3094,25 @@ function NetscriptFunctions(workerScript) {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
getOwnedSourceFiles : function() {
|
||||||
|
let ramCost = CONSTANTS.ScriptSingularityFn3RamCost;
|
||||||
|
if (Player.bitNodeN !== 4) {ramCost *= 8;}
|
||||||
|
if (workerScript.checkingRam) {
|
||||||
|
return updateStaticRam("getOwnedSourceFiles", ramCost);
|
||||||
|
}
|
||||||
|
updateDynamicRam("getOwnedSourceFiles", ramCost);
|
||||||
|
if (Player.bitNodeN != 4) {
|
||||||
|
if (!(hasSingularitySF && singularitySFLvl >= 3)) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "Cannot run getOwnedSourceFiles(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let res = [];
|
||||||
|
for (let i = 0; i < Player.sourceFiles.length; ++i) {
|
||||||
|
res.push({n: Player.sourceFiles[i].n, lvl: Player.sourceFiles[i].lvl});
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
},
|
||||||
getAugmentationsFromFaction : function(facname) {
|
getAugmentationsFromFaction : function(facname) {
|
||||||
var ramCost = CONSTANTS.ScriptSingularityFn3RamCost;
|
var ramCost = CONSTANTS.ScriptSingularityFn3RamCost;
|
||||||
if (Player.bitNodeN !== 4) {ramCost *= 8;}
|
if (Player.bitNodeN !== 4) {ramCost *= 8;}
|
||||||
|
Loading…
Reference in New Issue
Block a user