mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 16:53:54 +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.";
|
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:
|
case SleeveWorkType.SYNCHRO:
|
||||||
return "This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's synchronization to increase.";
|
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 (
|
return (
|
||||||
`This sleeve is currently attempting to perform ${work.actionId.name}.\n\nTasks Completed: ${formatInt(
|
`This sleeve is currently attempting to perform ${work.actionId.name}.\n\n` +
|
||||||
work.tasksCompleted,
|
(estimatedSuccessChance ? `Estimated success chance: ${estimatedSuccessChance}\n\n` : "") +
|
||||||
)}\n \n` + `Progress: ${formatPercent(progress)}`
|
`Tasks Completed: ${formatInt(work.tasksCompleted)}\n \n` +
|
||||||
|
`Progress: ${formatPercent(progress)}`
|
||||||
);
|
);
|
||||||
|
}
|
||||||
case SleeveWorkType.CRIME: {
|
case SleeveWorkType.CRIME: {
|
||||||
const crime = work.getCrime();
|
const crime = work.getCrime();
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user