mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +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
|
|
@ -51,6 +51,11 @@ export const commonActorRules = (extendedData = { damageReduction: {}, attack: {
|
|||
nullable: false,
|
||||
initial: 1
|
||||
}),
|
||||
hpDamageTakenMultiplier: new fields.NumberField({
|
||||
required: true,
|
||||
nullable: false,
|
||||
initial: 1
|
||||
}),
|
||||
...(extendedData.attack?.damage ?? {})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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 }))
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,7 +336,14 @@
|
|||
"range": "melee"
|
||||
}
|
||||
},
|
||||
"changes": [],
|
||||
"changes": [
|
||||
{
|
||||
"key": "system.rules.attack.damage.hpDamageTakenMultiplier",
|
||||
"mode": 5,
|
||||
"value": "2",
|
||||
"priority": null
|
||||
}
|
||||
],
|
||||
"disabled": false,
|
||||
"duration": {
|
||||
"startTime": null,
|
||||
|
|
@ -350,8 +357,8 @@
|
|||
"description": "",
|
||||
"tint": "#ffffff",
|
||||
"statuses": [
|
||||
"restrained",
|
||||
"vulnerable"
|
||||
"vulnerable",
|
||||
"restrained"
|
||||
],
|
||||
"sort": 0,
|
||||
"flags": {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue