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 1bd64e87..083b3950 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -223,12 +223,14 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { * Generates a list of localized tags based on this item's type-specific properties. * @returns {string[]} An array of localized tag strings. */ - _getTags(rootDocument) { - const tags = [ - rootDocument && rootDocument === this.parent - ? _loc(`DOCUMENT.${rootDocument.documentName}`) - : `${_loc(this.parent.system.metadata.label)}: ${this.parent.name}` - ]; + _getTags() { + 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); diff --git a/templates/sheets/global/partials/item-tags.hbs b/templates/sheets/global/partials/item-tags.hbs index e05a1095..2edc1eac 100644 --- a/templates/sheets/global/partials/item-tags.hbs +++ b/templates/sheets/global/partials/item-tags.hbs @@ -1,5 +1,5 @@