mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
22 lines
585 B
JavaScript
22 lines
585 B
JavaScript
export default class DhActiveEffect extends ActiveEffect {
|
|
get isSuppressed() {
|
|
if (['weapon', 'armor'].includes(this.parent.type)) {
|
|
return !this.parent.system.equipped;
|
|
}
|
|
|
|
return super.isSuppressed;
|
|
}
|
|
|
|
async _preCreate(data, options, user) {
|
|
const update = {};
|
|
if (!data.img) {
|
|
update.img = 'icons/magic/life/heart-cross-blue.webp';
|
|
}
|
|
|
|
if (Object.keys(update).length > 0) {
|
|
await this.updateSource(update);
|
|
}
|
|
|
|
await super._preCreate(data, options, user);
|
|
}
|
|
}
|