At the request of Glandulf! ๐
This Macro whispers a message to the GM to give them a quick overview of all the players whose tokens are selected, their current Hero Points, Injury Levels, and any Active Effects they have on them. The basic structure was written by Freeze and I added some minor bits and made some formattng decisions.
//Player Overview for Selected Tokens by Freeze with minor tinkering by Devioushearts.
//This Macro whispers a message to the GM to give them a quick overview of all the players whose tokens are selected, their current Hero Points, Injury Levels, and any Active Effects they have on them. The basic structure was written by Freeze and I added some minor bits and made some formattng decisions.
const selectedTokens = canvas.tokens.controlled;
if (selectedTokens.length === 0) {
ui.notifications.warn("You need to select a token or multiple tokens in order for this to work.");
} else {
const message = selectedTokens.reduce((acc, token) => {
const character = token.actor;
if (character) {
// Get the active effects for the character
const activeEffects = character.effects.map((effect) => effect.data.label).join(', ');
acc += `<h3>${character.name}</h3>
<p><strong>Hero Points:</strong> ${character.data.data.heroisme}, <strong>Injuries:</strong> ${character.data.data.blessure}</p>
<p><strong>Active Effects:</strong> <em>${activeEffects}</em></p>`;
}
return acc;
}, "<h2>Player Overview</h2>");
await ChatMessage.create({ content: message, whisper: [game.user] });
}```