From 75579a2ff1c8b32c0a216a814b4fb16249d93af1 Mon Sep 17 00:00:00 2001 From: omuretsu <84951833+Snarling@users.noreply.github.com> Date: Tue, 1 Aug 2023 01:40:30 -0400 Subject: [PATCH] Add owned aug and SF info to getResetInfo --- src/NetscriptFunctions.ts | 2 ++ src/ScriptEditor/NetscriptDefinitions.d.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 534b36664..28cd1c257 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1762,6 +1762,8 @@ export const ns: InternalAPI = { lastAugReset: Player.lastAugReset, lastNodeReset: Player.lastNodeReset, currentNode: Player.bitNodeN, + ownedAugs: new Map(Player.augmentations.map((aug) => [aug.name, aug.level])), + ownedSF: new Map(Player.sourceFiles), }), getFunctionRamCost: (ctx) => (_name) => { const name = helpers.string(ctx, "name", _name); diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index b33e7fe65..974b8779f 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -74,6 +74,10 @@ interface ResetInfo { lastNodeReset: number; /** The current bitnode */ currentNode: number; + /** A map of owned augmentations to their levels. Keyed by the augmentation name. Map values are the augmentation level (e.g. for NeuroFlux governor). */ + ownedAugs: Map; + /** A map of owned SF to their levels. Keyed by the SF number. Map values are the SF level. */ + ownedSF: Map; } /** @public */