Open Farmeroz opened 1 month ago
Nick provided a link to https://discord.com/channels/228546929494065152/788878698349723669/1273075849943584851 but SavageGM unable to get it to work with their Blur spell.
This is what they have done so far:
// get selected tokens
let tokens = canvas.tokens.controlled
if (tokens && tokens.length > 0) {
// create a new effect
let effect = {
id: 'Blur-5',
label: 'Blur -5',
changes: [{
key: 'data.conditions.target.modifiers',
value: '-5 for Blur',
mode: 2 // ADD
}]
}
// toggle the effect for all selected tokens
for (let token of tokens) {
token.toggleEffect(effect)
}
}
Discord message thread: https://discord.com/channels/228546929494065152/788878698349723669/1273076295399510137
I just updated the "Cool Macros" page to make this work correctly. I want to add this as a popup GUI feature at some point.
Example provided from the GURPS Discord by SavageGM was "character casts Blur for a-5 to be hit and then on success of the spell the macro would automatically put a "-5 Blur" into the Effects Modifier.
If there's a way to do this via JS in the meantime, that would also be great.