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
// Github: | |
// By: Wandler, The Apprentice | |
// Contact: | |
var Shadowrun = Shadowrun || (function() { | |
'use strict'; | |
var version = '0.0.1', | |
lastUpdate = 1427604268, | |
tableCache = {}, |
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("change:repeating_skillsactionmod remove:repeating_skillsactionmod",function() { | |
var modifiers = {}; | |
TAS.repeating("skillsactionmod") | |
.fields('skillsname','modifier','active') //< specifying the fields we care about | |
.reduce(function(m,r){ | |
if(!(r.skillsaction_name in m.modifiers)){ | |
m.modifiers[r.skillsaction_name] = 0; | |
}else{ | |
if(r.active === "on"){ | |
m.modifiers[r.skillsaction_name] += r.modifier; |
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 copyCharacter = function(name){ | |
var characters = findObjs({type:'character'}); | |
var i = characters.length; | |
var old = _.filter(characters,function(o){return o.get('name') === name})[0]; | |
if(old === undefined){log("Character "+name+" not found!");return;} | |
var nr = 0; | |
var c_name = name+" "+nr; | |
while(_.filter(characters,function(o){return o.get('name') === c_name}).length>0){ | |
nr++;//Increment counter until we found a unique character | |
c_name = name+" "+nr; |
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 cleanUp = function(){ | |
var attributes_of_deleted = findObjs({type:'attribute'}); | |
var abilities_of_deleted = findObjs({type:'ability'}); | |
//log("#Attributes after delete: "+attributes_of_deleted.length); | |
var count = 0; | |
log("LIST trash attributes"); | |
for(var attr in attributes_of_deleted){ | |
attr = attributes_of_deleted[attr]; | |
var chr = findObjs({type:'character',id:attr.get('characterid')}); |
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("sheet:opened change:repeating_attrmodkon remove:repeating_attrmodkon",function() { | |
TAS.repeating("attrmodkon") | |
.attrs("kon_mod") //< getting the attributes for the totals | |
.fields('value','active') //< specifying the fields we care about | |
.reduce(function(m,r){ | |
var active = r.active; | |
if(active == "on"){ | |
m += parseInt(r.I.value); //< Generate a running cost | |
} | |
return m; |
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
import sys | |
import re | |
import os | |
inputfile = sys.argv[1] | |
prefix = sys.argv[2] | |
print("Extract:"+prefix); | |
def lreplace(pattern, sub, string): | |
""" |
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
import sys | |
import re | |
import os | |
prefix = sys.argv[1] | |
print("Extract:"+prefix); | |
def lreplace(pattern, sub, string): | |
""" | |
Replaces 'pattern' in 'string' with 'sub' if 'pattern' starts 'string'. |
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
/* Uploaded to GitHub 12/07 */ | |
/* No changes, resubmit of update */ | |
/* Light colored background */ | |
/* Template 2 */ | |
.sheet-rolltemplate-sr2 table { | |
width: 100%; | |
background-color: white; | |
border: 1px solid #000; |
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
/* Uploaded to GitHub 12/07 */ | |
/* No changes, resubmit of update */ | |
/* Light colored background */ | |
/* Template 2 */ | |
.sheet-rolltemplate-sr2 table { | |
width: 100%; | |
background-color: white; | |
border: 1px solid #000; |
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
/* Uploaded to GitHub 12/07 */ | |
/* No changes, resubmit of update */ | |
/* Light colored background */ | |
/* Template 2 */ | |
.sheet-rolltemplate-sr2 table { | |
width: 100%; | |
background-color: white; | |
border: 1px solid #000; |
NewerOlder