diff --git a/Shadowrun5th/Shadowrun5th.html b/Shadowrun5th/Shadowrun5th.html index 2bd073743b..27488d7faf 100644 --- a/Shadowrun5th/Shadowrun5th.html +++ b/Shadowrun5th/Shadowrun5th.html @@ -38,7 +38,6 @@ -

Attributes

@@ -6873,6 +6872,297 @@ only the modifier like '-1' a zeros and positive numbers also need a sign like '+0' +For Rituals enter '*2' to display the amount of Dice to be rolled seperatly"> +
+
+ +
+
+ +
+
+ +
+
X
+
+
+ + +
+
+ + +
+
+ +
+

Rituals

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
X
+
+
+ + +
+
+ + +
+
+
+
+

Alchemy

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
X
+
+
+ + +
+
+ + +
+
+
+
+

Powers

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
@@ -9690,191 +9980,191 @@ Click again to switch to Manual and Remote"> -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -10689,6 +10979,21 @@ function clearSheet(attributes, experimental) { removeRepeatingRow("repeating_spells_"+idarray[i]); } }); + getSectionIDs("repeating_rituals", function(idarray) { + for(var i=0; i < idarray.length; i++) { + removeRepeatingRow("repeating_rituals_"+idarray[i]); + } + }); + getSectionIDs("repeating_alchemy", function(idarray) { + for(var i=0; i < idarray.length; i++) { + removeRepeatingRow("repeating_alchemy_"+idarray[i]); + } + }); + getSectionIDs("repeating_critterpowers", function(idarray) { + for(var i=0; i < idarray.length; i++) { + removeRepeatingRow("repeating_critterpowers_"+idarray[i]); + } + }); getSectionIDs("repeating_initiation", function(idarray) { for(var i=0; i < idarray.length; i++) { removeRepeatingRow("repeating_initiation_"+idarray[i]); @@ -10783,58 +11088,63 @@ on("change:chummercheckbox", function(){ console.log("Character meta info"); if(chummerfile.characters.character.alias != null) attributes.character_name = chummerfile.characters.character.alias; - if(chummerfile.characters.character.metatype!=null) + + if(chummerfile.characters.character.metatype != null) attributes.metatype=chummerfile.characters.character.metatype; - if(chummerfile.characters.character.sex!=null) + + if(chummerfile.characters.character.sex != null) attributes.sex=chummerfile.characters.character.sex; - if(chummerfile.characters.character.age!=null) + + if(chummerfile.characters.character.age != null) attributes.age=chummerfile.characters.character.age; - if(chummerfile.characters.character.height!=null) + + if(chummerfile.characters.character.height != null) attributes.height=chummerfile.characters.character.height; - if(chummerfile.characters.character.weight!=null) + + if(chummerfile.characters.character.weight != null) attributes.weight=chummerfile.characters.character.weight; - if(chummerfile.characters.character.playername!=null) + if(chummerfile.characters.character.playername != null) attributes.player=chummerfile.characters.character.playername; - if(chummerfile.characters.character.description!=null) + if(chummerfile.characters.character.description != null) attributes.description=chummerfile.characters.character.description; - if(chummerfile.characters.character.background!=null) + if(chummerfile.characters.character.background != null) attributes.background=chummerfile.characters.character.background; - if(chummerfile.characters.character.notes!=null) + if(chummerfile.characters.character.notes != null) attributes.notes=chummerfile.characters.character.notes; - if(chummerfile.characters.character.gamenotes!=null) + if(chummerfile.characters.character.gamenotes != null) attributes.generalnotes=chummerfile.characters.character.gamenotes; - if(chummerfile.characters.character.karma!=null) + if(chummerfile.characters.character.karma != null) attributes.karma=chummerfile.characters.character.karma; - if(chummerfile.characters.character.totalkarma!=null) + if(chummerfile.characters.character.totalkarma != null) attributes.karmacareer=chummerfile.characters.character.totalkarma; - if(chummerfile.characters.character.initbonus!=null){ + if(chummerfile.characters.character.initbonus != null){ attributes.initiativebonus=chummerfile.characters.character.initbonus; attributes.astralinitiativebonus=chummerfile.characters.character.initbonus; attributes.matrixinitiativebonus=chummerfile.characters.character.initbonus; } - if(chummerfile.characters.character.initdice!=null) + if(chummerfile.characters.character.initdice != null) attributes.initiativedice=chummerfile.characters.character.initdice; - if(chummerfile.characters.character.astralinitdice!=null) + if(chummerfile.characters.character.astralinitdice != null) attributes.astralinitiativedice=chummerfile.characters.character.astralinitdice; - if(chummerfile.characters.character.cmthresholdoffset!=null) + if(chummerfile.characters.character.cmthresholdoffset != null) attributes.woundadditive=chummerfile.characters.character.cmthresholdoffset; - if(chummerfile.characters.character.cmthreshold!=null) + if(chummerfile.characters.character.cmthreshold != null) attributes.woundmultiplikative=chummerfile.characters.character.cmthreshold; - if(chummerfile.characters.character.cmoverflow!=null) + if(chummerfile.characters.character.cmoverflow != null) attributes.overflowmod=chummerfile.characters.character.cmoverflow-chummerfile.characters.character.attributes[1].attribute[0].total- 1; - if(chummerfile.characters.character.physicalcm!=null) + if(chummerfile.characters.character.physicalcm != null) attributes.physicaltrackmod=chummerfile.characters.character.physicalcm-Math.ceil(chummerfile.characters.character.attributes[1].attribute[0].total/2)- 8; - if(chummerfile.characters.character.stuncm!=null) + if(chummerfile.characters.character.stuncm != null) attributes.stuntrackmod=chummerfile.characters.character.stuncm-Math.ceil(chummerfile.characters.character.attributes[1].attribute[7].total/2)- 8; - if(chummerfile.characters.character.totalstreetcred!=null) + if(chummerfile.characters.character.totalstreetcred != null) attributes.streetcred=chummerfile.characters.character.totalstreetcred; - if(chummerfile.characters.character.totalnotoriety!=null) + if(chummerfile.characters.character.totalnotoriety != null) attributes.notoriety=chummerfile.characters.character.totalnotoriety; - if(chummerfile.characters.character.totalpublicawareness!=null) + if(chummerfile.characters.character.totalpublicawareness != null) attributes.pawareness=chummerfile.characters.character.totalpublicawareness; - if(chummerfile.characters.character.nuyen!=null) + if(chummerfile.characters.character.nuyen != null) attributes.nuyen_total=chummerfile.characters.character.nuyen; - if(chummerfile.characters.character.magician=="True"){ + if(chummerfile.characters.character.magician == "True"){ // HeroLab 'chummer' export uses drainattribute property and a list, this is a workaround for that try{ attributes.drainattribute="@{"+chummerfile.characters.character.tradition.drainattributes.match(/[A-Z]+/g)[1].toLowerCase()+"_total}"; @@ -11800,60 +12110,18 @@ on("change:chummercheckbox", function(){ error= error + "\n" + "Error with Skills: "+ err; } try{ - if(chummerfile.characters.character.spells!=null){ + if(chummerfile.characters.character.spells != null){ console.log("Importing spells"); - if(chummerfile.characters.character.spells.spell.length>1){ - for(var i=0;i 1){ + for(var i=0; i < chummerfile.characters.character.spells.spell.length; i++){ + importSingleSpell(chummerfile.characters.character.spells.spell[i], attributes, spellcastingSkill, ritualSkill, alchemySkill); } }else{ - var newrowid=generateRowID(); - attributes["repeating_spells_"+newrowid+"_spellname"]=chummerfile.characters.character.spells.spell.name; - attributes["repeating_spells_"+newrowid+"_spelltype"]=chummerfile.characters.character.spells.spell.type; - if(chummerfile.characters.character.spells.spell.notes!=null){ - attributes["repeating_spells_"+newrowid+"_spelldescription"]=chummerfile.characters.character.spells.spell.notes; - } - if(chummerfile.characters.character.spells.spell.dv.match(/(\-|\+)\d/)!=null) - attributes["repeating_spells_"+newrowid+"_spelldrain"]=chummerfile.characters.character.spells.spell.dv.match(/(\-|\+)\d/)[0]; - else - attributes["repeating_spells_"+newrowid+"_spelldrain"]="-0"; - if(chummerfile.characters.character.spells.spell.category=="Rituals" || chummerfile.characters.character.spells.spell[i].category_english=="Rituals"){ - attributes["repeating_spells_"+newrowid+"_spellschool"]="@{skilldicepool67}"; - attributes["repeating_spells_"+newrowid+"_spelldrain"]="*2"; - attributes["repeating_spells_"+newrowid+"_spellbonus"]=chummerfile.characters.character.spells.spell.dicepool-chummerfile.characters.character.skills.skill[ritual].total; - }else{ - attributes["repeating_spells_"+newrowid+"_spellcategory"]=chummerfile.characters.character.spells.spell.category; - attributes["repeating_spells_"+newrowid+"_spellbonus"]=chummerfile.characters.character.spells.spell.dicepool-chummerfile.characters.character.skills.skill[spellcasting].total; - if(chummerfile.characters.character.spells.spell.alchemy=="True"){ - attributes["repeating_spells_"+newrowid+"_spellschool"]="@{skilldicepool58}"; - attributes["repeating_spells_"+newrowid+"_spellbonus"]=chummerfile.characters.character.spells.spell.dicepool-chummerfile.characters.character.skills.skill[alchemy].total; - } - } - attributes["repeating_spells_"+newrowid+"_spellrange"]=chummerfile.characters.character.spells.spell.range; - attributes["repeating_spells_"+newrowid+"_spellduration"]=chummerfile.characters.character.spells.spell.duration; + importSingleSpell(chummerfile.characters.character.spells.spell, attributes, spellcastingSkill, ritualSkill, alchemySkill); } } }catch(err){ @@ -11866,50 +12134,50 @@ on("change:chummercheckbox", function(){ if(chummerfile.characters.character.critterpowers.critterpower.length > 1){ for(var i=0; i < chummerfile.characters.character.critterpowers.critterpower.length; i++){ var newrowid=generateRowID(); - attributes["repeating_spells_"+newrowid+"_spellname"]=chummerfile.characters.character.critterpowers.critterpower[i].fullname; - attributes["repeating_spells_"+newrowid+"_spelltype"]=chummerfile.characters.character.critterpowers.critterpower[i].type; + attributes["repeating_critterpowers_"+newrowid+"_spellname"]=chummerfile.characters.character.critterpowers.critterpower[i].fullname; + attributes["repeating_critterpowers_"+newrowid+"_spelltype"]=chummerfile.characters.character.critterpowers.critterpower[i].type; if(chummerfile.characters.character.critterpowers.critterpower[i].notes != null){ - attributes["repeating_spells_"+newrowid+"_spelldescription"] = chummerfile.characters.character.critterpowers.critterpower[i].notes; + attributes["repeating_critterpowers_"+newrowid+"_spelldescription"] = chummerfile.characters.character.critterpowers.critterpower[i].notes; } - attributes["repeating_spells_"+newrowid+"_spelldrain"]="-0"; + attributes["repeating_critterpowers_"+newrowid+"_spelldrain"]="-0"; - attributes["repeating_spells_"+newrowid+"_spellcategory"] = chummerfile.characters.character.critterpowers.critterpower[i].category; - attributes["repeating_spells_"+newrowid+"_spellbonus"]=0; + attributes["repeating_critterpowers_"+newrowid+"_spellcategory"] = chummerfile.characters.character.critterpowers.critterpower[i].category; + attributes["repeating_critterpowers_"+newrowid+"_spellbonus"]=0; if(chummerfile.characters.character.critterpowers.critterpower[i].range != null){ - attributes["repeating_spells_"+newrowid+"_spellrange"]=chummerfile.characters.character.critterpowers.critterpower[i].range; + attributes["repeating_critterpowers_"+newrowid+"_spellrange"]=chummerfile.characters.character.critterpowers.critterpower[i].range; } else { - attributes["repeating_spells_"+newrowid+"_spellrange"]="N/A"; + attributes["repeating_critterpowers_"+newrowid+"_spellrange"]="N/A"; } if(chummerfile.characters.character.critterpowers.critterpower[i].duration != null) { - attributes["repeating_spells_"+newrowid+"_spellduration"] = chummerfile.characters.character.critterpowers.critterpower[i].duration; + attributes["repeating_critterpowers_"+newrowid+"_spellduration"] = chummerfile.characters.character.critterpowers.critterpower[i].duration; } else { - attributes["repeating_spells_"+newrowid+"_spellduration"] = "N/A"; + attributes["repeating_critterpowers_"+newrowid+"_spellduration"] = "N/A"; } } }else{ var newrowid=generateRowID(); - attributes["repeating_spells_"+newrowid+"_spellname"]=chummerfile.characters.character.critterpowers.critterpower.fullname; - attributes["repeating_spells_"+newrowid+"_spelltype"]=chummerfile.characters.character.critterpowers.critterpower.type; + attributes["repeating_critterpowers_"+newrowid+"_spellname"]=chummerfile.characters.character.critterpowers.critterpower.fullname; + attributes["repeating_critterpowers_"+newrowid+"_spelltype"]=chummerfile.characters.character.critterpowers.critterpower.type; if(chummerfile.characters.character.critterpowers.critterpower.notes!=null){ - attributes["repeating_spells_"+newrowid+"_spelldescription"]=chummerfile.characters.character.critterpowers.critterpower.notes; + attributes["repeating_critterpowers_"+newrowid+"_spelldescription"]=chummerfile.characters.character.critterpowers.critterpower.notes; } - attributes["repeating_spells_"+newrowid+"_spelldrain"]="-0"; - attributes["repeating_spells_"+newrowid+"_spellcategory"]=chummerfile.characters.character.critterpowers.critterpower.category; - attributes["repeating_spells_"+newrowid+"_spellbonus"]=0; + attributes["repeating_critterpowers_"+newrowid+"_spelldrain"]="-0"; + attributes["repeating_critterpowers_"+newrowid+"_spellcategory"]=chummerfile.characters.character.critterpowers.critterpower.category; + attributes["repeating_critterpowers_"+newrowid+"_spellbonus"]=0; if(chummerfile.characters.character.critterpowers.critterpower.range != null){ - attributes["repeating_spells_"+newrowid+"_spellrange"]=chummerfile.characters.character.critterpowers.critterpower.range; + attributes["repeating_critterpowers_"+newrowid+"_spellrange"]=chummerfile.characters.character.critterpowers.critterpower.range; } else { - attributes["repeating_spells_"+newrowid+"_spellrange"]="N/A"; + attributes["repeating_critterpowers_"+newrowid+"_spellrange"]="N/A"; } if(chummerfile.characters.character.critterpowers.critterpower.duration != null) { - attributes["repeating_spells_"+newrowid+"_spellduration"]=chummerfile.characters.character.critterpowers.critterpower.duration; + attributes["repeating_critterpowers_"+newrowid+"_spellduration"]=chummerfile.characters.character.critterpowers.critterpower.duration; } else { - attributes["repeating_spells_"+newrowid+"_spellduration"]="N/A"; + attributes["repeating_critterpowers_"+newrowid+"_spellduration"]="N/A"; } } } @@ -12048,6 +12316,47 @@ function importSingleArmor(armor, attributes) { } } +function importSingleSpell(spell, attributes, spellcasting, ritual, alchemy) { + var category = "spells"; + if(spell.category_english == "Rituals") { + category = "rituals" + } + if(spell.alchemy == "True"){ + category = "alchemy" + } + + var row = "repeating_" + category + "_" + generateRowID(); + + attributes[row + "_spellname"] = spell.name; + attributes[row + "_spelltype"] = spell.type; + attributes[row + "_spellcategory"] = spell.category; + if(spell.notes != null){ + attributes[row + "_spelldescription"] = spell.notes; + } + if(spell.dv.match(/(\-|\+)\d/) != null) { + attributes[row + "_spelldrain"] = spell.dv.match(/(\-|\+)\d/)[0]; + } + else { + attributes[row + "_spelldrain"] = "-0"; + } + + + if(spell.category_english == "Rituals"){ + attributes[row + "_spellschool"] = "@{skilldicepool67}"; + attributes[row + "_spelldrain"] = "*2"; + attributes[row + "_spellbonus"] = spell.dicepool - ritual; + } else { + attributes[row + "_spellbonus"] = spell.dicepool - spellcasting; + if(spell.alchemy == "True"){ + attributes[row + "_spellschool"] = "@{skilldicepool58}"; + attributes[row + "_spellbonus"] = spell.dicepool - alchemy; + } + } + + attributes[row + "_spellrange"] = spell.range; + attributes[row + "_spellduration"] = spell.duration; +} + on("change:wil_base change:wil_aug", function() { getAttrs(["wil_base", "wil_aug"], function(value){ var wil = parseInt(value.wil_base) + parseInt(value.wil_aug); diff --git a/Shadowrun5th/js/importSingleSpell.js b/Shadowrun5th/js/importSingleSpell.js new file mode 100644 index 0000000000..e221a2d234 --- /dev/null +++ b/Shadowrun5th/js/importSingleSpell.js @@ -0,0 +1,40 @@ +function importSingleSpell(spell, attributes, spellcasting, ritual, alchemy) { + var category = "spells"; + if(spell.category_english == "Rituals") { + category = "rituals" + } + if(spell.alchemy == "True"){ + category = "alchemy" + } + + var row = "repeating_" + category + "_" + generateRowID(); + + attributes[row + "_spellname"] = spell.name; + attributes[row + "_spelltype"] = spell.type; + attributes[row + "_spellcategory"] = spell.category; + if(spell.notes != null){ + attributes[row + "_spelldescription"] = spell.notes; + } + if(spell.dv.match(/(\-|\+)\d/) != null) { + attributes[row + "_spelldrain"] = spell.dv.match(/(\-|\+)\d/)[0]; + } + else { + attributes[row + "_spelldrain"] = "-0"; + } + + + if(spell.category_english == "Rituals"){ + attributes[row + "_spellschool"] = "@{skilldicepool67}"; + attributes[row + "_spelldrain"] = "*2"; + attributes[row + "_spellbonus"] = spell.dicepool - ritual; + } else { + attributes[row + "_spellbonus"] = spell.dicepool - spellcasting; + if(spell.alchemy == "True"){ + attributes[row + "_spellschool"] = "@{skilldicepool58}"; + attributes[row + "_spellbonus"] = spell.dicepool - alchemy; + } + } + + attributes[row + "_spellrange"] = spell.range; + attributes[row + "_spellduration"] = spell.duration; +} \ No newline at end of file