Skip to content

Instantly share code, notes, and snippets.

@crw
Last active November 8, 2020 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crw/b10716482dfb6e910a7e8c7206acb8d9 to your computer and use it in GitHub Desktop.
Save crw/b10716482dfb6e910a7e8c7206acb8d9 to your computer and use it in GitHub Desktop.
An Foundry 0.7.5 + CUB 1.3.3 update to the azathought bless macro
/**
* ffvt-macro-bless.js
* Based on the tutorial by azathought, https://youtu.be/FMwXpAE3tJQ
*
* Requires:
* Foundry VTT ~0.7.5
* Combat Utility Belt ~1.3.3 w/ Enhanced Conditions enabled
*/
const conditionName = "Blessed";
const filterId = "ffvt-macro-bless";
const glowColorStrong = 0xfffd85;
const glowColorSoft = 0xffffff;
const blessFunction = async function() {
const params =
[{
filterType: "glow",
filterId: filterId,
outerStrength: 4,
innerStrength: 0,
color: glowColorStrong,
quality: 0.5,
padding: 10,
animated: {
color: {
active: true,
loopDuration: 3000,
animType: "colorOscillation",
val1: glowColorStrong,
val2: glowColorSoft
}
}
}];
for (const token of canvas.tokens.controlled) {
if (game.cub.hasCondition(conditionName, token)){
game.cub.removeCondition(conditionName, token);
} else {
game.cub.addCondition(conditionName, token);
}
if (token.TMFXhasFilterId(filterId)) {
await token.TMFXdeleteFilters(filterId);
} else {
await token.TMFXaddUpdateFilters(params);
}
}
}
// call the async function
blessFunction();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment