diff --git a/src/Netscript/RamCostGenerator.ts b/src/Netscript/RamCostGenerator.ts index d093886b8..1512b151c 100644 --- a/src/Netscript/RamCostGenerator.ts +++ b/src/Netscript/RamCostGenerator.ts @@ -249,6 +249,7 @@ const bladeburner = { getActionMaxLevel: RamCostConstants.BladeburnerApiBase, getActionCurrentLevel: RamCostConstants.BladeburnerApiBase, getActionAutolevel: RamCostConstants.BladeburnerApiBase, + getActionSuccesses: RamCostConstants.BladeburnerApiBase, setActionAutolevel: RamCostConstants.BladeburnerApiBase, setActionLevel: RamCostConstants.BladeburnerApiBase, getRank: RamCostConstants.BladeburnerApiBase, diff --git a/src/NetscriptFunctions/Bladeburner.ts b/src/NetscriptFunctions/Bladeburner.ts index 3c5d064d9..2a4c8925d 100644 --- a/src/NetscriptFunctions/Bladeburner.ts +++ b/src/NetscriptFunctions/Bladeburner.ts @@ -172,6 +172,13 @@ export function NetscriptBladeburner(): InternalAPI { const action = getBladeburnerActionObject(ctx, type, name); return action.autoLevel; }, + getActionSuccesses: (ctx) => (_type, _name) => { + const type = helpers.string(ctx, "type", _type); + const name = helpers.string(ctx, "name", _name); + checkBladeburnerAccess(ctx); + const action = getBladeburnerActionObject(ctx, type, name); + return action.successes; + }, setActionAutolevel: (ctx) => (_type, _name, _autoLevel = true) => { diff --git a/src/PersonObjects/Sleeve/Work/SleeveBladeburnerWork.ts b/src/PersonObjects/Sleeve/Work/SleeveBladeburnerWork.ts index b27c165a1..5d555c92b 100644 --- a/src/PersonObjects/Sleeve/Work/SleeveBladeburnerWork.ts +++ b/src/PersonObjects/Sleeve/Work/SleeveBladeburnerWork.ts @@ -67,6 +67,7 @@ export class SleeveBladeburnerWork extends Work { type: WorkType.BLADEBURNER as "BLADEBURNER", actionType: this.actionType, actionName: this.actionName, + cyclesWorked: this.cyclesWorked, }; } diff --git a/src/PersonObjects/Sleeve/Work/SleeveCrimeWork.ts b/src/PersonObjects/Sleeve/Work/SleeveCrimeWork.ts index 4886291c8..95ac4f5d1 100644 --- a/src/PersonObjects/Sleeve/Work/SleeveCrimeWork.ts +++ b/src/PersonObjects/Sleeve/Work/SleeveCrimeWork.ts @@ -51,6 +51,7 @@ export class SleeveCrimeWork extends Work { return { type: WorkType.CRIME as "CRIME", crimeType: this.crimeType, + cyclesWorked: this.cyclesWorked, }; } diff --git a/src/PersonObjects/Sleeve/Work/SleeveInfiltrateWork.ts b/src/PersonObjects/Sleeve/Work/SleeveInfiltrateWork.ts index 4c4e83d38..a2272d93e 100644 --- a/src/PersonObjects/Sleeve/Work/SleeveInfiltrateWork.ts +++ b/src/PersonObjects/Sleeve/Work/SleeveInfiltrateWork.ts @@ -32,6 +32,7 @@ export class SleeveInfiltrateWork extends Work { APICopy() { return { type: WorkType.INFILTRATE as "INFILTRATE", + cyclesWorked: this.cyclesWorked, }; } diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 34e430c25..b6a57b1e0 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -874,6 +874,7 @@ type SleeveBladeburnerTask = { type: "BLADEBURNER"; actionType: "General" | "Contracts"; actionName: string; + cyclesWorked: number; }; /** @public */ @@ -887,7 +888,7 @@ type SleeveClassTask = { type SleeveCompanyTask = { type: "COMPANY"; companyName: string }; /** @public */ -type SleeveCrimeTask = { type: "CRIME"; crimeType: CrimeType | `${CrimeType}` }; +type SleeveCrimeTask = { type: "CRIME"; crimeType: CrimeType | `${CrimeType}`; cyclesWorked: number }; /** @public */ type SleeveFactionTask = { @@ -897,7 +898,7 @@ type SleeveFactionTask = { }; /** @public */ -type SleeveInfiltrateTask = { type: "INFILTRATE" }; +type SleeveInfiltrateTask = { type: "INFILTRATE"; cyclesWorked: number }; /** @public */ type SleeveRecoveryTask = { type: "RECOVERY" }; @@ -2870,6 +2871,19 @@ export type Bladeburner = { */ getActionAutolevel(type: string, name: string): boolean; + /** + * Get action successes. + * @remarks + * RAM cost: 4 GB + * + * Return a number with how many successes you have with action. + * + * @param type - Type of action. + * @param name - Name of action. Must be an exact match. + * @returns a number with how many successes you have with action. + */ + getActionSuccesses(type: string, name: string): number; + /** * Set an action autolevel. * @remarks