From 56c797e23f243391cbda4c9e89f59445a918d369 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:16:54 +0700 Subject: [PATCH] BLADEBURNER: Remove duplicate getRecruitmentSuccessChance (#1745) --- src/Bladeburner/Bladeburner.ts | 4 ---- src/Bladeburner/ui/GeneralActionElem.tsx | 9 +++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Bladeburner/Bladeburner.ts b/src/Bladeburner/Bladeburner.ts index 3fc2896e0..5fcac3d69 100644 --- a/src/Bladeburner/Bladeburner.ts +++ b/src/Bladeburner/Bladeburner.ts @@ -701,10 +701,6 @@ export class Bladeburner implements OperationTeam { return charismaEff; } - getRecruitmentSuccessChance(person: Person): number { - return Math.pow(person.skills.charisma, 0.45) / (this.teamSize - this.sleeveSize + 1); - } - sleeveSupport(joining: boolean): void { if (joining) { this.sleeveSize += 1; diff --git a/src/Bladeburner/ui/GeneralActionElem.tsx b/src/Bladeburner/ui/GeneralActionElem.tsx index 006b479bf..276a085da 100644 --- a/src/Bladeburner/ui/GeneralActionElem.tsx +++ b/src/Bladeburner/ui/GeneralActionElem.tsx @@ -8,6 +8,8 @@ import { Player } from "@player"; import { Paper, Typography } from "@mui/material"; import { useRerender } from "../../ui/React/hooks"; import { ActionHeader } from "./ActionHeader"; +import { BladeburnerGeneralActionName } from "@enums"; +import { clampNumber } from "../../utils/helpers/clampNumber"; interface GeneralActionElemProps { bladeburner: Bladeburner; @@ -17,8 +19,6 @@ interface GeneralActionElemProps { export function GeneralActionElem({ bladeburner, action }: GeneralActionElemProps): React.ReactElement { const rerender = useRerender(); const actionTime = action.getActionTime(bladeburner, Player); - const successChance = - action.name === "Recruitment" ? Math.max(0, Math.min(bladeburner.getRecruitmentSuccessChance(Player), 1)) : -1; return ( @@ -28,10 +28,11 @@ export function GeneralActionElem({ bladeburner, action }: GeneralActionElemProp
Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)} - {successChance !== -1 && ( + {action.name === BladeburnerGeneralActionName.Recruitment && ( <>
- Estimated success chance: {formatNumberNoSuffix(successChance * 100, 1)}% + Estimated success chance:{" "} + {formatNumberNoSuffix(clampNumber(action.getSuccessChance(bladeburner, Player), 0, 1) * 100, 1)}% )}