[Shadowrun5thA] unexperimental critterpowers + ammo import
This commit is contained in:
+93
-115
@@ -60,29 +60,29 @@
|
||||
</div>
|
||||
<div class="statcol2">
|
||||
<div class="statheading"><h4>Base</h4></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_bod_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_agi_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_rea_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_str_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_cha_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_int_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_log_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_wil_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_mag_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_edg_total" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_bod_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_agi_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_rea_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_str_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_cha_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_int_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_log_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_wil_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_mag_base" title="Base Attribute unaugmented"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_edg_total" title="Base Attribute unaugmented"></div>
|
||||
</div>
|
||||
<div class="statcol3">
|
||||
<div class="statsubcol">
|
||||
<div class="statheading"><h4>Bonus</h4></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_bod_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_agi_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_rea_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_str_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_cha_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_int_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_log_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_wil_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="text" class="statinput" name="attr_mag_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_bod_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_agi_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_rea_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_str_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_cha_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_int_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_log_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_wil_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
<div class="statinputwrapper"><input type="number" class="statinput" name="attr_mag_aug" value="0" title="Bonuses from Augmentations"></div>
|
||||
</div>
|
||||
<div class="statsubcol">
|
||||
<div class="statheading"><h4>Total</h4></div>
|
||||
@@ -8689,7 +8689,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype1}">Weapon</option>
|
||||
<option value="@{weapondmgtype1}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -8835,7 +8835,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype2}">Weapon</option>
|
||||
<option value="@{weapondmgtype2}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -8981,7 +8981,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype3}">Weapon</option>
|
||||
<option value="@{weapondmgtype3}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9127,7 +9127,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype4}">Weapon</option>
|
||||
<option value="@{weapondmgtype4}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9273,7 +9273,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype5}">Weapon</option>
|
||||
<option value="@{weapondmgtype5}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9419,7 +9419,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype6}">Weapon</option>
|
||||
<option value="@{weapondmgtype6}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9565,7 +9565,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype7}">Weapon</option>
|
||||
<option value="@{weapondmgtype7}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9711,7 +9711,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype">
|
||||
<option value="@{weapondmgtype8}">Weapon</option>
|
||||
<option value="@{weapondmgtype8}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9859,7 +9859,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype0">
|
||||
<option value="@{weapondmgtype}">Weapon</option>
|
||||
<option value="@{weapondmgtype}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9894,7 +9894,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype1">
|
||||
<option value="@{weapondmgtype}">Weapon</option>
|
||||
<option value="@{weapondmgtype}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -9929,7 +9929,7 @@ Click again to switch to Manual and Remote">
|
||||
</div>
|
||||
<div class="ammodmgtypewrapper">
|
||||
<select name="attr_ammodmgtype2">
|
||||
<option value="@{weapondmgtype}">Weapon</option>
|
||||
<option value="@{weapondmgtype}" selected="selected">Weapon</option>
|
||||
<option value="P">Physical</option>
|
||||
<option value="S">Stun</option>
|
||||
<option value="S(e)">Stun (electric)</option>
|
||||
@@ -10198,11 +10198,11 @@ Click again to switch to Manual and Remote">
|
||||
<div class="experimental">
|
||||
<label>
|
||||
<input class="experimental-checkbox" type="checkbox" name="attr_experimental">
|
||||
Enable experimental import of ammunition, critter powers
|
||||
Enable experimental imports (currently none)
|
||||
</label>
|
||||
<label>
|
||||
<input class="experimental-checkbox" type="checkbox" name="attr_nightly">
|
||||
Enable additional imports which use Chummer nightly only features
|
||||
Enable additional imports which use Chummer nightly only features (currently none)
|
||||
</label>
|
||||
</div>
|
||||
<div class="experimental">
|
||||
@@ -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<weapon.clips.clip.length; j++){
|
||||
|
||||
@@ -12247,28 +12245,18 @@ function importRepeatingAmmo(ammunition, number, attributes) {
|
||||
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoname"] = ammo.name;
|
||||
|
||||
if(ammo.weaponbonusdamage_english != null && ammo.weaponbonusap != null && ammo.weaponbonusacc != null) {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammodv"] = ammo.weaponbonusdamage_english.substring(0,2);
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammodv"] = ammo.weaponbonusdamage_english != null ? ammo.weaponbonusdamage_english.substring(0,2) : 0;
|
||||
if(ammo.weaponbonusdamage_english != null) {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammodmgtype"] = ammo.weaponbonusdamage_english.substring(2);
|
||||
if(ammo.name_english === "Ammo: Stick-n-Shock") {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoap"] = -5 - attributes["weaponap"+number]
|
||||
}
|
||||
else {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoap"] = ammo.weaponbonusap;
|
||||
}
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoacc"] = ammo.weaponbonusacc;
|
||||
}
|
||||
|
||||
if(ammo.name_english === "Ammo: Stick-n-Shock") {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoap"] = -5 - attributes["weaponap"+number]
|
||||
}
|
||||
else {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammodv"] = 0;
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammodmgtype"] = 0;
|
||||
if(ammo.name_english === "Ammo: Stick-n-Shock") {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoap"] = -5 - attributes["weaponap"+number]
|
||||
}
|
||||
else {
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoap"] = 0;
|
||||
}
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoacc"] = 0;
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoap"] = ammo.weaponbonusap != null? ammo.weaponbonusap : 0;
|
||||
}
|
||||
attributes["repeating_ammotype"+number+"_"+newrowid+"_ammoacc"] = ammo.weaponbonusacc != null ? ammo.weaponbonusacc : 0;
|
||||
}
|
||||
|
||||
async function importSingleRepeatingWeapon(text, weapon, ammunition, attributes) {
|
||||
@@ -12345,7 +12333,7 @@ async function importSingleRepeatingWeapon(text, weapon, ammunition, attributes)
|
||||
}
|
||||
}
|
||||
|
||||
if(text.experimental == "on" && weapon.clips !== null){
|
||||
if(weapon.clips !== null){
|
||||
if(weapon.clips.clip.length > 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) {
|
||||
|
||||
Reference in New Issue
Block a user