mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 05:05:47 +01:00
build new function
This commit is contained in:
parent
f60af97e74
commit
3d97f2d770
@ -43,7 +43,7 @@ The player has access to all of these functions while in BitNode-4. Completing B
|
|||||||
getFactionRep() <singularityfunctions/getFactionRep>
|
getFactionRep() <singularityfunctions/getFactionRep>
|
||||||
getFactionFavor() <singularityfunctions/getFactionFavor>
|
getFactionFavor() <singularityfunctions/getFactionFavor>
|
||||||
getFactionFavorGain() <singularityfunctions/getFactionFavorGain>
|
getFactionFavorGain() <singularityfunctions/getFactionFavorGain>
|
||||||
upgradeHomeCores() <singularityfunctions/upgradeHomeCores>
|
upgradeHomeCores() <singularityfunctions/upgradeHomeCores>
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: Level 3 Functions
|
:caption: Level 3 Functions
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2747,13 +2747,13 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
upgradeHomeCores: function (): any {
|
upgradeHomeCores: function (): any {
|
||||||
updateDynamicRam("upgradeHomeCores", getRamCost("upgradeHomeCores"));
|
updateDynamicRam("upgradeHomeCores", getRamCost("upgradeHomeCores"));
|
||||||
checkSingularityAccess("upgradeHomeCores", 2);
|
checkSingularityAccess("upgradeHomeCores", 2);
|
||||||
|
|
||||||
// Check if we're at max CORES
|
// Check if we're at max cores
|
||||||
const homeComputer = Player.getHomeComputer();
|
const homeComputer = Player.getHomeComputer();
|
||||||
if (homeComputer.cpuCores >=8) {
|
if (homeComputer.cpuCores >= 8) {
|
||||||
workerScript.log("upgradeHomeCores", `Your home computer is at max cores.`);
|
workerScript.log("upgradeHomeCores", `Your home computer is at max cores.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -2764,13 +2764,14 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
homeComputer.cpuCores +=1;
|
homeComputer.cpuCores += 1;
|
||||||
Player.loseMoney(cost);
|
Player.loseMoney(cost);
|
||||||
|
|
||||||
Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);
|
Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);
|
||||||
workerScript.log(
|
workerScript.log(
|
||||||
"upgradeHomeCores",
|
"upgradeHomeCores",
|
||||||
`Purchased an additional core for home computer! It now has ${(homeComputer.cpuCores)} cores.`,);
|
`Purchased an additional core for home computer! It now has ${homeComputer.cpuCores} cores.`,
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
getUpgradeHomeCoresCost: function (): any {
|
getUpgradeHomeCoresCost: function (): any {
|
||||||
|
Loading…
Reference in New Issue
Block a user