diff --git a/src/Netscript/RamCostGenerator.ts b/src/Netscript/RamCostGenerator.ts index d72fef4ac..b7f8b704e 100644 --- a/src/Netscript/RamCostGenerator.ts +++ b/src/Netscript/RamCostGenerator.ts @@ -177,6 +177,8 @@ const singularity: IMap = { installAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost), isFocused: SF4Cost(0.1), setFocus: SF4Cost(0.1), + b1tflum3: SF4Cost(16), + destroyW0r1dD43m0n: SF4Cost(32), }; // Gang API diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 4e34f427b..acd94e78d 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -47,6 +47,8 @@ import { Server } from "../Server/Server"; import { netscriptCanHack } from "../Hacking/netscriptCanHack"; import { FactionInfos } from "../Faction/FactionInfo"; import { InternalAPI, NetscriptContext } from "src/Netscript/APIWrapper"; +import { BlackOperationNames } from "../Bladeburner/data/BlackOperationNames"; +import { enterBitNode } from "../RedPill"; export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript): InternalAPI { const getAugmentation = function (_ctx: NetscriptContext, name: string): Augmentation { @@ -1335,5 +1337,47 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript } return item.price; }, + b1tflum3: + (_ctx: NetscriptContext) => + (_nextBN: unknown, _callbackScript: unknown = ""): void => { + const nextBN = _ctx.helper.number("nextBN", _nextBN); + const callbackScript = _ctx.helper.string("callbackScript", _callbackScript); + enterBitNode(Router, true, player.bitNodeN, nextBN); + if (callbackScript) + setTimeout(() => { + runAfterReset(callbackScript); + }, 0); + }, + destroyW0r1dD43m0n: + (_ctx: NetscriptContext) => + (_nextBN: unknown, _callbackScript: unknown = ""): void => { + const nextBN = _ctx.helper.number("nextBN", _nextBN); + const callbackScript = _ctx.helper.string("callbackScript", _callbackScript); + + const hackingRequirements = (): boolean => { + const wd = GetServer(SpecialServers.WorldDaemon); + if (!(wd instanceof Server)) + throw new Error("WorldDaemon was not a normal server. This is a bug contact dev."); + if (player.hacking < wd.requiredHackingSkill) return false; + if (!wd.hasAdminRights) return false; + return true; + }; + const bladeburnerRequirements = (): boolean => { + if (!player.inBladeburner()) return false; + if (!player.bladeburner) return false; + return player.bladeburner.blackops[BlackOperationNames.OperationDaedalus]; + }; + + if (!hackingRequirements() && !bladeburnerRequirements()) { + _ctx.log(() => "Requirements not met to destroy the world daemon"); + return; + } + + enterBitNode(Router, false, player.bitNodeN, nextBN); + if (callbackScript) + setTimeout(() => { + runAfterReset(callbackScript); + }, 0); + }, }; } diff --git a/src/Programs/Program.ts b/src/Programs/Program.ts index e26d5bbb8..1b63e27ec 100644 --- a/src/Programs/Program.ts +++ b/src/Programs/Program.ts @@ -24,9 +24,4 @@ export class Program { this.create = create; this.run = run; } - - htmlID(): string { - const name = this.name.endsWith(".exe") ? this.name.slice(0, -".exe".length) : this.name; - return "create-program-" + name; - } } diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 40ea0552b..b1d429df2 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -2386,6 +2386,30 @@ export interface Singularity { * purchased. Throws an error if the specified program/exploit does not exist */ getDarkwebProgramCost(programName: string): number; + + /** + * b1t_flum3 into a different BN. + * @remarks + * RAM cost: 16 GB * 16/4/1 + * + * @param nextBN - BN number to jump to + * @param callbackScript - Name of the script to launch in the next BN. + */ + b1tflum3(nextBN: number, callbackScript?: string): void; + + /** + * Destroy the w0r1d_d43m0n and move on to the next BN. + * @remarks + * RAM cost: 32 GB * 16/4/1 + * + * You must have the special augment installed and the required hacking level + * OR + * Completed the final black op. + * + * @param nextBN - BN number to jump to + * @param callbackScript - Name of the script to launch in the next BN. + */ + destroyW0r1dD43m0n(nextBN: number, callbackScript?: string): void; } /**