27 lines
861 B
JavaScript
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();
|
|
});
|
|
}
|
|
}
|
|
} |