diff --git a/scripts/helpers/anim.js b/scripts/helpers/anim.js index e88e936..66d1518 100644 --- a/scripts/helpers/anim.js +++ b/scripts/helpers/anim.js @@ -321,7 +321,8 @@ export function damageShakeRollDamage(token, targets) { }) } -export function shakeOnDamageToken(token) { +export function shakeOnDamageToken(actor_uuid) { + const token = fromUuidSync(actor_uuid).token; const { x: tok_x, y: tok_y, w: tok_width } = token; const shake_distance = 0.2; const shakes = 7 diff --git a/scripts/module.js b/scripts/module.js index 6a1a44c..bd2aaea 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -37,7 +37,7 @@ Hooks.on("ready", () => { // damageShakeRollDamage(msg.token, targets); // } if (!!msg.flags?.pf2e?.appliedDamage && !msg.flags?.pf2e?.appliedDamage?.isHealing && game.settings.get("pf2e-rpg-numbers", 'dmg-shake-directional-enabled')) { - shakeOnDamageToken(msg.token) + shakeOnDamageToken(msg.flags.pf2e.appliedDamage.uuid) } if (!!msg.flags?.pf2e?.appliedDamage && !msg.flags?.pf2e?.appliedDamage?.isHealing && game.settings.get("pf2e-rpg-numbers", 'shake-enabled')) { let dmg = msg.flags.pf2e.appliedDamage.updates.find(u => u.path === "system.attributes.hp.value")?.value;