diff --git a/lang/en.json b/lang/en.json index 3f21f5eb..a4a5edf0 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2010,8 +2010,7 @@ "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/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index 27383b7a..f568436e 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -348,31 +348,29 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel 'system.bonuses.roll.spellcast.bonus' ]; - 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 })); + 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)); } - continue; } - } - - results.push(effect); - } - return results; + if (!effect.isSuppressed) { + acc.push(effectData); + } + + return acc; + }, []); } /** diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index cdfc9a52..0e7f5d1e 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -224,13 +224,12 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { * @returns {string[]} An array of localized tag strings. */ _getTags() { - const tags = []; - 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)) { - tags.push(`${_loc(this.parent.system.metadata.label)}: ${this.parent.name}`); - } + 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' + ) + ]; for (const statusId of this.statuses) { const status = CONFIG.statusEffects.find(s => s.id === statusId); diff --git a/module/documents/combat.mjs b/module/documents/combat.mjs index e74127e9..20996b77 100644 --- a/module/documents/combat.mjs +++ b/module/documents/combat.mjs @@ -46,9 +46,7 @@ export default class DhpCombat extends Combat { for (let actor of actors) { await actor.createEmbeddedDocuments( 'ActiveEffect', - effects - .filter(x => x.effectTargetTypes.includes(actor.type)) - .map(x => foundry.utils.deepClone(x)) + effects.filter(x => x.effectTargetTypes.includes(actor.type)) ); } } else { diff --git a/styles/less/global/prose-mirror.less b/styles/less/global/prose-mirror.less index fc8e49f9..e4b1249f 100644 --- a/styles/less/global/prose-mirror.less +++ b/styles/less/global/prose-mirror.less @@ -3,8 +3,6 @@ .application.daggerheart { prose-mirror { - --menu-padding: 4px 0px; - --menu-height: calc(var(--menu-button-height) + 8px); height: 100% !important; width: 100%; diff --git a/system.json b/system.json index 4660a196..08693074 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.1", + "version": "2.4.0", "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.1/system.zip", + "download": "https://github.com/Foundryborne/daggerheart/releases/download/2.4.0/system.zip", "authors": [ { "name": "WBHarry"