mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Added a hpDamageMultiplier rule active effects can modify to multiply the total damage an actor deals
This commit is contained in:
parent
cc998bffa7
commit
dc68ae4eee
7 changed files with 229 additions and 34 deletions
|
|
@ -105,12 +105,20 @@ export default class DamageField extends fields.SchemaField {
|
|||
damagePromises.push(
|
||||
actor.takeHealing(config.damage).then(updates => targetDamage.push({ token, updates }))
|
||||
);
|
||||
else
|
||||
else {
|
||||
const hpDamageMultiplier = config.actionActor?.system.rules.attack.damage.hpDamageMultiplier ?? 1;
|
||||
if (config.damage.hitPoints) {
|
||||
for (const part of config.damage.hitPoints.parts) {
|
||||
part.total = part.total * hpDamageMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
damagePromises.push(
|
||||
actor
|
||||
.takeDamage(config.damage, config.isDirect)
|
||||
.then(updates => targetDamage.push({ token, updates }))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Promise.all(damagePromises).then(async _ => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue