Added overrides to modifierTotal and total getters in DamageRoll to addin critical damage when applicable

This commit is contained in:
WBHarry 2026-07-19 17:24:53 +02:00
parent 14edc7f4ca
commit c0fe127df4
3 changed files with 13 additions and 3 deletions

View file

@ -8,7 +8,7 @@ export default class DamageRoll extends DHRoll {
}
get isCritical() {
return true;
return this.options.isCritical;
}
get modifierTotal() {
@ -16,6 +16,11 @@ export default class DamageRoll extends DHRoll {
return super.modifierTotal + criticalDamageBonus;
}
get total() {
const criticalDamageBonus = this.isCritical ? getCritDamageBonus(this.terms) : 0;
return super.total + criticalDamageBonus;
}
static DefaultDialog = DamageDialog;
static createRollInstance(config) {