mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 04:01:06 +01:00
Update armor slot handling
This commit is contained in:
parent
4bdafeff6d
commit
af3a415e56
10 changed files with 56 additions and 72 deletions
|
|
@ -20,7 +20,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
|||
);
|
||||
|
||||
const canApplyArmor = damageType.every(t => actor.system.armorApplicableDamageTypes[t] === true);
|
||||
const availableArmor = actor.system.armorScore - actor.system.armor.system.marks.value;
|
||||
const availableArmor = actor.system.resources.armor.max - actor.system.resources.armor.value;
|
||||
const maxArmorMarks = canApplyArmor ? availableArmor : 0;
|
||||
|
||||
const armor = [...Array(maxArmorMarks).keys()].reduce((acc, _) => {
|
||||
|
|
@ -116,7 +116,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
|||
const { selectedArmorMarks, selectedStressMarks, stressReductions, currentMarks, currentDamage } =
|
||||
this.getDamageInfo();
|
||||
|
||||
context.armorScore = this.actor.system.armorScore;
|
||||
context.armorScore = this.actor.system.resources.armor.max;
|
||||
context.armorMarks = currentMarks;
|
||||
context.basicMarksUsed =
|
||||
selectedArmorMarks.length === this.actor.system.rules.damageReduction.maxArmorMarked.value;
|
||||
|
|
@ -165,7 +165,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
|||
? Object.values(this.availableStressReductions).filter(red => red.selected)
|
||||
: [];
|
||||
const currentMarks =
|
||||
this.actor.system.armor.system.marks.value + selectedArmorMarks.length + selectedStressMarks.length;
|
||||
this.actor.system.resources.armor.value + selectedArmorMarks.length + selectedStressMarks.length;
|
||||
|
||||
const armorMarkReduction =
|
||||
selectedArmorMarks.length * this.actor.system.rules.damageReduction.increasePerArmorMark;
|
||||
|
|
@ -207,7 +207,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
|||
}
|
||||
|
||||
if (this.rulesOn) {
|
||||
if (!currentMark.selected && currentMarks === this.actor.system.armorScore) {
|
||||
if (!currentMark.selected && currentMarks === this.actor.system.resources.armor.max) {
|
||||
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noAvailableArmorMarks'));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue