From ae0650d3d404e6f8a1d30cd42378f3439ed0f010 Mon Sep 17 00:00:00 2001 From: Chris Ryan Date: Wed, 13 Aug 2025 16:25:33 +1000 Subject: [PATCH] Change the critical damage max calculation to avoid setting the rolled portion to maximum all the time. --- module/dice/damageRoll.mjs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/module/dice/damageRoll.mjs b/module/dice/damageRoll.mjs index 8a72d86e..15da4c49 100644 --- a/module/dice/damageRoll.mjs +++ b/module/dice/damageRoll.mjs @@ -137,9 +137,15 @@ export default class DamageRoll extends DHRoll { } if (config.isCritical && part.applyTo === CONFIG.DH.GENERAL.healingTypes.hitPoints.id) { - const tmpRoll = Roll.fromTerms(part.roll.terms)._evaluateSync({ maximize: true }), - criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll); - part.roll.terms.push(...this.formatModifier(criticalBonus)); + let total = 0; + part.roll.terms.forEach(term => { + if (term._faces) { + total += term._faces * term._number; + } + }); + if (total > 0) { + part.roll.terms.push(...this.formatModifier(total)); + } } /* To Remove When Reaction System */