mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
BLADEBURNER: Remove duplicate getRecruitmentSuccessChance (#1745)
This commit is contained in:
parent
bc02d4f92f
commit
56c797e23f
@ -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;
|
||||
|
@ -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 (
|
||||
<Paper sx={{ my: 1, p: 1 }}>
|
||||
@ -28,10 +28,11 @@ export function GeneralActionElem({ bladeburner, action }: GeneralActionElemProp
|
||||
<br />
|
||||
<Typography>
|
||||
Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}
|
||||
{successChance !== -1 && (
|
||||
{action.name === BladeburnerGeneralActionName.Recruitment && (
|
||||
<>
|
||||
<br />
|
||||
Estimated success chance: {formatNumberNoSuffix(successChance * 100, 1)}%
|
||||
Estimated success chance:{" "}
|
||||
{formatNumberNoSuffix(clampNumber(action.getSuccessChance(bladeburner, Player), 0, 1) * 100, 1)}%
|
||||
</>
|
||||
)}
|
||||
</Typography>
|
||||
|
Loading…
Reference in New Issue
Block a user