This commit is contained in:
WBHarry 2026-02-25 17:40:40 +01:00
parent 5113e37574
commit c99a76f4f4
15 changed files with 78 additions and 67 deletions

View file

@ -26,23 +26,23 @@ export default class DHAttackAction extends DHDamageAction {
return {
value: {
multiplier: 'prof',
dice: this.item?.system?.attack.damage.parts[0].value.dice,
bonus: this.item?.system?.attack.damage.parts[0].value.bonus ?? 0
dice: this.item?.system?.attack.damage.parts.hitPoints.value.dice,
bonus: this.item?.system?.attack.damage.parts.hitPoints.value.bonus ?? 0
},
type: this.item?.system?.attack.damage.parts[0].type,
type: this.item?.system?.attack.damage.parts.hitPoints.type,
base: true
};
}
get damageFormula() {
const hitPointsPart = this.damage.parts.find(x => x.applyTo === CONFIG.DH.GENERAL.healingTypes.hitPoints.id);
const hitPointsPart = this.damage.parts.hitPoints;
if (!hitPointsPart) return '0';
return hitPointsPart.value.getFormula();
}
get altDamageFormula() {
const hitPointsPart = this.damage.parts.find(x => x.applyTo === CONFIG.DH.GENERAL.healingTypes.hitPoints.id);
const hitPointsPart = this.damage.parts.hitPoints;
if (!hitPointsPart) return '0';
return hitPointsPart.valueAlt.getFormula();

View file

@ -352,11 +352,11 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
}
get hasDamage() {
return this.damage?.parts?.length && this.type !== 'healing';
return !foundry.utils.isEmpty(this.damage.parts) && this.type !== 'healing';
}
get hasHealing() {
return this.damage?.parts?.length && this.type === 'healing';
return !foundry.utils.isEmpty(this.damage.parts) && this.type === 'healing';
}
get hasSave() {