mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
.
This commit is contained in:
parent
321b7c2da3
commit
87879c1f27
3 changed files with 20 additions and 10 deletions
|
|
@ -85,7 +85,7 @@ export default class DamageField extends fields.SchemaField {
|
|||
const targetDamage = [];
|
||||
const damagePromises = [];
|
||||
for (let target of targets) {
|
||||
const actor = fromUuidSync(target.actorId);
|
||||
const actor = foundry.utils.fromUuidSync(target.actorId);
|
||||
if (!actor) continue;
|
||||
if (!config.hasHealing && config.onSave && target.saved?.success === true) {
|
||||
const mod = CONFIG.DH.ACTIONS.damageOnSave[config.onSave]?.mod ?? 1;
|
||||
|
|
@ -98,17 +98,16 @@ export default class DamageField extends fields.SchemaField {
|
|||
});
|
||||
}
|
||||
|
||||
const token = game.scenes.find(x => x.active).tokens.find(x => x.id === target.id);
|
||||
if (config.hasHealing)
|
||||
damagePromises.push(
|
||||
actor
|
||||
.takeHealing(config.damage)
|
||||
.then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates }))
|
||||
actor.takeHealing(config.damage).then(updates => targetDamage.push({ token, updates }))
|
||||
);
|
||||
else
|
||||
damagePromises.push(
|
||||
actor
|
||||
.takeDamage(config.damage, config.isDirect)
|
||||
.then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates }))
|
||||
.then(updates => targetDamage.push({ token, updates }))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue