Files
foundry-Slamother/macros/triggered/panic_check-.js
T
2023-09-18 22:11:19 -07:00

15 lines
769 B
JavaScript

prepTableRoll(`Panic Check`,`1d20 [-]`,`high`,false,false,'system.other.stress.value','>');
//run the panic check
async function prepTableRoll(tableName,rollString,aimFor,zeroBased,checkCrit,rollAgainst,comparison) {
//determine who to run the macro for
if (game.settings.get('mosh','macroTarget') === 'character') {
//roll the table for the player's 'Selected Character'
game.user.character.rollTable(tableName,rollString,aimFor,zeroBased,checkCrit,rollAgainst,comparison);
} else if (game.settings.get('mosh','macroTarget') === 'token') {
//roll the table for all selected tokens
canvas.tokens.controlled.foreach(function(token){
token.actor.rollTable(tableName,rollString,aimFor,zeroBased,checkCrit,rollAgainst,comparison);
});
}
}