From c65294a7d378a81ccc9c3fdd0139e621d2e174cc Mon Sep 17 00:00:00 2001 From: WBHarry Date: Thu, 22 Jan 2026 18:55:17 +0100 Subject: [PATCH] Dr chatcommand and buttons now grant resources via automation by default. Optionally turned off via parameter noResources=true --- daggerheart.mjs | 4 +++- module/dice/dualityRoll.mjs | 2 +- module/enrichers/DualityRollEnricher.mjs | 18 ++++++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/daggerheart.mjs b/daggerheart.mjs index 3abcd210..7bb4b41f 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -296,6 +296,7 @@ Hooks.on('chatMessage', (_, message) => { ? CONFIG.DH.ACTIONS.advantageState.disadvantage.value : undefined; const difficulty = rollCommand.difficulty; + const noResources = Boolean(rollCommand.noResources); const target = getCommandTarget({ allowNull: true }); const title = traitValue @@ -312,7 +313,8 @@ Hooks.on('chatMessage', (_, message) => { title, label: game.i18n.localize('DAGGERHEART.GENERAL.dualityRoll'), actionType: null, - advantage + advantage, + noResources }); return false; } diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs index aaca7400..30b569ac 100644 --- a/module/dice/dualityRoll.mjs +++ b/module/dice/dualityRoll.mjs @@ -261,7 +261,7 @@ export default class DualityRoll extends D20Roll { } static async handleTriggers(roll, config) { - if (!config.source?.actor) return; + if (!config.source?.actor || config.skips?.triggers) return; const updates = []; const dualityUpdates = await game.system.registeredTriggers.runTrigger( diff --git a/module/enrichers/DualityRollEnricher.mjs b/module/enrichers/DualityRollEnricher.mjs index 536847f7..d6d083d9 100644 --- a/module/enrichers/DualityRollEnricher.mjs +++ b/module/enrichers/DualityRollEnricher.mjs @@ -34,6 +34,8 @@ function getDualityMessage(roll, flavor) { ? 'Disadvantage' : undefined; + const noResources = Boolean(roll?.noResources); + const dualityElement = document.createElement('span'); dualityElement.innerHTML = `