Added aseDie.rerollResult method to specifically reroll a specific result die in a grouping

This commit is contained in:
WBHarry 2026-07-15 14:58:02 +02:00
parent 1274639ba8
commit 221b84726d
7 changed files with 25 additions and 5 deletions

View file

@ -0,0 +1,12 @@
export default class BaseDie extends foundry.dice.terms.Die {
async rerollResult(resultIndex) {
const result = this.results[resultIndex];
result.rerolled = true;
result.active = false;
await this.roll({ reroll: true });
const rerolledResult = this.results[this.results.length - 1];
this.results.splice(this.results.length - 1, 1);
this.results.splice(resultIndex, 0, rerolledResult);
}
}