[Fix] Beastform Effects (#1635)

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

* Fixed so that you can drag an active effect onto a character
This commit is contained in:
WBHarry 2026-02-08 18:01:30 +01:00 committed by GitHub
parent 202e624a06
commit 44131d21a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 5 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;
}
}
}