Fix for Roll: If only skill dice, keepLimit = nb skill dice
This commit is contained in:
@@ -113,9 +113,18 @@ export class RollL5r5e extends Roll {
|
|||||||
summary.totalBonus = Math.max(0, summary.totalSuccess - this.l5r5e.difficulty);
|
summary.totalBonus = Math.max(0, summary.totalSuccess - this.l5r5e.difficulty);
|
||||||
|
|
||||||
if (!this.l5r5e.keepLimit) {
|
if (!this.l5r5e.keepLimit) {
|
||||||
|
// count ring die + skill assistance
|
||||||
this.l5r5e.keepLimit =
|
this.l5r5e.keepLimit =
|
||||||
this.dice.reduce((acc, term) => (term instanceof game.l5r5e.RingDie ? acc + term.number : acc), 0) +
|
this.dice.reduce((acc, term) => (term instanceof game.l5r5e.RingDie ? acc + term.number : acc), 0) +
|
||||||
Math.max(0, this.l5r5e.skillAssistance);
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user