Skip to content

Commit

Permalink
Fixes for demoralize
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed May 2, 2024
1 parent 40df603 commit 492992a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/helpers/animation/basicActionAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ const TODO_LIST = [
export function createBasicActionAnimation(msg) {
try {
const { token: tokenID, target: targetUUID, options, outcome } = msg.flags.pf2e.context;
const token = canvas.tokens.get(tokenID);
const token = canvas?.tokens?.get(tokenID);
const action = options.find((opt) => ACTION_LIST.includes(opt));
if (!action || !token) return;
const isFailure = outcome?.includes("failure");
const target = canvas.tokens.placeables.find((t) => t.document.uuid === targetUUID.token);
const isJb2aPremActive = game.modules.get("jb2a_patreon")?.active;
const isAnimSpellFXCartoonActive = game.modules.get("animated-spell-effects-cartoon")?.active;
const usersToPlayFor = getMultiVisibleAndMsgVisible([token, target], msg.whisper);
const action = options.find((opt) => ACTION_LIST.includes(opt));

const data = {
token,
Expand Down Expand Up @@ -244,7 +245,7 @@ function demoralize(data, seq) {
.scaleToObject()
.scale(1)
.anchor({ x: 0.5, y: 0.7 })
.forUsers(getMultiVisibleAndMsgVisible([data.token], msg.whisper))
.forUsers(getMultiVisibleAndMsgVisible([data.token], data.whisper))
.effect()
.file("animated-spell-effects-cartoon.magic.mind sliver")
.filter("ColorMatrix", { hue: 180 })
Expand Down

0 comments on commit 492992a

Please sign in to comment.