Add confirmation to installing

This commit is contained in:
Olivier Gagnon
2021-12-18 18:13:49 -05:00
parent 02605090df
commit 555216a39b
5 changed files with 64 additions and 14 deletions

View File

@@ -304,7 +304,10 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
const checkSingularityAccess = function (func: any, n: any): void {
if (Player.bitNodeN !== 4) {
if (SourceFileFlags[4] < n) {
throw makeRuntimeErrorMsg(func, `This singularity function requires Source-File 4-${n} to run.`);
throw makeRuntimeErrorMsg(
func,
`This singularity function requires Source-File 4-${n} to run. A power up you obtain later in the game. It will be very obvious when and how you can obtain it.`,
);
}
}
};
@@ -1611,7 +1614,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
const cost = getPurchaseServerCost(ram);
if (cost === Infinity) {
workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}'`);
workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must be power of 2`);
return "";
}