diff --git a/src/Bladeburner/Actions/GeneralAction.ts b/src/Bladeburner/Actions/GeneralAction.ts index 169b9ebda..75b32365b 100644 --- a/src/Bladeburner/Actions/GeneralAction.ts +++ b/src/Bladeburner/Actions/GeneralAction.ts @@ -4,6 +4,7 @@ import type { ActionIdentifier } from "../Types"; import { BladeActionType, BladeGeneralActionName } from "@enums"; import { ActionClass, ActionParams } from "./Action"; +import { clampNumber } from "../../utils/helpers/clampNumber"; type GeneralActionParams = ActionParams & { name: BladeGeneralActionName; @@ -28,8 +29,9 @@ export class GeneralAction extends ActionClass { getSuccessChance(__bladeburner: Bladeburner, __person: Person): number { return 1; } + getSuccessRange(bladeburner: Bladeburner, person: Person): [minChance: number, maxChance: number] { - const chance = this.getSuccessChance(bladeburner, person); + const chance = clampNumber(this.getSuccessChance(bladeburner, person), 0, 1); return [chance, chance]; } } diff --git a/src/NetscriptFunctions/Bladeburner.ts b/src/NetscriptFunctions/Bladeburner.ts index cc50eef76..3ad7e8367 100644 --- a/src/NetscriptFunctions/Bladeburner.ts +++ b/src/NetscriptFunctions/Bladeburner.ts @@ -129,7 +129,6 @@ export function NetscriptBladeburner(): InternalAPI { checkSleeveNumber(ctx, sleeveNumber); switch (action.type) { case BladeActionType.general: - return [1, 1]; case BladeActionType.contract: { const sleevePerson = Player.sleeves[sleeveNumber]; return action.getSuccessRange(bladeburner, sleevePerson);