mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 12:11:07 +01:00
Impproved Adversary Sheet Data Display (#751)
* Impproved Adversary Sheet Data Display Fixes #604 * FIX: formula lables for attacks and weapons --------- Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
This commit is contained in:
parent
ae23696e40
commit
6f0f21c355
130 changed files with 496 additions and 311 deletions
|
|
@ -103,7 +103,7 @@ export default class DhCharacter extends BaseDataActor {
|
|||
}),
|
||||
attack: new ActionField({
|
||||
initial: {
|
||||
name: 'Attack',
|
||||
name: 'Unarmed Attack',
|
||||
img: 'icons/skills/melee/unarmed-punch-fist-yellow-red.webp',
|
||||
_id: foundry.utils.randomID(),
|
||||
systemPath: 'attack',
|
||||
|
|
@ -394,19 +394,22 @@ export default class DhCharacter extends BaseDataActor {
|
|||
return this.parent.effects.find(x => x.type === 'beastform');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the unarmed attackwhen no primary or secondary weapon is equipped.
|
||||
* Returns `null` if either weapon is equipped.
|
||||
* If the actor is in beastform, overrides the attack's name and image.
|
||||
*
|
||||
* @returns {DHAttackAction|null}
|
||||
*/
|
||||
get usedUnarmed() {
|
||||
const primaryWeaponEquipped = this.primaryWeapon?.system?.equipped;
|
||||
const secondaryWeaponEquipped = this.secondaryWeapon?.system?.equipped;
|
||||
return !primaryWeaponEquipped && !secondaryWeaponEquipped
|
||||
? {
|
||||
...this.attack,
|
||||
uuid: this.attack.uuid,
|
||||
id: this.attack.id,
|
||||
name: this.activeBeastform ? 'DAGGERHEART.ITEMS.Beastform.attackName' : this.attack.name,
|
||||
img: this.activeBeastform ? 'icons/creatures/claws/claw-straight-brown.webp' : this.attack.img,
|
||||
actor: this.parent
|
||||
}
|
||||
: null;
|
||||
if (this.primaryWeapon?.system?.equipped || this.secondaryWeapon?.system?.equipped) return null;
|
||||
|
||||
const attack = foundry.utils.deepClone(this.attack);
|
||||
if (this.activeBeastform) {
|
||||
attack.name = 'DAGGERHEART.ITEMS.Beastform.attackName';
|
||||
attack.img = 'icons/creatures/claws/claw-straight-brown.webp';
|
||||
}
|
||||
return attack;
|
||||
}
|
||||
|
||||
get sheetLists() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue