Skip to content

Instantly share code, notes, and snippets.

View jenthura's full-sized avatar
🔧
making cool things

jenthura

🔧
making cool things
View GitHub Profile
@jenthura
jenthura / DC_randomizer.txt
Last active January 24, 2022 07:27
DC randomizer for Foundry VTT
function postToChat(num, label){
var plusOrMinus = Math.random() < 0.5 ? -1 : 1;
console.log(plusOrMinus)
let DC = num+plusOrMinus*(Math.floor(Math.random()*4));
console.log(DC)
let chatData = {
user: game.user._id,
speaker: {alias: "DC"},
content: `The ${label} DC is: <b>${DC}<b>`,
whisper : ChatMessage.getWhisperRecipients("USERNAME_OF_GM")
@jenthura
jenthura / Deck of Many Things
Last active January 24, 2022 07:35
Foundry VTT macro for drawing a card from the Deck of Many Things
const cardImageURLs = [`https://i.imgur.com/IPA90hF.png`,`https://i.imgur.com/L7ZaH32.png`,`https://i.imgur.com/kkm7WFo.png`,`https://i.imgur.com/AfyefuZ.png`,`https://i.imgur.com/NDl5PRh.png`,`https://i.imgur.com/kgCkfYc.png`,`https://i.imgur.com/1QoHhca.png`,`https://i.imgur.com/60lahPl.png`,`https://i.imgur.com/ajc5X5U.png`,`https://i.imgur.com/QNPySfx.png`,`https://i.imgur.com/ufBY236.png`,`https://i.imgur.com/zH25V18.png`,`https://i.imgur.com/j4Hprzx.png`,`https://i.imgur.com/mG3DtLZ.png`,`https://i.imgur.com/QW09Ne1.png`,`https://i.imgur.com/o9pYveI.png`,`https://i.imgur.com/VmqUGQZ.png`,`https://i.imgur.com/l6rSLMN.png`,`https://i.imgur.com/o3GOJo6.png`,`https://i.imgur.com/kKZht9N.png`,`https://i.imgur.com/lQpdgAD.png`,`https://i.imgur.com/epL2BwD.png`]
const cardNames = [`Balance`,`Comet`,`Donjon`,`Euryale`,`Fates`,`Flames`,`Fool`,`Gem`,`Idiot`,`Jester`,`Key`,`Knight`,`Moon`,`Rogue`,`Ruin`,`Skull`,`Star`,`Sun`,`Talons`,`Throne`,`Vizier`,`Void`]
const cardDescriptions = [`Your mind suffers a wrenchi
let temp = [`Normal for the season`,`${(Math.ceil(Math.random()*4))*10} degrees Fahrenheit colder than normal`,`${(Math.ceil(Math.random()*4))*10} degrees Fahrenheit hotter than normal`];
let wind = [`None`,`Light`,`Strong`];
let precip = [`None`, `Light rain or light snowfall`,` Heavy rain or heavy snowfall`];
function roll(){return Math.ceil(Math.random()*20)}
function rollTable(name,arr,first,second,third,fourth) {
let tempRoll = roll()
let message = `${name}: `;
if (tempRoll <= first) {
@jenthura
jenthura / dream-whisper-macro
Last active February 5, 2021 23:29
macro for dream whispers in Foundry VTT
//rolltable by u/DougTheDragonborn from https://www.reddit.com/r/BehindTheTables/comments/fgdrq0/omens_from_dreams_an_all_dice_table/
let setting = [
`You find yourself on a ship at night with rain pelting your face. `,
`You find yourself in a seemingly peaceful grove full of flowers. `,
`You find yourself at the top of a wizard's tower, looking over the ledge. `,
`You find yourself sitting at a the bar of a familiar inn. `,
`You find yourself face down in the sand with no structure in sight. `,
`You find yourself falling from the sky and crashing into a body of water. `,
`You find yourself on a battlefield lined with dead soldiers and common folk alike. `,