Added a hpDamageMultiplier rule active effects can modify to multiply the total damage an actor deals

This commit is contained in:
WBHarry 2026-01-21 00:50:11 +01:00
parent cc998bffa7
commit dc68ae4eee
7 changed files with 229 additions and 34 deletions

View file

@ -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 _ => {