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
on("ready", function() | |
{ | |
on("chat:message", function (msg) | |
{ | |
if (msg.type === "api" && msg.content === "!allyEnemy") | |
{ | |
allyEnemy() | |
} | |
if (msg.type === "api" && msg.content === "!fortuneMisfortune") | |
{ |
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
/* Screen Shake (really just maps, tokens, and paths) | |
make a macro with the folloing body | |
/w gm &{template:default} {{name=Screen Shaker}} {{[Start](!ScreenShake)}} {{[Shake With Time](!ScreenShake ?{time})}} {{[Stop](!ScreenShakeStop)}} | |
*/ | |
on("ready", function() { | |
var ScreenShakeEnabled = true; | |
on("chat:message", function (msg) { | |
if (msg.type === "api" && msg.content.split(' ')[0] === "!ScreenShake" && playerIsGM(msg.playerid)) | |
{ | |
var shakeTime = 0; |
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
// Add other maneuvers as desired. | |
// Select PC tokens tokens, hit !CombatManeuverBatch | |
var generateUUID = (function() { | |
"use strict"; | |
var a = 0, b = []; | |
return function() { | |
var c = (new Date()).getTime() + 0, d = c === a; | |
a = c; |
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
//TableMaker | |
//Make a character with no sheet. | |
//All attributes are table entries, all current values are weights. | |
//Drag token (can be default) to canvas. Select it. Type !TableMaker <table name> into chat and hit enter | |
//Table name must use dashes for spaces (probably) | |
//Transmog your table over to whatever game you need it for. | |
//This probably sucks, don't use it. | |
on("ready", function() { |
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
on("ready", function() { | |
on('chat:message', function(msg) { | |
if (msg.type === "api" && msg.content.split(' ')[0] === "!AddWep") | |
{ | |
// strips the first bit off of the api command | |
let weaponName = msg.content.replace("!AddWep ", ""); | |
AddWep(msg, weaponName); | |
} | |
}); | |
}); |
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
//Familiar Sight Swap | |
// make a macro with body: | |
// !SwapSight PlayerTokenName FamiliarTokenName | |
on("ready", function() { | |
on("chat:message", function (msg) { | |
if (msg.type === "api" && msg.content.split(' ')[0] === "!SwapSight") { | |
SwapSight(msg); |
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
/* | |
* A Simple face changing script. | |
* Make a rollable table with the character name (one word characer name) plus -Faces | |
* Example, character named John Smith | |
* Table name is John-Faces | |
* Fill table with face names, and pictures which you have uploaded. Can't be from purchase or search | |
* Must be uploaded to your library. | |
* Make macro with this body, as token action macro: | |
* !FaceChange John-?{Face|Normal|Soldier|Popper|Pirate|Noble|Elder|Cleric} | |
* Where those options (other than the title "Face") are the names of the items in your rollable table. |
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
on("ready", function() { | |
on("chat:message", function (msg) { | |
if (msg.type === "api" && msg.content === "!ShowHealth") | |
{ | |
var page = getObj('page', getObj('player',msg.playerid).get('lastpage')).id; | |
var tokens = findObjs({type: 'graphic', _pageid: page}); | |
for (var i=0; i<tokens.length; i++) | |
{ | |
if (tokens[i].get("bar1_value")) |
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
//A little trap | |
on("ready", function() { | |
"use strict"; | |
var i = 0; | |
const millisecondsPerSecond = 1000; // handy conversion | |
let timeForFullSpin = 15 * millisecondsPerSecond; // rotate fully in 15 seconds |
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
on("ready", function() { | |
var graphics; | |
var paths; | |
const scalePathString = function(pathstring,scale){ | |
return JSON.stringify(_.map(JSON.parse(pathstring),(n)=> _.map(n,(i)=> _.isNumber(i) ? scale*i : i ))); | |
}; | |
const simpleObject = function(o){ |