This file contains hidden or 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 ("change:campaign:turnorder", function(obj) { | |
| var c=Campaign() | |
| var turn_order = JSON.parse(c.get('turnorder')); | |
| var current = {} | |
| current.turn=turn_order[0] | |
| current.token = getObj( "graphic", current.turn.id); | |
| current.character = getObj('character', current.token.get("_represents")); | |
| current.markers = { | |
| marked : current.token.get("status_yellow"), |
This file contains hidden or 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) { | |
| if(msg.type == "api" && msg.content.toLowerCase().indexOf('!damage') !== -1) { | |
| var slice = msg.content.split(" "); //Splits the message input based off spaces. slice[0] is !Attack. | |
| var rollname = slice[3]; | |
| var rollmsg = "/roll " + rollname; | |
| sendChat("playername", rollmsg, function(ops) { | |
| var damageresult = JSON.parse(ops[0].content) | |
| var enemyid = slice[1]; | |
| var damage = slice[2]; |
This file contains hidden or 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) { | |
| if(msg.type == "api" && msg.content.toLowerCase().indexOf('!heal') !== -1) { | |
| var slice = msg.content.split(" "); //Splits the message input based off spaces. slice[0] is !Attack. | |
| var healtarget = slice[1]; | |
| var healsource = slice[2]; | |
| var curPageID = findObjs({_type: "campaign"})[0].get("playerpageid"); | |
| var toke = findObjs({_type: "character", name: healtarget})[0]; | |
| var token = findObjs({_type: "graphic", _subtype: "token", _pageid: curPageID, name: healtarget}, {caseInsensitive: true})[0]; | |
| var surgevalue = findObjs({ _type: 'attribute', name: 'surgevalue', _characterid: toke.id })[0]; | |
| var currenthpvalue = findObjs({ _type: 'attribute', name: 'HP', _characterid: toke.id })[0]; |
This file contains hidden or 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
| //attacktarget = function(msg) { | |
| on("chat:message", function(msg) { | |
| if(msg.type == "whisper" && msg.content.toLowerCase().indexOf('!attack') !== -1 || msg.type == "api" && msg.content.toLowerCase().indexOf('!attack') !== -1) { | |
| var slice = msg.content.split(" "); | |
| // slice 1 is target, slice 2 is source, slice 3 is defensetype, slice 4 is damage roll slice 5 is to hit value slice 6 is bonusdamage slice 7 is critdamage slice 8 is extra to hit from the attack(say it comes with +2 attack or something) | |
| // definining the enemy stats based on the first person named after the !attack | |
| var enemytokenid = slice[1]; | |
| var playertokenid = slice[2]; | |
| var targetdefensename = slice[3]; | |
| var rollname = slice[4]; |
This file contains hidden or 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) { | |
| if(msg.type == "api" && msg.content.toLowerCase().indexOf('!monster') !== -1) | |
| { | |
| var slice = msg.content.split(" "); | |
| var monsterlevel = parseInt(slice[1]); | |
| var monstertype = slice[2]; | |
| var monstername = slice[3]; | |
| var ac = 14 + monsterlevel; | |
| var will = 12 + monsterlevel; | |
| var reflex = 12 + monsterlevel; |
This file contains hidden or 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
| // attacktarget = function() { | |
| on("chat:message", function(msg) { | |
| if(msg.type != 'api' || msg.content.toLowerCase().indexOf('!aoe') != 0) return; | |
| var args1 = msg.content.toLowerCase().split(' '); | |
| args1.shift(); | |