From 5c2ac447d4ed228d2a55cfec56c1909936ebe84b Mon Sep 17 00:00:00 2001 From: Stexinator Date: Fri, 5 Nov 2021 16:52:56 +0100 Subject: [PATCH] [Shadowrun5thA] unexperimental critterpowers + ammo import --- Shadowrun5th/Shadowrun5th.html | 208 +++++++++++++++------------------ 1 file changed, 93 insertions(+), 115 deletions(-) diff --git a/Shadowrun5th/Shadowrun5th.html b/Shadowrun5th/Shadowrun5th.html index 0c10b034ef..6ebf4439ff 100644 --- a/Shadowrun5th/Shadowrun5th.html +++ b/Shadowrun5th/Shadowrun5th.html @@ -60,29 +60,29 @@

Base

-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+

Bonus

-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+

Total

@@ -8689,7 +8689,7 @@ Click again to switch to Manual and Remote">
- + @@ -8981,7 +8981,7 @@ Click again to switch to Manual and Remote">
- + @@ -9273,7 +9273,7 @@ Click again to switch to Manual and Remote">
- + @@ -9565,7 +9565,7 @@ Click again to switch to Manual and Remote">
- + @@ -9859,7 +9859,7 @@ Click again to switch to Manual and Remote">
- + @@ -9929,7 +9929,7 @@ Click again to switch to Manual and Remote">
- Enable experimental import of ammunition, critter powers + Enable experimental imports (currently none)
@@ -11271,49 +11271,47 @@ function clearSheet(attributes, experimental) { } }); - if(experimental == "on") { - //removing ammo - getSectionIDs("repeating_ammotype1", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype1_"+idarray[j]); - } - }); - getSectionIDs("repeating_ammotype2", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype2_"+idarray[j]); - } - }); - getSectionIDs("repeating_ammotype3", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype3_"+idarray[j]); - } - }); - getSectionIDs("repeating_ammotype4", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype4_"+idarray[j]); - } - }); - getSectionIDs("repeating_ammotype5", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype5_"+idarray[j]); - } - }); - getSectionIDs("repeating_ammotype6", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype6_"+idarray[j]); - } - }); - getSectionIDs("repeating_ammotype7", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype7_"+idarray[j]); - } - }); - getSectionIDs("repeating_ammotype8", function(idarray) { - for(var j=0; j < idarray.length; j++) { - removeRepeatingRow("repeating_ammotype8_"+idarray[j]); - } - }); - } + //removing ammo + getSectionIDs("repeating_ammotype1", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype1_"+idarray[j]); + } + }); + getSectionIDs("repeating_ammotype2", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype2_"+idarray[j]); + } + }); + getSectionIDs("repeating_ammotype3", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype3_"+idarray[j]); + } + }); + getSectionIDs("repeating_ammotype4", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype4_"+idarray[j]); + } + }); + getSectionIDs("repeating_ammotype5", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype5_"+idarray[j]); + } + }); + getSectionIDs("repeating_ammotype6", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype6_"+idarray[j]); + } + }); + getSectionIDs("repeating_ammotype7", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype7_"+idarray[j]); + } + }); + getSectionIDs("repeating_ammotype8", function(idarray) { + for(var j=0; j < idarray.length; j++) { + removeRepeatingRow("repeating_ammotype8_"+idarray[j]); + } + }); } @@ -12028,7 +12026,7 @@ on("change:chummercheckbox", async function(){ error= error + "\n" + "Error with Spells: " + err; } try{ - if(chummerfile.characters.character.critterpowers != null && text.experimental == "on"){ + if(chummerfile.characters.character.critterpowers != null){ console.log("Importing critter powers"); if(chummerfile.characters.character.critterpowers.critterpower.length > 1){ for(var i=0; i < chummerfile.characters.character.critterpowers.critterpower.length; i++){ @@ -12212,7 +12210,7 @@ function importSingleWeapon(text, weapon, number, ammunition, attributes) { } } - if(text.experimental == "on" && weapon.clips !== null){ + if(weapon.clips !== null){ if(weapon.clips.clip.length>1){ for(var j=0; j 1){ let amountImported = 0; for(var j=0; j < weapon.clips.clip.length && amountImported < 4; j++){ @@ -12381,28 +12369,18 @@ async function importRepeatingWeaponAmmo(row, ammunition, number, attributes) { attributes[row + "ammoname"+number] = ammo.name; - if(ammo.weaponbonusdamage_english != null && ammo.weaponbonusap != null && ammo.weaponbonusacc != null) { - attributes[row + "ammodv" + number] = ammo.weaponbonusdamage_english.substring(0,2); - attributes[row + "ammodmgtype" + number] = ammo.weaponbonusdamage_english.substring(2); - if(ammo.name_english === "Ammo: Stick-n-Shock") { - attributes[row + "_ammoap" + number] = -5 - attributes[row + "weaponap"] - } - else { - attributes[row + "ammoap" + number] = ammo.weaponbonusap; - } - attributes[row + "ammoacc" + number] = ammo.weaponbonusacc; + attributes[row + "ammodv" + number] = ammo.weaponbonusdamage_english != null ? ammo.weaponbonusdamage_english.substring(0,2) : 0; + if(ammo.weaponbonusdamage_english != null) { + attributes[row + "ammodmgtype" + number] = ammo.weaponbonusdamage_english.substring(2); + } + + if(ammo.name_english === "Ammo: Stick-n-Shock") { + attributes[row + "_ammoap" + number] = -5 - attributes[row + "weaponap"] } else { - attributes[row + "ammodv" + number] = 0; - attributes[row + "ammodmgtype" + number] = 0; - if(ammo.name_english === "Ammo: Stick-n-Shock") { - attributes[row + "ammoap" + number] = -5 - attributes[row + "weaponap"] - } - else { - attributes[row + "ammoap" + number] = 0; - } - attributes[row + "ammoacc" + number] = 0; + attributes[row + "ammoap" + number] = ammo.weaponbonusap != null? ammo.weaponbonusap : 0; } + attributes[row + "ammoacc" + number] = mmo.weaponbonusacc != null ? ammo.weaponbonusacc : 0; } function importSingleArmor(armor, attributes) {