mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Added so effects can be applied from a partner to a companion and vice versa
This commit is contained in:
parent
fa21baf8bf
commit
f3cf850355
6 changed files with 55 additions and 3 deletions
|
|
@ -71,6 +71,25 @@ export default class DhpActor extends Actor {
|
|||
return doc;
|
||||
}
|
||||
|
||||
getBaseApplicableEffects() {
|
||||
const effects = [...this.effects];
|
||||
if (CONFIG.ActiveEffect.legacyTransferral) return;
|
||||
|
||||
for (const item of this.items) {
|
||||
for (const effect of item.effects) {
|
||||
if (effect.transfer) effects.push(effect);
|
||||
}
|
||||
}
|
||||
|
||||
return effects;
|
||||
}
|
||||
|
||||
allApplicableEffects() {
|
||||
const effects = this.getBaseApplicableEffects();
|
||||
|
||||
return this.system.allApplicableEffects?.(effects) ?? effects;
|
||||
}
|
||||
|
||||
/**@inheritdoc */
|
||||
async _preCreate(data, options, user) {
|
||||
if ((await super._preCreate(data, options, user)) === false) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue