This commit is contained in:
danielyxie 2018-07-25 15:00:43 -05:00
commit a27ecca7bf
5 changed files with 64 additions and 12 deletions

@ -481,6 +481,17 @@ getOwnedAugmentations
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
---------------------------

@ -82,7 +82,7 @@ let NetscriptFunctions =
"getCompanyFavor|stopAction|getFactionFavor|" +
"checkFactionInvitations|joinFaction|workForFaction|getFactionRep|" +
"createProgram|commitCrime|getCrimeChance|getOwnedAugmentations|" +
"getAugmentationsFromFaction|" +
"getOwnedSourceFiles|getAugmentationsFromFaction|" +
"getAugmentationCost|purchaseAugmentation|" +
"installAugmentations|" +
"getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" +

@ -3094,6 +3094,25 @@ function NetscriptFunctions(workerScript) {
}
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) {
var ramCost = CONSTANTS.ScriptSingularityFn3RamCost;
if (Player.bitNodeN !== 4) {ramCost *= 8;}

@ -1922,6 +1922,14 @@ let Terminal = {
post("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.");
break;
case Programs.Flight.name:
const fulfilled = Player.augmentations.length >= 30 &&
Player.money.gt(1e11) &&
((Player.hacking_skill >= 2500)||
(Player.strength >= 1500 &&
Player.defense >= 1500 &&
Player.dexterity >= 1500 &&
Player.agility >= 1500));
if(!fulfilled) {
post("Augmentations: " + Player.augmentations.length + " / 30");
post("Money: " + numeral(Player.money.toNumber()).format('($0.000a)') + " / " + numeral(1e11).format('($0.000a)'));
@ -1933,6 +1941,10 @@ let Terminal = {
post("Defense: " + Player.defense + " / 1500");
post("Dexterity: " + Player.dexterity + " / 1500");
post("Agility: " + Player.agility + " / 1500");
} else {
post("We will contact you.");
post("-- Daedalus --");
}
break;
case Programs.BitFlume.name:
var yesBtn = yesNoBoxGetYesButton(),

@ -570,6 +570,16 @@ let Engine = {
overviewText += "<br>Int: " + (Player.intelligence).toLocaleString();
}
document.getElementById("character-overview-text").innerHTML = overviewText.replace( / /g, "&nbsp;");
const save = document.getElementById("character-overview-save-button");
const flashClass = "flashing-button";
if(!Settings.AutosaveInterval) {
save.classList.add(flashClass);
} else {
save.classList.remove(flashClass);
}
},
/* Display character info */