mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
[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:
parent
2757a97244
commit
fdb6412c8c
8 changed files with 247 additions and 38 deletions
|
|
@ -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 _ => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue