From 709fc3ab6329342c1f04990d5bb2ab8a4bac7d8d Mon Sep 17 00:00:00 2001 From: Undeemiss Date: Sat, 28 May 2022 14:12:07 -0500 Subject: [PATCH] Began attempting to implement a multi-upgrade function for bb --- src/Bladeburner/Bladeburner.tsx | 3 +-- src/NetscriptFunctions/Bladeburner.ts | 9 +++++++-- src/ScriptEditor/NetscriptDefinitions.d.ts | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index 59ed0432d..9419df504 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -17,7 +17,7 @@ import { IAction } from "./IAction"; import { IPlayer } from "../PersonObjects/IPlayer"; import { createTaskTracker, ITaskTracker } from "../PersonObjects/ITaskTracker"; import { IPerson } from "../PersonObjects/IPerson"; -import { IRouter, Page } from "../ui/Router"; +import { IRouter } from "../ui/Router"; import { ConsoleHelpText } from "./data/Help"; import { exceptionAlert } from "../utils/helpers/exceptionAlert"; import { getRandomInt } from "../utils/helpers/getRandomInt"; @@ -35,7 +35,6 @@ import { getTimestamp } from "../utils/helpers/getTimestamp"; import { joinFaction } from "../Faction/FactionHelpers"; import { WorkerScript } from "../Netscript/WorkerScript"; import { FactionNames } from "../Faction/data/FactionNames"; -import { BlackOperationNames } from "./data/BlackOperationNames"; import { KEY } from "../utils/helpers/keyCodes"; interface BlackOpsAttempt { diff --git a/src/NetscriptFunctions/Bladeburner.ts b/src/NetscriptFunctions/Bladeburner.ts index e96a4efbf..72458cb06 100644 --- a/src/NetscriptFunctions/Bladeburner.ts +++ b/src/NetscriptFunctions/Bladeburner.ts @@ -292,13 +292,18 @@ export function NetscriptBladeburner(player: IPlayer, workerScript: WorkerScript }, upgradeSkill: (ctx: NetscriptContext) => - (_skillName: unknown): boolean => { + (_skillName: unknown, count = 1): number => { const skillName = ctx.helper.string("skillName", _skillName); checkBladeburnerAccess(ctx); const bladeburner = player.bladeburner; if (bladeburner === null) throw new Error("Should not be called without Bladeburner"); try { - return bladeburner.upgradeSkillNetscriptFn(skillName, workerScript); + for(let i=0; i