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 1/2] 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 */ From 3ced0575a407aa4e8d58214225ed8de150cbe2dd Mon Sep 17 00:00:00 2001 From: omuretsu <84951833+Snarling@users.noreply.github.com> Date: Tue, 1 Aug 2023 01:53:10 -0400 Subject: [PATCH 2/2] Generate doc --- markdown/bitburner.resetinfo.md | 2 ++ markdown/bitburner.resetinfo.ownedaugs.md | 13 +++++++++++++ markdown/bitburner.resetinfo.ownedsf.md | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 markdown/bitburner.resetinfo.ownedaugs.md create mode 100644 markdown/bitburner.resetinfo.ownedsf.md diff --git a/markdown/bitburner.resetinfo.md b/markdown/bitburner.resetinfo.md index b9388dc41..eddc8e1c5 100644 --- a/markdown/bitburner.resetinfo.md +++ b/markdown/bitburner.resetinfo.md @@ -19,4 +19,6 @@ interface ResetInfo | [currentNode](./bitburner.resetinfo.currentnode.md) | | number | The current bitnode | | [lastAugReset](./bitburner.resetinfo.lastaugreset.md) | | number | Numeric timestamp (from Date.now()) of last augmentation reset | | [lastNodeReset](./bitburner.resetinfo.lastnodereset.md) | | number | Numeric timestamp (from Date.now()) of last bitnode reset | +| [ownedAugs](./bitburner.resetinfo.ownedaugs.md) | | Map<string, 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). | +| [ownedSF](./bitburner.resetinfo.ownedsf.md) | | Map<number, number> | A map of owned SF to their levels. Keyed by the SF number. Map values are the SF level. | diff --git a/markdown/bitburner.resetinfo.ownedaugs.md b/markdown/bitburner.resetinfo.ownedaugs.md new file mode 100644 index 000000000..5aa13b34f --- /dev/null +++ b/markdown/bitburner.resetinfo.ownedaugs.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [ResetInfo](./bitburner.resetinfo.md) > [ownedAugs](./bitburner.resetinfo.ownedaugs.md) + +## ResetInfo.ownedAugs property + +A map of owned augmentations to their levels. Keyed by the augmentation name. Map values are the augmentation level (e.g. for NeuroFlux governor). + +**Signature:** + +```typescript +ownedAugs: Map; +``` diff --git a/markdown/bitburner.resetinfo.ownedsf.md b/markdown/bitburner.resetinfo.ownedsf.md new file mode 100644 index 000000000..f22e0d8bb --- /dev/null +++ b/markdown/bitburner.resetinfo.ownedsf.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [ResetInfo](./bitburner.resetinfo.md) > [ownedSF](./bitburner.resetinfo.ownedsf.md) + +## ResetInfo.ownedSF property + +A map of owned SF to their levels. Keyed by the SF number. Map values are the SF level. + +**Signature:** + +```typescript +ownedSF: Map; +```