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("add:character", function(obj) { | |
// If there aren't any ability objects to grab, then we're probably in the middle of a sandbox spin-up | |
if (findObjs({ _type: "ability"}).length === 0) | |
return; | |
var abil = findObjs({ _type: "ability", _characterid: obj.id}); | |
if (abil.length === 0) // Only create the abilities if the character doesn't have any | |
{ | |
createObj("ability", { | |
name: "Init", |
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
function getAttributeObjects(characterObj,attributeArray) { | |
"use strict"; | |
var i, | |
j = 0, | |
attributeObjArray = [], | |
attributeValue = [] ; | |
// can pass array of attribute strings or a single attribute string along with an associated character | |
// returns those attributes as an object array or returns false if they do not exist on the passed 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
function getCharacterObj(obj) { | |
"use strict"; | |
//send any object and returns the associated character object | |
//returns character object for attribute, token/graphic, and ability, and... character | |
var objType = obj._type, | |
att, characterObj, tok; | |
if ((objType !== "attribute") && (objType !== "graphic") && (objType !== "character")) { |
NewerOlder