From 0912095b3d63ffdeebc17cf82e36b288350ff0b3 Mon Sep 17 00:00:00 2001 From: Werner Dohse Date: Tue, 31 Oct 2023 08:14:22 +0100 Subject: [PATCH] fix(undead): fix undead fortitude to use applied damage from midi-qol if it's available --- scripts/modules/UndeadFortitude.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/modules/UndeadFortitude.js b/scripts/modules/UndeadFortitude.js index 72b38e5..f65fddd 100644 --- a/scripts/modules/UndeadFortitude.js +++ b/scripts/modules/UndeadFortitude.js @@ -74,7 +74,14 @@ export class UndeadFortitude { /* collect the needed information and pass it along to the handler */ const originalHp = actor.system.attributes.hp.value; const finalHp = getProperty(update, "system.attributes.hp.value") ?? originalHp; - const hpDelta = originalHp - finalHp; + + // default the damage to this calculation + let hpDelta = originalHp - finalHp; + // if you have midi-QOL then you'll have the applied damage + if (options.damageItem) { + hpDelta = options.damageItem.appliedDamage + } + const data = { actor,