From 208b6623b471732e697f42f996e5f2f6be3080d0 Mon Sep 17 00:00:00 2001 From: Chris Ryan Date: Mon, 11 Aug 2025 18:25:22 +1000 Subject: [PATCH] Partial fix for #671 Reaction Roll chat display to match rules --- daggerheart.mjs | 4 +++- lang/en.json | 3 ++- module/data/action/baseAction.mjs | 2 +- templates/ui/chat/parts/roll-part.hbs | 8 ++++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/daggerheart.mjs b/daggerheart.mjs index a2f41735..cfe00d3a 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -209,8 +209,10 @@ Hooks.on('chatMessage', (_, message) => { const difficulty = rollCommand.difficulty; const target = getCommandTarget({ allowNull: true }); + const titleType = reaction ? 'DAGGERHEART.UI.Chat.dualityRoll.abilityReactionCheckTitle' + : 'DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle'; const title = traitValue - ? game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', { + ? game.i18n.format(titleType, { ability: game.i18n.localize(SYSTEM.ACTOR.abilities[traitValue].label) }) : game.i18n.localize('DAGGERHEART.GENERAL.duality'); diff --git a/lang/en.json b/lang/en.json index e5f09217..01a64bba 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2265,7 +2265,8 @@ "title": "Domain Card" }, "dualityRoll": { - "abilityCheckTitle": "{ability} Check" + "abilityCheckTitle": "{ability} Check", + "abilityReactionCheckTitle": "{ability} Reaction Check" }, "featureTitle": "Class Feature", "healingRoll": { diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index a886bf49..f3720d89 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -337,7 +337,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel if (!actor) return; const title = actor.isNPC ? game.i18n.localize('DAGGERHEART.GENERAL.reactionRoll') - : game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', { + : game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityReactionCheckTitle', { ability: game.i18n.localize(abilities[this.save.trait]?.label) }); return actor.diceRoll({ diff --git a/templates/ui/chat/parts/roll-part.hbs b/templates/ui/chat/parts/roll-part.hbs index cd9bb3d6..7f095197 100644 --- a/templates/ui/chat/parts/roll-part.hbs +++ b/templates/ui/chat/parts/roll-part.hbs @@ -6,8 +6,12 @@ {{#if roll.isCritical}} {{localize "DAGGERHEART.GENERAL.criticalShort"}} {{else}} - {{#if roll.result}} - {{localize "DAGGERHEART.GENERAL.withThing" thing=roll.result.label}} + {{#if (eq roll.type "reaction")}} + {{!-- Display no hope/fear as per rules --}} + {{else}} + {{#if roll.result}} + {{localize "DAGGERHEART.GENERAL.withThing" thing=roll.result.label}} + {{/if}} {{/if}} {{/if}}