This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!game.combat) | |
return ui.notifications.error("You can only do this during combat."); | |
if (!game.combat.combatant.isOwner && !game.user.isGM) | |
return ui.notifications.error("You can only do this on your turn."); | |
return game.combat.nextTurn(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const COLORS = { | |
blue: "#2f67f8", | |
red: "#ea202d", | |
green: "#55b54d", | |
yellow: "#feca30", | |
purple: "#6f318f", | |
white: "#ffffff", | |
orange: "#f1702e" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
export function update(value) { | |
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | |
let time = new Date(); | |
return `${months[time.getMonth()]} ${getOrdinalNum(time.getDate())}, ${time.getFullYear()}`; | |
} | |
// public domain | |
function getOrdinalNum(n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let type = 0; | |
let choice = new Dialog({ | |
title: 'Offer Rest', | |
content: '<p>Do you want to offer all players a short or long rest?</p>', | |
buttons: { | |
short: { | |
label: 'Short', | |
callback: () => { | |
type = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tokens = canvas.tokens.children[0].children; | |
for (let i = 0; i < tokens.length; i++) { | |
let token = tokens[i]; | |
let actor = game.actors.find(actor => actor.name === token.name); | |
if (actor) { | |
token.update({actorId: actor.id, actorLink: false}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dialogEditor = new Dialog({ | |
title: `Token Light Picker`, | |
content: `What is the distance of the light source to set on selected token?`, | |
buttons: { | |
none: { | |
label: `None`, | |
callback: () => { | |
token.document.update({"dimLight": 0, "brightLight": 0, "lightAngle": 360,}); | |
} | |
}, |