Skip to content

Instantly share code, notes, and snippets.

Avatar

BaldarSilveraxe

View GitHub Profile
View mapGrid
/*global state, sendChat, filterObjs, getObj, on, createObj, setTimeout, _, findObjs, playerIsGM, sendPing, toFront, toBack */
/*jslint white: true, bitwise: true, for: true, multivar: true, browser: true */
var mapGrid = mapGrid || (function(){
'use strict';
var version = 0.1,
handleGraphicChange = function (obj) {
var html = '',
page=getObj('page',obj.get('pageid')),
View Sample Door
var SampleDoor = SampleDoor || (function(){
'use strict';
var Rollable_Table_Avatar = 'https://s3.amazonaws.com/files.d20.io/images/15774224/TylRyZ0nvG4ChhmEApDOPw/thumb.png?1454115889',
find_create_rollabletable = function() {
var tables = findObjs({type: 'rollabletable',name: 'hit token button'}),
table = tables[0] || createObj('rollabletable', {name: 'hit token button',showplayers: false}),
items = findObjs({rollabletableid: table.id}),
item = items[0]||createObj('tableitem', {rollabletableid: table.id, avatar: Rollable_Table_Avatar});
_.each(tables, function( eachItem, index ) {
if( 0 !== index ) {
View Pathing
var pathing_rotation = function(angle, point,width,height) {
var pointX = point[0], pointY = point[1], originX = (width/2), originY = (height/2);
angle = angle * Math.PI / 180.0;
return [
Math.cos(angle) * (pointX-originX) - Math.sin(angle) * (pointY-originY) + originX,
Math.sin(angle) * (pointX-originX) + Math.cos(angle) * (pointY-originY) + originY
];
},
rotated_flipPaths = function(shapePath) {
var i,newPath,angle,xOffset,yOffset,maxX,minX,maxY,minY,spinPath,objectWidth,objectHeight,objectTop,objectLeft;
@BaldarSilveraxe
BaldarSilveraxe / AOEDrawer
Last active Sep 6, 2015
AOEDrawer Roll20 API
View AOEDrawer
/*global sendChat, createObj, getObj, toFront, toBack, state, _, log, on, filterObjs, setTimeout, playerIsGM*/
/*jslint white: true */
var AOEDrawer = AOEDrawer || (function(){
'use strict';
//breakcode = breakcode
var version = 0.81,
lastUpdate = 1440326236,
schemaVersion = 0.81,
//Default Settings
View stopTalkingYouTwo.js
/*global sendChat, createObj, getObj, toFront, state, _, log, on*/
/*jslint white: true */
var stopTalkingYouTwo = stopTalkingYouTwo || (function(){
'use strict';
var version = '0.1.0',
whisperUrl = 'https://s3.amazonaws.com/files.d20.io/images/11583165/eABhjOsunqhKHto2aRQ96A/thumb.png?1439727668',
whisperPing = function(currentPageGraphics) {
_.each(currentPageGraphics, function(obj) {whisperPingeer(obj); });
},
View tokenSlider.js
/*global sendChat, createObj, getObj, toFront, state, _, log, on*/ /*jslint white: true */
var tokenSlider = tokenSlider || (function(){
'use strict';
var version = 0.1,
lastUpdate = 1439553559,
schemaVersion = 0.1,
sliderURL = 'https://s3.amazonaws.com/files.d20.io/images/11533373/FMkZYp0p7Si1FIEPe-94mg/thumb.png?1439570208',
sliderAction = function(represents) {
sendChat('tokenSlider','For Token: ' + represents);
//Do something
View SpaceTest.js
var SpaceIndustryTiles = (function () {
'use strict';
var textures = [];
textures['space'] = [
{key: '001', url: 'https://s3.amazonaws.com/files.d20.io/images/10242180/lfUyZAeGDrxAhNxZvyShXw/thumb.jpg?1434626840', w: 840, h: 840},
{key: '002', url: 'https://s3.amazonaws.com/files.d20.io/images/10242168/Y-M1W0io3XRhVNY_9cG2Kw/thumb.jpg?1434626836', w: 840, h: 840},
{key: '003', url: 'https://s3.amazonaws.com/files.d20.io/images/10242175/7VTy7MQPF0utcQFsq_76zA/thumb.jpg?1434626838', w: 840, h: 840},
{key: '004', url: 'https://s3.amazonaws.com/files.d20.io/images/10242164/PUjMZwsFbYRnBC01lilM7A/thumb.jpg?1434626834', w: 840, h: 840},
{key: '005', url: 'https://s3.amazonaws.com/files.d20.io/images/10242167/UjwTYXjE1dC4XDx3AC7ekg/thumb.jpg?1434626836', w: 840, h: 840},
@BaldarSilveraxe
BaldarSilveraxe / DungeonDrawDoorUpdate
Created Jun 17, 2015
Dungeon Draw Door Update Test
View DungeonDrawDoorUpdate
var DungeonDrawDoors = DungeonDrawDoors || (function(){
'use strict';
//version = 2.9
//lastUpdate = 1430236079 //Unix timestamp
//schemaVersion = 2.9
var defaultTexture = 'Old School|#18769c',
//light settings
light_radius_setting = 30,
View DungeonDrawUpdateTest
var DungeonDraw = DungeonDraw || (function(){
'use strict';
//settings
var defaultTexture = 'Old School|#18769c',
cssButtonAnchor = ' style="border: 1px solid AliceBlue; background-color: SteelBlue; color: white;" ',
cssButtonSpan = ' style="color: white; font-weight: normal; display: block; width: 150px;" ',
cssButtonAnchorImg = ' style="border: 1px solid Black; background-color: White; color: white;" ',
cssButtonImg = ' style="padding: 0px 0px 0px 0px; outline: none; border: none;" ',
deferred={
View activeMap
var activeMap = activeMap || (function(){
'use strict';
var version = '0.2.0',
lastUpdate = 1430550687,
schemaVersion = 0.3,
objExtractKeys = ['id','pageid','stroke','rotation','layer','width','height','top','left','controlledby',
'imgsrc', 'flipv', 'fliph'],
You can’t perform that action at this time.