mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 22:46:12 +01:00
Added a hpDamageTkenMultiplier rule active effects can modify to multiply the total damage an actor takes from others
This commit is contained in:
parent
dc68ae4eee
commit
9f1d53239e
3 changed files with 21 additions and 7 deletions
|
|
@ -106,16 +106,18 @@ export default class DamageField extends fields.SchemaField {
|
|||
actor.takeHealing(config.damage).then(updates => targetDamage.push({ token, updates }))
|
||||
);
|
||||
else {
|
||||
const configDamage = foundry.utils.deepClone(config.damage);
|
||||
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;
|
||||
const hpDamageTakenMultiplier = actor.system.rules.attack.damage.hpDamageTakenMultiplier;
|
||||
if (configDamage.hitPoints) {
|
||||
for (const part of configDamage.hitPoints.parts) {
|
||||
part.total = part.total * hpDamageMultiplier * hpDamageTakenMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
damagePromises.push(
|
||||
actor
|
||||
.takeDamage(config.damage, config.isDirect)
|
||||
.takeDamage(configDamage, config.isDirect)
|
||||
.then(updates => targetDamage.push({ token, updates }))
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue