make effects copy onto actor on attachment

This commit is contained in:
psitacus 2025-07-08 20:44:59 -06:00
parent 4d5040bba5
commit 4c1d99c577
3 changed files with 138 additions and 6 deletions

View file

@ -51,4 +51,14 @@ export default class DhActiveEffect extends ActiveEffect {
cls.create(msg.toObject());
}
/**
* Retrieve the Document that this ActiveEffect targets for modification.
* @type {Document|null}
*/
get target() {
if (this.parent instanceof Actor) return this.parent;
if (CONFIG.ActiveEffect.legacyTransferral) return this.transfer ? null : this.parent;
return this.transfer ? (this.parent.parent ?? null) : this.parent;
}
}