mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 18:50:56 +02:00
@@ -2746,6 +2746,38 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
upgradeHomeCores: function (): any {
|
||||
updateDynamicRam("upgradeHomeCores", getRamCost("upgradeHomeCores"));
|
||||
checkSingularityAccess("upgradeHomeCores", 2);
|
||||
|
||||
// Check if we're at max CORES
|
||||
const homeComputer = Player.getHomeComputer();
|
||||
if (homeComputer.cpuCores >=8) {
|
||||
workerScript.log("upgradeHomeCores", `Your home computer is at max cores.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
const cost = Player.getUpgradeHomeCoresCost();
|
||||
if (Player.money.lt(cost)) {
|
||||
workerScript.log("upgradeHomeCores", `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
homeComputer.cpuCores +=1;
|
||||
Player.loseMoney(cost);
|
||||
|
||||
Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);
|
||||
workerScript.log(
|
||||
"upgradeHomeCores",
|
||||
`Purchased an additional core for home computer! It now has ${(homeComputer.cpuCores)} cores.`,);
|
||||
return true;
|
||||
},
|
||||
getUpgradeHomeCoresCost: function (): any {
|
||||
updateDynamicRam("getUpgradeHomeCoresCost", getRamCost("getUpgradeHomeCoresCost"));
|
||||
checkSingularityAccess("getUpgradeHomeCoresCost", 2);
|
||||
|
||||
return Player.getUpgradeHomeCoresCost();
|
||||
},
|
||||
upgradeHomeRam: function (): any {
|
||||
updateDynamicRam("upgradeHomeRam", getRamCost("upgradeHomeRam"));
|
||||
|
||||
Reference in New Issue
Block a user