From 22383613f15bf1423080a0ee32432664f591c95e Mon Sep 17 00:00:00 2001 From: Chris Ryan <73275196+chrisryan10@users.noreply.github.com> Date: Sat, 17 Jan 2026 01:43:29 +1000 Subject: [PATCH 1/6] Ensure effect is Applied to Actor (#1547) Co-authored-by: Chris Ryan --- .../domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json b/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json index 02698989..08110cca 100644 --- a/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json +++ b/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json @@ -81,7 +81,7 @@ "name": "Bold Presence", "img": "icons/magic/holy/barrier-shield-winged-blue.webp", "origin": "Compendium.daggerheart.domains.Item.tdsL00yTSLNgZWs6", - "transfer": false, + "transfer": true, "_id": "2XEYhuAcRGTtqvED", "type": "base", "system": { From 07bdd48199ddf64678f647c4a72b232418eea712 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:37:04 +0100 Subject: [PATCH 2/6] [Fix] 1548 - Standalone Item Add Actions (#1549) * Fixed so that items not on an actor don't error out on creating actions * Fixed deletion of items error --- module/data/item/base.mjs | 2 +- module/data/registeredTriggers.mjs | 2 +- module/documents/item.mjs | 2 +- system.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index 0c9fdabe..2399b7db 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -240,7 +240,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { game.system.registeredTriggers.unregisterTriggers(triggersToRemove, this.parent.uuid); - if (!(this.parent.parent.token instanceof game.system.api.documents.DhToken)) { + if (this.parent.parent && !(this.parent.parent.token instanceof game.system.api.documents.DhToken)) { for (const token of this.parent.parent.getActiveTokens()) { game.system.registeredTriggers.unregisterTriggers( triggersToRemove, diff --git a/module/data/registeredTriggers.mjs b/module/data/registeredTriggers.mjs index fe962c5e..8a100585 100644 --- a/module/data/registeredTriggers.mjs +++ b/module/data/registeredTriggers.mjs @@ -60,7 +60,7 @@ export default class RegisteredTriggers extends Map { unregisterItemTriggers(items) { for (const item of items) { - if (!item.system.actions.size) continue; + if (!item.system.actions?.size) continue; const triggers = (item.system.actions ?? []).reduce((acc, action) => { acc.push(...action.triggers.map(x => x.trigger)); diff --git a/module/documents/item.mjs b/module/documents/item.mjs index 0a163dab..fe62c5bd 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -217,7 +217,7 @@ export default class DHItem extends foundry.documents.Item { game.system.registeredTriggers.unregisterTriggers(triggerKeys, this.uuid); - if (!(this.actor.parent instanceof game.system.api.documents.DhToken)) { + if (this.actor && !(this.actor.parent instanceof game.system.api.documents.DhToken)) { for (const token of this.actor.getActiveTokens()) { game.system.registeredTriggers.unregisterTriggers(triggerKeys, `${token.document.uuid}.${this.uuid}`); } diff --git a/system.json b/system.json index 50a9c83b..8b6081a4 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "daggerheart", "title": "Daggerheart", "description": "An unofficial implementation of the Daggerheart system", - "version": "1.5.2", + "version": "1.5.3", "compatibility": { "minimum": "13.346", "verified": "13.351", From 4ce8fbb84c7f79892aa1c8fc39de40aa537f5590 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sat, 17 Jan 2026 01:42:40 +0100 Subject: [PATCH 3/6] Raised version --- system.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system.json b/system.json index 8b6081a4..2c68f785 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "daggerheart", "title": "Daggerheart", "description": "An unofficial implementation of the Daggerheart system", - "version": "1.5.3", + "version": "1.5.4", "compatibility": { "minimum": "13.346", "verified": "13.351", From 2c93defd9c55ec35eb527d38f31c2270d7143891 Mon Sep 17 00:00:00 2001 From: Chris Ryan Date: Sat, 17 Jan 2026 12:11:21 +1000 Subject: [PATCH 4/6] Fix the sliders to do the correct maximums --- module/applications/dialogs/riskItAllDialog.mjs | 2 ++ module/enrichers/FateRollEnricher.mjs | 1 - templates/dialogs/riskItAllDialog.hbs | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/applications/dialogs/riskItAllDialog.mjs b/module/applications/dialogs/riskItAllDialog.mjs index 9bdd5dc2..10fa1bb4 100644 --- a/module/applications/dialogs/riskItAllDialog.mjs +++ b/module/applications/dialogs/riskItAllDialog.mjs @@ -41,6 +41,8 @@ export default class RiskItAllDialog extends HandlebarsApplicationMixin(Applicat async _prepareContext(_options) { const context = await super._prepareContext(_options); context.resourceValue = this.resourceValue; + context.maxHitPointsValue = Math.min(this.resourceValue, this.actor.system.resources.hitPoints.max); + context.maxStressValue = Math.min(this.resourceValue, this.actor.system.resources.stress.max); context.remainingResource = this.resourceValue - this.choices.hitPoints - this.choices.stress; context.unfinished = context.remainingResource !== 0; diff --git a/module/enrichers/FateRollEnricher.mjs b/module/enrichers/FateRollEnricher.mjs index c50a563b..0cafd4b6 100644 --- a/module/enrichers/FateRollEnricher.mjs +++ b/module/enrichers/FateRollEnricher.mjs @@ -45,7 +45,6 @@ function getFateMessage(roll, flavor) { export const renderFateButton = async event => { const button = event.currentTarget, target = getCommandTarget({ allowNull: true }); - console.log('button', button); const fateTypeData = getFateTypeData(button.dataset?.fatetype); diff --git a/templates/dialogs/riskItAllDialog.hbs b/templates/dialogs/riskItAllDialog.hbs index edb2fbf6..98f89416 100644 --- a/templates/dialogs/riskItAllDialog.hbs +++ b/templates/dialogs/riskItAllDialog.hbs @@ -10,11 +10,11 @@
- +
- +
From 1058b152c211e583497d3d82a30289fa2e686d77 Mon Sep 17 00:00:00 2001 From: Chris Ryan Date: Sat, 17 Jan 2026 14:22:50 +1000 Subject: [PATCH 5/6] Pass the actor id through the button; fix /dr and /fr flavor text --- daggerheart.mjs | 4 ++-- module/applications/dialogs/deathMove.mjs | 3 ++- module/applications/ui/chatLog.mjs | 3 ++- module/enrichers/DualityRollEnricher.mjs | 2 +- module/enrichers/FateRollEnricher.mjs | 2 +- module/helpers/utils.mjs | 6 +++--- templates/ui/chat/deathMove.hbs | 7 ++++--- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/daggerheart.mjs b/daggerheart.mjs index ae93253c..23f153dd 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -300,8 +300,8 @@ Hooks.on('chatMessage', (_, message) => { const difficulty = rollCommand.difficulty; const target = getCommandTarget({ allowNull: true }); - const title = traitValue - ? game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', { + const title = flavor ?? + traitValue ? game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', { ability: game.i18n.localize(SYSTEM.ACTOR.abilities[traitValue].label) }) : game.i18n.localize('DAGGERHEART.GENERAL.duality'); diff --git a/module/applications/dialogs/deathMove.mjs b/module/applications/dialogs/deathMove.mjs index 18ebf104..01df6057 100644 --- a/module/applications/dialogs/deathMove.mjs +++ b/module/applications/dialogs/deathMove.mjs @@ -180,7 +180,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV 'systems/daggerheart/templates/ui/chat/deathMove.hbs', { player: this.actor.name, - actor: { name: this.actor.name, img: this.actor.img }, + actor: this.actor, + actorId: this.actor._id, author: game.users.get(game.user.id), title: game.i18n.localize(this.selectedMove.name), img: this.selectedMove.img, diff --git a/module/applications/ui/chatLog.mjs b/module/applications/ui/chatLog.mjs index f0c7288c..2b489f58 100644 --- a/module/applications/ui/chatLog.mjs +++ b/module/applications/ui/chatLog.mjs @@ -391,6 +391,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo async riskItAllClearStressAndHitPoints(event, data) { const resourceValue = event.target.dataset.resourceValue; - new game.system.api.applications.dialogs.RiskItAllDialog(data.actor, resourceValue).render({ force: true }); + const actor = game.actors.get(event.target.dataset.actorId); + new game.system.api.applications.dialogs.RiskItAllDialog(actor, resourceValue).render({ force: true }); } } diff --git a/module/enrichers/DualityRollEnricher.mjs b/module/enrichers/DualityRollEnricher.mjs index 1ba4c792..f6f022f9 100644 --- a/module/enrichers/DualityRollEnricher.mjs +++ b/module/enrichers/DualityRollEnricher.mjs @@ -2,7 +2,7 @@ import { abilities } from '../config/actorConfig.mjs'; import { getCommandTarget, rollCommandToJSON } from '../helpers/utils.mjs'; export default function DhDualityRollEnricher(match, _options) { - const roll = rollCommandToJSON(match[1], match[0]); + const roll = rollCommandToJSON(match[0]); if (!roll) return match[0]; return getDualityMessage(roll.result, roll.flavor); diff --git a/module/enrichers/FateRollEnricher.mjs b/module/enrichers/FateRollEnricher.mjs index 0cafd4b6..c82bbcb2 100644 --- a/module/enrichers/FateRollEnricher.mjs +++ b/module/enrichers/FateRollEnricher.mjs @@ -1,7 +1,7 @@ import { getCommandTarget, rollCommandToJSON } from '../helpers/utils.mjs'; export default function DhFateRollEnricher(match, _options) { - const roll = rollCommandToJSON(match[1], match[0]); + const roll = rollCommandToJSON(match[0]); if (!roll) return match[0]; return getFateMessage(roll.result, roll?.flavor); diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 234b68b4..1cce581a 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -5,10 +5,10 @@ export const capitalize = string => { return string.charAt(0).toUpperCase() + string.slice(1); }; -export function rollCommandToJSON(text, raw) { +export function rollCommandToJSON(text) { if (!text) return {}; - const flavorMatch = raw?.match(/{(.*)}$/); + const flavorMatch = text?.match(/{(.*)}$/); const flavor = flavorMatch ? flavorMatch[1] : null; // Match key="quoted string" OR key=unquotedValue @@ -31,7 +31,7 @@ export function rollCommandToJSON(text, raw) { } result[key] = value; } - return Object.keys(result).length > 0 ? { result, flavor } : null; + return { result, flavor }; } export const getCommandTarget = (options = {}) => { diff --git a/templates/ui/chat/deathMove.hbs b/templates/ui/chat/deathMove.hbs index 02691c7c..7c677fe3 100644 --- a/templates/ui/chat/deathMove.hbs +++ b/templates/ui/chat/deathMove.hbs @@ -19,13 +19,14 @@ {{#if this.showRiskItAllButton}}
- -
- {{/if}} +
+ {{/if}} +
\ No newline at end of file From e0501d077fc83aca0358c534a6394c31d55de07f Mon Sep 17 00:00:00 2001 From: Chris Ryan Date: Sat, 17 Jan 2026 14:33:59 +1000 Subject: [PATCH 6/6] Remove debug message --- module/dice/dualityRoll.mjs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs index 3091deaf..0edbe5ad 100644 --- a/module/dice/dualityRoll.mjs +++ b/module/dice/dualityRoll.mjs @@ -118,10 +118,6 @@ export default class DualityRoll extends D20Roll { /** @inheritDoc */ static fromData(data) { - if (data.options.guaranteedCritical) { - console.log('TODO: set the max values for Hope and Fear here?'); - } - data.terms[0].class = foundry.dice.terms.Die.name; data.terms[2].class = foundry.dice.terms.Die.name; return super.fromData(data);