Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ class Task extends ITask<Divinity> {

Task() {
super(AnimatedSuccessBar.this.plugin, AnimatedSuccessBar.this.fillInterval, true);
int calculatedResult = Math.round(Rnd.get(true));
int iterations = (int) Math.ceil(100D / fillAmount);
// Map the iteration to the relative success for the result
int iterations = (int) Math.ceil(100D / fillAmount);
// At 100% chance the bar should animate fully green — no red segments
int calculatedResult = (chance >= 100)
? iterations * fillAmount + 1
: Math.round(Rnd.get(true));
for (int i = 0; i < iterations; i++) {
mappedResult.add(i * fillAmount < calculatedResult);
}
Expand Down
Loading