Fix for Roll: If only skill dice, keepLimit = nb skill dice

This commit is contained in:
Vlyan
2021-02-09 12:17:28 +01:00
parent 8a22706ad2
commit e0cb2bf235

View File

@@ -113,9 +113,18 @@ export class RollL5r5e extends Roll {
summary.totalBonus = Math.max(0, summary.totalSuccess - this.l5r5e.difficulty);
if (!this.l5r5e.keepLimit) {
// count ring die + skill assistance
this.l5r5e.keepLimit =
this.dice.reduce((acc, term) => (term instanceof game.l5r5e.RingDie ? acc + term.number : acc), 0) +
Math.max(0, this.l5r5e.skillAssistance);
// if only bulk skill dice, count the skill dice
if (!this.l5r5e.keepLimit) {
this.l5r5e.keepLimit = this.dice.reduce(
(acc, term) => (term instanceof game.l5r5e.AbilityDie ? acc + term.number : acc),
0
);
}
}
}