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:
Dapoulp 2025-08-16 01:05:05 +02:00 committed by GitHub
parent 16e931179f
commit a07819611e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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' });
}
} }
} }
} }