mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Weaponhandling while in beastform
This commit is contained in:
parent
721eb347db
commit
87f29c3bb3
4 changed files with 23 additions and 1 deletions
|
|
@ -1614,7 +1614,8 @@
|
||||||
"featureNotMastery": "This feature is used as something else than a Mastery feature and cannot be used here.",
|
"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.",
|
"beastformMissingEffect": "The Beastform is missing a Beastform Effect. Cannot be used.",
|
||||||
"beastformToManyAdvantages": "You cannot select any more advantages.",
|
"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": {
|
"Tooltip": {
|
||||||
"openItemWorld": "Open Item World",
|
"openItemWorld": "Open Item World",
|
||||||
|
|
|
||||||
|
|
@ -611,6 +611,12 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
await item.update({ 'system.equipped': true });
|
await item.update({ 'system.equipped': true });
|
||||||
break;
|
break;
|
||||||
case 'weapon':
|
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 this.document.system.constructor.unequipBeforeEquip.bind(this.document.system)(item);
|
||||||
|
|
||||||
await item.update({ 'system.equipped': true });
|
await item.update({ 'system.equipped': true });
|
||||||
|
|
|
||||||
|
|
@ -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() {
|
async _preDelete() {
|
||||||
if (this.parent.parent.type === 'character') {
|
if (this.parent.parent.type === 'character') {
|
||||||
const update = {
|
const update = {
|
||||||
|
|
|
||||||
|
|
@ -325,6 +325,14 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
return this.parent.items.find(x => x.type === 'armor' && x.system.equipped);
|
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() {
|
get sheetLists() {
|
||||||
const ancestryFeatures = [],
|
const ancestryFeatures = [],
|
||||||
communityFeatures = [],
|
communityFeatures = [],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue