[Feature] HP DamageMultiplier (#1567)

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

* Added a hpDamageTkenMultiplier rule active effects can modify to multiply the total damage an actor takes from others

* .
This commit is contained in:
WBHarry 2026-01-24 20:24:26 +01:00 committed by GitHub
parent 2757a97244
commit fdb6412c8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 247 additions and 38 deletions

View file

@ -105,12 +105,22 @@ export default class DamageField extends fields.SchemaField {
damagePromises.push(
actor.takeHealing(config.damage).then(updates => targetDamage.push({ token, updates }))
);
else
else {
const configDamage = foundry.utils.deepClone(config.damage);
const hpDamageMultiplier = config.actionActor?.system.rules.attack.damage.hpDamageMultiplier ?? 1;
const hpDamageTakenMultiplier = actor.system.rules.attack.damage.hpDamageTakenMultiplier;
if (configDamage.hitPoints) {
for (const part of configDamage.hitPoints.parts) {
part.total = Math.ceil(part.total * hpDamageMultiplier * hpDamageTakenMultiplier);
}
}
damagePromises.push(
actor
.takeDamage(config.damage, config.isDirect)
.takeDamage(configDamage, config.isDirect)
.then(updates => targetDamage.push({ token, updates }))
);
}
}
Promise.all(damagePromises).then(async _ => {