mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
parent
b9b657e985
commit
f7a29c0029
12 changed files with 117 additions and 115 deletions
|
|
@ -597,7 +597,7 @@ export default class DhpActor extends Actor {
|
|||
async modifyResource(resources) {
|
||||
if (!resources.length) return;
|
||||
|
||||
if (resources.find(r => r.type === 'stress')) this.convertStressDamageToHP(resources);
|
||||
if (resources.find(r => r.key === 'stress')) this.convertStressDamageToHP(resources);
|
||||
let updates = {
|
||||
actor: { target: this, resources: {} },
|
||||
armor: { target: this.system.armor, resources: {} },
|
||||
|
|
@ -664,14 +664,14 @@ export default class DhpActor extends Actor {
|
|||
}
|
||||
|
||||
convertStressDamageToHP(resources) {
|
||||
const stressDamage = resources.find(r => r.type === 'stress'),
|
||||
const stressDamage = resources.find(r => r.key === 'stress'),
|
||||
newValue = this.system.resources.stress.value + stressDamage.value;
|
||||
if (newValue <= this.system.resources.stress.max) return;
|
||||
const hpDamage = resources.find(r => r.type === 'hitPoints');
|
||||
const hpDamage = resources.find(r => r.key === 'hitPoints');
|
||||
if (hpDamage) hpDamage.value++;
|
||||
else
|
||||
resources.push({
|
||||
type: 'hitPoints',
|
||||
key: 'hitPoints',
|
||||
value: 1
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue