mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Fix armor slot reduction (#968)
* Temp ActionField attack type missing * Move missing attack type to getModel * Fix armor slot reduction if armor as part of damage
This commit is contained in:
parent
16e931179f
commit
a07819611e
1 changed files with 14 additions and 4 deletions
|
|
@ -571,10 +571,20 @@ export default class DhpActor extends Actor {
|
||||||
if (armorSlotResult) {
|
if (armorSlotResult) {
|
||||||
const { modifiedDamage, armorSpent, stressSpent } = armorSlotResult;
|
const { modifiedDamage, armorSpent, stressSpent } = armorSlotResult;
|
||||||
updates.find(u => u.key === 'hitPoints').value = modifiedDamage;
|
updates.find(u => u.key === 'hitPoints').value = modifiedDamage;
|
||||||
updates.push(
|
if(armorSpent) {
|
||||||
...(armorSpent ? [{ value: armorSpent, key: 'armor' }] : []),
|
const armorUpdate = updates.find(u => u.key === 'armor');
|
||||||
...(stressSpent ? [{ value: stressSpent, key: 'stress' }] : [])
|
if(armorUpdate)
|
||||||
);
|
armorUpdate.value += armorSpent;
|
||||||
|
else
|
||||||
|
updates.push({ value: armorSpent, key: 'armor' });
|
||||||
|
}
|
||||||
|
if(stressSpent) {
|
||||||
|
const stressUpdate = updates.find(u => u.key === 'stress');
|
||||||
|
if(stressUpdate)
|
||||||
|
stressUpdate.value += stressSpent;
|
||||||
|
else
|
||||||
|
updates.push({ value: stressSpent, key: 'stress' });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue