Skip to content

Commit

Permalink
make uuid for shake be set
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Dec 20, 2023
1 parent 120e7ea commit 87db3d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/helpers/anim.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 87db3d3

Please sign in to comment.