mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 08:43:53 +01:00
UI: Add success chance of Bladeburner action to Sleeves UI (#1567)
This commit is contained in:
parent
7029ac9bcc
commit
23f98c1ff6
@ -29,12 +29,24 @@ function getWorkDescription(sleeve: Sleeve, progress: number): string {
|
||||
return "This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a faster rate.";
|
||||
case SleeveWorkType.SYNCHRO:
|
||||
return "This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's synchronization to increase.";
|
||||
case SleeveWorkType.BLADEBURNER:
|
||||
case SleeveWorkType.BLADEBURNER: {
|
||||
const bladeburner = Player.bladeburner;
|
||||
let estimatedSuccessChance;
|
||||
if (bladeburner) {
|
||||
const action = bladeburner.getActionFromTypeAndName(work.actionId.type, work.actionId.name);
|
||||
if (action) {
|
||||
const [minChance, maxChance] = action.getSuccessRange(bladeburner, sleeve);
|
||||
estimatedSuccessChance =
|
||||
formatPercent(minChance, 1) + (minChance === maxChance ? "" : ` ~ ${formatPercent(maxChance, 1)}`);
|
||||
}
|
||||
}
|
||||
return (
|
||||
`This sleeve is currently attempting to perform ${work.actionId.name}.\n\nTasks Completed: ${formatInt(
|
||||
work.tasksCompleted,
|
||||
)}\n \n` + `Progress: ${formatPercent(progress)}`
|
||||
`This sleeve is currently attempting to perform ${work.actionId.name}.\n\n` +
|
||||
(estimatedSuccessChance ? `Estimated success chance: ${estimatedSuccessChance}\n\n` : "") +
|
||||
`Tasks Completed: ${formatInt(work.tasksCompleted)}\n \n` +
|
||||
`Progress: ${formatPercent(progress)}`
|
||||
);
|
||||
}
|
||||
case SleeveWorkType.CRIME: {
|
||||
const crime = work.getCrime();
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user