#M&M Macros #10: Ready to Rumble macro

1 messages · Page 1 of 1 (latest)

lavish kelp
#

READY TO RUMBLE macro by Symon S., Zhell, and Devioushearts

***Required Modules: ***Narrator Tools (you can still use it if you don't have the module but you will want to take out the note ands the section of code that mentions the "/narrate" command second from the bottom) and you may want to eleiminate the whisper to GM portion of the chatmessages so it is reported to all players

This macro prepares for a Mutants & Masterminds tabletop RPG combat encounter by controlling all the tokens, initiating combat for them, Rolling NPC Initiative, and providing an announcer's message with a randomly chosen battle cry.

//READY TO RUMBLE by Symon S., Zhell, and Devioushearts

//Required Modules: Narrator Tools (you can still use it if you don't have the module but you will want to take out the note ands the section of code that mentions the "/narrate" command second from the bottom) and you may want to eleiminate the whisper to GM portion of the chatmessages so it is reported to all players

//This macro prepares for a Mutants & Masterminds tabletop RPG combat encounter by controlling all the tokens, initiating combat for them, Rolling NPC Initiative, and providing an announcer's message with a randomly chosen battle cry. 

// Control all tokens on the canvas
canvas.tokens.controlAll();

// Toggle combat state for all tokens on the canvas
await canvas.tokens.toggleCombat();

// Roll an NPC's initiative with a public roll mode
await game.combat.rollNPC({ messageOptions: { rollMode: CONST.DICE_ROLL_MODES.PUBLIC }});

// Define an array of messages for the announcer
const messages = ["LET'S GET READY TO RUMBLE!!!", "PREPARE TO MEET YOUR DOOM!", "TIME FOR A BEATDOWN!!!", "FOR JUSTICE!!!", "MINIONS OF EVIL, FACE OUR MIGHT!!!", "FIGHT, FIGHT, FIGHT!!!", "CHAMPIONS! TO ARMS!!!", "GEAR UP, TIME FOR BATTLE!!!", "TIME FOR A CLOBBERING!!!"];

// Choose a random message from the array
const randomm = messages[Math.floor(Math.random() * messages.length)];

// Narrate the chosen message to the chat using the /narrate command using Narrator Tool
await ui.chat.processMessage(`/narrate ${randomm}`);

// Show a message in the chat
ChatMessage.create({
  whisper: ChatMessage.getWhisperRecipients("GM"),
  content: `${randomm}`,
  speaker: { actor: null, alias: "Announcer" }, // Customize the speaker alias
  type: CONST.CHAT_MESSAGE_TYPES.OOC, // Adjust the message type if needed
});

//Deselects the previously selected tokens
canvas.tokens.releaseAll();
#

Icon for Ready to Rumble...