Skip to content

Instantly share code, notes, and snippets.

@crw
Last active Nov 8, 2020
Embed
What would you like to do?
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