From 9f29229c9455efefbe331abf2c9d6bb55ca99d11 Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Tue, 23 Jun 2026 02:57:22 -0400 Subject: [PATCH 1/6] Fix resolving formulas in weapon change effects (#2035) --- module/data/action/baseAction.mjs | 42 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index f568436e..27383b7a 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -348,29 +348,31 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel 'system.bonuses.roll.spellcast.bonus' ]; - return Array.from(await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true })).reduce( - (acc, effect) => { - const effectData = effect.toObject(); - /* Effects on weapons only ever apply for the weapon itself, with a few defined exceptions */ - if (effect.parent.type === 'weapon') { - /* Unless they're secondary - then they apply only to other primary weapons */ - if (effect.parent.system.secondary) { - if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) { - effectData.system.changes = - effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key)); - } - } else if (effectParent?.id !== effect.parent.id) { - effectData.system.changes = - effectData.system.changes.filter(x => weaponTransferredEffectKeys.includes(x.key)); + const results = []; + const applicableEffects = await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true }); + for (const effect of [...applicableEffects].filter(e => !e.isSuppressed)) { + if (effect.parent.type === 'weapon') { + // Effects on weapons only ever apply for the weapon itself (with a few exceptions) + const restricted = + effect.parent.system.secondary + // Secondary applies only to other primary weapons + ? effectParent?.type !== 'weapon' || effectParent?.system.secondary + // Primary only applies to itself + : effectParent?.id !== effect.parent.id; + if (restricted) { + const sourceChanges = effect._source.system.changes; + const changes = sourceChanges.filter(x => weaponTransferredEffectKeys.includes(x.key)); + if (changes.length) { + results.push(effect.clone({ 'system.changes': changes })); } + continue; } + } + + results.push(effect); + } - if (!effect.isSuppressed) { - acc.push(effectData); - } - - return acc; - }, []); + return results; } /** From f5fa59b3bd6d6dcdd8e3b1f3fda68168cf2c3bec Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Tue, 23 Jun 2026 03:40:12 -0400 Subject: [PATCH 2/6] Make prosemirror editor look a bit nicer (#2034) --- styles/less/global/prose-mirror.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/styles/less/global/prose-mirror.less b/styles/less/global/prose-mirror.less index e4b1249f..fc8e49f9 100644 --- a/styles/less/global/prose-mirror.less +++ b/styles/less/global/prose-mirror.less @@ -3,6 +3,8 @@ .application.daggerheart { prose-mirror { + --menu-padding: 4px 0px; + --menu-height: calc(var(--menu-button-height) + 8px); height: 100% !important; width: 100%; From 958eaa310c2b33414527b68afbe6b4ecc64f02c3 Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Tue, 23 Jun 2026 06:22:03 -0400 Subject: [PATCH 3/6] Simplify ActiveEffect sheet tags (#2037) * Simplify ActiveEffect sheet tags * Show origin actor and exclude tag if it is a top level actor tag without origin --- lang/en.json | 3 ++- module/documents/activeEffect.mjs | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lang/en.json b/lang/en.json index a4a5edf0..3f21f5eb 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2010,7 +2010,8 @@ "Attachments": { "attachHint": "Drop items here to attach them", "transferHint": "If checked, this effect will be applied to any actor that owns this Effect's parent Item. The effect is always applied if this Item is attached to another one." - } + }, + "OriginTag": "Origin: {name}" }, "GENERAL": { "Ability": { diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 0e7f5d1e..083b3950 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -224,12 +224,13 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { * @returns {string[]} An array of localized tag strings. */ _getTags() { - const tags = [ - `${game.i18n.localize(this.parent.system.metadata.label)}: ${this.parent.name}`, - game.i18n.localize( - this.isTemporary ? 'DAGGERHEART.EFFECTS.Duration.temporary' : 'DAGGERHEART.EFFECTS.Duration.passive' - ) - ]; + const tags = []; + const originActor = DhActiveEffect.#resolveParentDocument(fromUuidSync(this.origin), Actor); + if (originActor && originActor !== this.actor) { + tags.push(_loc('DAGGERHEART.EFFECTS.OriginTag', { name: originActor.name })); + } else if (!(this.parent instanceof Actor)) { + tags.push(`${_loc(this.parent.system.metadata.label)}: ${this.parent.name}`); + } for (const statusId of this.statuses) { const status = CONFIG.statusEffects.find(s => s.id === statusId); From 07b7c8209440dfc350c1b668ab95487d7cfcf799 Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Tue, 23 Jun 2026 17:26:53 -0400 Subject: [PATCH 4/6] Fetch origin fetch when in compendium (#2042) --- module/documents/activeEffect.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 083b3950..cdfc9a52 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -225,7 +225,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { */ _getTags() { const tags = []; - const originActor = DhActiveEffect.#resolveParentDocument(fromUuidSync(this.origin), Actor); + const originActor = DhActiveEffect.#resolveParentDocument(fromUuidSync(this.origin, { strict: false }), Actor); if (originActor && originActor !== this.actor) { tags.push(_loc('DAGGERHEART.EFFECTS.OriginTag', { name: originActor.name })); } else if (!(this.parent instanceof Actor)) { From ca82cbcf669240ba6034d0200f84781df5e185de Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Tue, 23 Jun 2026 23:28:04 +0200 Subject: [PATCH 5/6] . (#2041) --- module/documents/combat.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/documents/combat.mjs b/module/documents/combat.mjs index 20996b77..e74127e9 100644 --- a/module/documents/combat.mjs +++ b/module/documents/combat.mjs @@ -46,7 +46,9 @@ export default class DhpCombat extends Combat { for (let actor of actors) { await actor.createEmbeddedDocuments( 'ActiveEffect', - effects.filter(x => x.effectTargetTypes.includes(actor.type)) + effects + .filter(x => x.effectTargetTypes.includes(actor.type)) + .map(x => foundry.utils.deepClone(x)) ); } } else { From 2c1f52413d60004c8d4933caf586258ff4baf1cd Mon Sep 17 00:00:00 2001 From: WBHarry Date: Tue, 23 Jun 2026 23:33:29 +0200 Subject: [PATCH 6/6] Raised verison --- system.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system.json b/system.json index 08693074..4660a196 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "daggerheart", "title": "Daggerheart", "description": "An unofficial implementation of the Daggerheart system", - "version": "2.4.0", + "version": "2.4.1", "compatibility": { "minimum": "14.364", "verified": "14.364", @@ -10,7 +10,7 @@ }, "url": "https://github.com/Foundryborne/daggerheart", "manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/v14/system.json", - "download": "https://github.com/Foundryborne/daggerheart/releases/download/2.4.0/system.zip", + "download": "https://github.com/Foundryborne/daggerheart/releases/download/2.4.1/system.zip", "authors": [ { "name": "WBHarry"