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
var MarchingOrder = (() => { | |
'use strict'; | |
/** | |
* A line segment consisting of 2 vec3s defining its endpoints. | |
* @typedef {vec3[]} Segment | |
*/ | |
/** | |
* A wrapper around a follower token. This includes positioning information |
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
/** | |
* PathMath script | |
* | |
* This is a library that provides mathematical operations involving Paths. | |
* It intended to be used by other scripts and has no stand-alone | |
* functionality of its own. All the library's operations are exposed by the | |
* PathMath object created by this script. | |
*/ | |
var PathMath = (() => { | |
'use strict'; |
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 small library for testing collisions between moving tokens in Roll20. | |
*/ | |
var TokenCollisions = (() => { | |
'use strict'; | |
/** | |
* An object encapsulating a collision between two tokens and the point | |
* of collision. | |
* @typedef {object} Collision |
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
.charsheet { | |
background-image: url("http://i336.photobucket.com/albums/n346/Hymnodi/Useful%20stuff/FALLOUT2.png"); | |
} | |
.charsheet * { | |
border-color: #22ff88; | |
color: #22ff88; | |
} | |
.charsheet input, select, textarea { |
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("chat:message", function(msg) { | |
var cmdName = "!dance"; | |
var msgTxt = msg.content; | |
// This provides a chat command to heal a character by name. | |
// Alternatively, you can heal all named tokens using "all" as the target. | |
if(msg.type == "api" && msgTxt.indexOf(cmdName) !== -1) { | |
var danceCounter = 0; | |
var curPageID = findObjs({_type: "campaign"})[0].get("playerpageid"); | |
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
/** | |
* Provides a dice rolling command specialized for MLP: RiM season 4 edition. | |
* The syntax for the command is | |
* !r [{Character name}:]{skill name} [+/- Advantages/Drawbacks] | |
* | |
* e.g. | |
* !r Spectrum Square:Energy Weapons +4 -2 | |
* | |
* The character name and skill name are case-insensitive. You should only | |
* need to enter the character name if you control more than one character, |
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
/** Returns an array representing a 2D vector from pt1 to pt2. */ | |
var vec = function(pt1, pt2) { | |
return [pt2[0]-pt1[0], pt2[1]-pt1[1]]; | |
} | |
/** Returns the length of an array representing a vector. */ | |
var vecLength = function(vector) { | |
var length = 0; | |
for(var i=0; i < vector.length; i++) { |
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 small library for testing collisions between moving tokens in Roll20. | |
* | |
* Requires: | |
* Vector Math https://gist.github.com/Cazra/348653571dffc16e87b9 | |
*/ | |
var TokenCollisions = (function() { | |
/** | |
* Returns the first token, from some list of tokens, that a token has | |
* collided with during its last movement. |
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 set of chat commands used to set tokens to carry other tokens. | |
* When a token moves, the any tokens it is carrying move to its new location. | |
* | |
* The following commands are available: | |
* !carry When this command is entered, all selected tokens become | |
* carried by the bottommost selected token. | |
* !drop [name of carried token] | |
* When this command is entered, the selected token drops the | |
* token with the specified name. |
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 script with a command for specifying tokens to follow other tokens. | |
* Simply select the tokens in the marching order and enter the "!follow" | |
* commandwith either a direction for the marching order of the selected tokens | |
* or the name of a token for the selected tokens to follow behind. | |
* | |
* E.G. "!follow west" will make the selected tokens follow each other in order | |
* from east to west, with the westmost token being the leader and the eastmost | |
* token being the caboose. | |
* Alternatively if we want the selected tokens to follow a character named |
NewerOlder