Files
foundry-Slamother/_macros/triggered_1e/take_bleeding_damage.js
T
2023-10-09 13:12:55 -07:00

27 lines
861 B
JavaScript

prepBleedingDamage();
//tell the actor to run the function
async function prepBleedingDamage() {
//determine who to run the macro for
if (game.settings.get('mosh','macroTarget') === 'character') {
//is there a selected character? warn if no
if (!game.user.character) {
//warn player
game.mosh.noCharSelected();
} else {
//run the function for the player's 'Selected Character'
game.user.character.takeBleedingDamage();
}
} else if (game.settings.get('mosh','macroTarget') === 'token') {
//is there a selected character? warn if no
if (!canvas.tokens.controlled.length) {
//warn player
game.mosh.noCharSelected();
} else {
//run the function for all selected tokens
canvas.tokens.controlled.forEach(function(token){
token.actor.takeBleedingDamage();
});
}
}
}