From e0cb2bf2350ab818632905e55c184033707ca192 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Tue, 9 Feb 2021 12:17:28 +0100 Subject: [PATCH] Fix for Roll: If only skill dice, keepLimit = nb skill dice --- system/scripts/dice/roll.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system/scripts/dice/roll.js b/system/scripts/dice/roll.js index 8361f11..a2d6b47 100644 --- a/system/scripts/dice/roll.js +++ b/system/scripts/dice/roll.js @@ -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 + ); + } } }