mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-17 13:13:49 +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;
|
return charismaEff;
|
||||||
}
|
}
|
||||||
|
|
||||||
getRecruitmentSuccessChance(person: Person): number {
|
|
||||||
return Math.pow(person.skills.charisma, 0.45) / (this.teamSize - this.sleeveSize + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
sleeveSupport(joining: boolean): void {
|
sleeveSupport(joining: boolean): void {
|
||||||
if (joining) {
|
if (joining) {
|
||||||
this.sleeveSize += 1;
|
this.sleeveSize += 1;
|
||||||
|
@ -8,6 +8,8 @@ import { Player } from "@player";
|
|||||||
import { Paper, Typography } from "@mui/material";
|
import { Paper, Typography } from "@mui/material";
|
||||||
import { useRerender } from "../../ui/React/hooks";
|
import { useRerender } from "../../ui/React/hooks";
|
||||||
import { ActionHeader } from "./ActionHeader";
|
import { ActionHeader } from "./ActionHeader";
|
||||||
|
import { BladeburnerGeneralActionName } from "@enums";
|
||||||
|
import { clampNumber } from "../../utils/helpers/clampNumber";
|
||||||
|
|
||||||
interface GeneralActionElemProps {
|
interface GeneralActionElemProps {
|
||||||
bladeburner: Bladeburner;
|
bladeburner: Bladeburner;
|
||||||
@ -17,8 +19,6 @@ interface GeneralActionElemProps {
|
|||||||
export function GeneralActionElem({ bladeburner, action }: GeneralActionElemProps): React.ReactElement {
|
export function GeneralActionElem({ bladeburner, action }: GeneralActionElemProps): React.ReactElement {
|
||||||
const rerender = useRerender();
|
const rerender = useRerender();
|
||||||
const actionTime = action.getActionTime(bladeburner, Player);
|
const actionTime = action.getActionTime(bladeburner, Player);
|
||||||
const successChance =
|
|
||||||
action.name === "Recruitment" ? Math.max(0, Math.min(bladeburner.getRecruitmentSuccessChance(Player), 1)) : -1;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper sx={{ my: 1, p: 1 }}>
|
<Paper sx={{ my: 1, p: 1 }}>
|
||||||
@ -28,10 +28,11 @@ export function GeneralActionElem({ bladeburner, action }: GeneralActionElemProp
|
|||||||
<br />
|
<br />
|
||||||
<Typography>
|
<Typography>
|
||||||
Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}
|
Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}
|
||||||
{successChance !== -1 && (
|
{action.name === BladeburnerGeneralActionName.Recruitment && (
|
||||||
<>
|
<>
|
||||||
<br />
|
<br />
|
||||||
Estimated success chance: {formatNumberNoSuffix(successChance * 100, 1)}%
|
Estimated success chance:{" "}
|
||||||
|
{formatNumberNoSuffix(clampNumber(action.getSuccessChance(bladeburner, Player), 0, 1) * 100, 1)}%
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
Loading…
Reference in New Issue
Block a user