build new function

This commit is contained in:
Olivier Gagnon 2021-10-14 15:30:26 -04:00
parent f60af97e74
commit 3d97f2d770
4 changed files with 10 additions and 9 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2751,7 +2751,7 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
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.`);
@ -2770,7 +2770,8 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
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 {