Fixed so that beastform items always have a beastformEffect on them that can't be removed

This commit is contained in:
WBHarry 2026-02-04 20:33:26 +01:00
parent 735ed4c214
commit f42c1267a6
3 changed files with 23 additions and 3 deletions

View file

@ -253,4 +253,20 @@ export default class DHBeastform extends BaseDataItem {
return false;
}
_onCreate(_data, _options, userId) {
if (!this.actor && game.user.id === userId) {
const hasBeastformEffect = this.parent.effects.some(x => x.type === 'beastform');
if (!hasBeastformEffect)
this.parent.createEmbeddedDocuments('ActiveEffect', [
{
type: 'beastform',
name: game.i18n.localize('DAGGERHEART.ITEMS.Beastform.beastformEffect'),
img: 'icons/creatures/abilities/paw-print-pair-purple.webp'
}
]);
return;
}
}
}