diff --git a/lang/en.json b/lang/en.json index 8aa8a49b..912fb9bf 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1614,7 +1614,8 @@ "featureNotMastery": "This feature is used as something else than a Mastery feature and cannot be used here.", "beastformMissingEffect": "The Beastform is missing a Beastform Effect. Cannot be used.", "beastformToManyAdvantages": "You cannot select any more advantages.", - "beastformToManyFeatures": "You cannot select any more features." + "beastformToManyFeatures": "You cannot select any more features.", + "beastformEquipWeapon": "You cannot use weapons while in a Beastform." }, "Tooltip": { "openItemWorld": "Open Item World", diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 0f6f8284..3b8196e8 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -611,6 +611,12 @@ export default class CharacterSheet extends DHBaseActorSheet { await item.update({ 'system.equipped': true }); break; case 'weapon': + if (this.document.effects.find(x => x.type === 'beastform')) { + return ui.notifications.warn( + game.i18n.localize('DAGGERHEART.UI.Notifications.beastformEquipWeapon') + ); + } + await this.document.system.constructor.unequipBeforeEquip.bind(this.document.system)(item); await item.update({ 'system.equipped': true }); diff --git a/module/data/activeEffect/beastformEffect.mjs b/module/data/activeEffect/beastformEffect.mjs index 6445f65d..4e6fa104 100644 --- a/module/data/activeEffect/beastformEffect.mjs +++ b/module/data/activeEffect/beastformEffect.mjs @@ -26,6 +26,13 @@ export default class BeastformEffect extends foundry.abstract.TypeDataModel { }; } + async _onCreate() { + if (this.parent.parent?.type === 'character') { + this.parent.parent.system.primaryWeapon?.update?.({ 'system.equipped': false }); + this.parent.parent.system.secondayWeapon?.update?.({ 'system.equipped': false }); + } + } + async _preDelete() { if (this.parent.parent.type === 'character') { const update = { diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 5582da65..97afbd79 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -325,6 +325,14 @@ export default class DhCharacter extends BaseDataActor { return this.parent.items.find(x => x.type === 'armor' && x.system.equipped); } + get activeBeastform() { + return this.parent.effects.find(x => x.type === 'beastform'); + } + + get unarmedIcon() { + return this.activeBeastform ? 'icons/creatures/claws/claw-straight-brown.webp' : this.attack.img; + } + get sheetLists() { const ancestryFeatures = [], communityFeatures = [],