mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-07 19:14:37 +01:00
Added softReset to netscript
This commit is contained in:
8
doc/source/netscript/singularityfunctions/softReset.rst
Normal file
8
doc/source/netscript/singularityfunctions/softReset.rst
Normal file
@ -0,0 +1,8 @@
|
||||
softReset() Netscript Function
|
||||
===================================
|
||||
|
||||
.. js:function:: softReset()
|
||||
|
||||
If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function.
|
||||
|
||||
This function will perform a reset even if you don't have any augmentation installed.
|
@ -231,6 +231,10 @@ export let CONSTANTS: IMap<any> = {
|
||||
v0.48.0
|
||||
-------
|
||||
|
||||
Netscript
|
||||
* softReset is a new netscript function that performs a soft reset
|
||||
regardless of if the player has bought augmentations or not.
|
||||
|
||||
Misc.
|
||||
* Fixed an issue where SF3 was listed as infinitly repeatable and SF12 as
|
||||
having a limit of 3.
|
||||
|
@ -203,6 +203,7 @@ export const RamCosts: IMap<any> = {
|
||||
getAugmentationPrereq: () => RamCostConstants.ScriptSingularityFn3RamCost,
|
||||
getAugmentationCost: () => RamCostConstants.ScriptSingularityFn3RamCost,
|
||||
purchaseAugmentation: () => RamCostConstants.ScriptSingularityFn3RamCost,
|
||||
softReset: () => RamCostConstants.ScriptSingularityFn3RamCost,
|
||||
installAugmentations: () => RamCostConstants.ScriptSingularityFn3RamCost,
|
||||
|
||||
// Gang API
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
augmentationExists,
|
||||
installAugmentations
|
||||
} from "./Augmentation/AugmentationHelpers";
|
||||
import { prestigeAugmentation } from "./Prestige";
|
||||
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
|
||||
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
|
||||
import { findCrime } from "./Crime/CrimeHelpers";
|
||||
@ -3483,6 +3484,24 @@ function NetscriptFunctions(workerScript) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
softReset: function() {
|
||||
updateDynamicRam("softReset", getRamCost("softReset"));
|
||||
if (Player.bitNodeN !== 4) {
|
||||
if (SourceFileFlags[4] <= 2) {
|
||||
throw makeRuntimeRejectMsg(workerScript, "Cannot run softReset(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
workerScript.log("Soft resetting. This will cause this script to be killed");
|
||||
setTimeoutRef(() => {
|
||||
prestigeAugmentation();
|
||||
}, 0);
|
||||
|
||||
// Prevent workerScript from "finishing execution naturally"
|
||||
workerScript.running = false;
|
||||
killWorkerScript(workerScript);
|
||||
},
|
||||
installAugmentations: function(cbScript) {
|
||||
updateDynamicRam("installAugmentations", getRamCost("installAugmentations"));
|
||||
if (Player.bitNodeN !== 4) {
|
||||
|
@ -91,7 +91,7 @@ let NetscriptFunctions =
|
||||
"createProgram|commitCrime|getCrimeChance|getOwnedAugmentations|" +
|
||||
"getOwnedSourceFiles|getAugmentationsFromFaction|" +
|
||||
"getAugmentationPrereq|getAugmentationCost|purchaseAugmentation|" +
|
||||
"installAugmentations|" +
|
||||
"softReset|installAugmentations|" +
|
||||
|
||||
// TIX API
|
||||
"getStockPrice|getStockPosition|getStockSymbols|getStockMaxShares|" +
|
||||
|
Reference in New Issue
Block a user