total armor powder special reset on weapon change
This commit is contained in:
parent
0684e5f8bd
commit
b1c4a5e8ed
3 changed files with 64 additions and 37 deletions
|
@ -507,7 +507,7 @@
|
||||||
Rage (Passive)
|
Rage (Passive)
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type = "range" class = "e_slider" id = "str_boost_armor" name = "str-boost-armor" autocomplete = "off" min = '0' max = '400' value = '0' step = '1' onchange = "updateArmorPowderSpecials('str_boost_armor')">
|
<input type = "range" class = "e_slider" id = "str_boost_armor" name = "str-boost-armor" autocomplete = "off" min = '0' max = '400' value = '0' step = '1' onchange = "updateArmorPowderSpecials('str_boost_armor', true)">
|
||||||
<input type="text" id="str_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
<input type="text" id="str_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
||||||
<label id = "str_boost_armor_label" for="str-boost-armor">% Earth Dmg Boost: 0</label>
|
<label id = "str_boost_armor_label" for="str-boost-armor">% Earth Dmg Boost: 0</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -551,7 +551,7 @@
|
||||||
Kill Streak (Passive)
|
Kill Streak (Passive)
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type = "range" class = "t_slider" id = "dex_boost_armor" name = "dex-boost-armor" autocomplete = "off" min = '0' max = '200' value = '0' step = '1' onchange = "updateArmorPowderSpecials('dex_boost_armor')">
|
<input type = "range" class = "t_slider" id = "dex_boost_armor" name = "dex-boost-armor" autocomplete = "off" min = '0' max = '200' value = '0' step = '1' onchange = "updateArmorPowderSpecials('dex_boost_armor', true)">
|
||||||
<input type="text" id="dex_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
<input type="text" id="dex_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
||||||
<label id = "dex_boost_armor_label" for="dex-boost-armor">% Thunder Dmg Boost: 0</label>
|
<label id = "dex_boost_armor_label" for="dex-boost-armor">% Thunder Dmg Boost: 0</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -595,7 +595,7 @@
|
||||||
Concentration (Passive)
|
Concentration (Passive)
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type = "range" class = "w_slider" id = "int_boost_armor" name = "dex-boost-armor" autocomplete = "off" min = '0' max = '150' value = '0' step = '1' onchange = "updateArmorPowderSpecials('int_boost_armor')">
|
<input type = "range" class = "w_slider" id = "int_boost_armor" name = "dex-boost-armor" autocomplete = "off" min = '0' max = '150' value = '0' step = '1' onchange = "updateArmorPowderSpecials('int_boost_armor', true)">
|
||||||
<input type="text" id="int_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
<input type="text" id="int_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
||||||
<label id = "int_boost_armor_label" for="dex-boost-armor">% Water Dmg Boost: 0</label>
|
<label id = "int_boost_armor_label" for="dex-boost-armor">% Water Dmg Boost: 0</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -639,7 +639,7 @@
|
||||||
Endurance (Passive)
|
Endurance (Passive)
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type = "range" class = "f_slider" id = "def_boost_armor" name = "def-boost-armor" autocomplete = "off" min = '0' max = '200' value = '0' step = '1' onchange = "updateArmorPowderSpecials('def_boost_armor')">
|
<input type = "range" class = "f_slider" id = "def_boost_armor" name = "def-boost-armor" autocomplete = "off" min = '0' max = '200' value = '0' step = '1' onchange = "updateArmorPowderSpecials('def_boost_armor', true)">
|
||||||
<input type="text" id="def_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
<input type="text" id="def_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
||||||
<label id = "def_boost_armor_label" for="def-boost-armor">% Fire Dmg Boost: 0</label>
|
<label id = "def_boost_armor_label" for="def-boost-armor">% Fire Dmg Boost: 0</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -683,7 +683,7 @@
|
||||||
Dodge (Passive)
|
Dodge (Passive)
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type = "range" class = "a_slider" id = "agi_boost_armor" name = "agi-boost-armor" autocomplete = "off" min = '0' max = '150' value = '0' step = '1' onchange = "updateArmorPowderSpecials('agi_boost_armor')">
|
<input type = "range" class = "a_slider" id = "agi_boost_armor" name = "agi-boost-armor" autocomplete = "off" min = '0' max = '150' value = '0' step = '1' onchange = "updateArmorPowderSpecials('agi_boost_armor', true)">
|
||||||
<input type="text" id="agi_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
<input type="text" id="agi_boost_armor_prev" autocomplete = "off" value="0" style = "display:none;">
|
||||||
<label id = "agi_boost_armor_label" for="agi-boost-armor">% Air Dmg Boost: 0</label>
|
<label id = "agi_boost_armor_label" for="agi-boost-armor">% Air Dmg Boost: 0</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,6 +24,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelector("#level-choice").setAttribute("oninput", "calcBuildSchedule()")
|
document.querySelector("#level-choice").setAttribute("oninput", "calcBuildSchedule()")
|
||||||
|
document.querySelector("#weapon-choice").setAttribute("oninput", document.querySelector("#weapon-choice").getAttribute("oninput") + "resetArmorPowderSpecials();");
|
||||||
|
|
||||||
|
|
||||||
let skp_fields = document.getElementsByClassName("skp-update");
|
let skp_fields = document.getElementsByClassName("skp-update");
|
||||||
|
|
||||||
|
|
|
@ -500,6 +500,7 @@ function updateStats() {
|
||||||
player_build.assigned_skillpoints += delta_total;
|
player_build.assigned_skillpoints += delta_total;
|
||||||
if(player_build){
|
if(player_build){
|
||||||
updatePowderSpecials("skip", false);
|
updatePowderSpecials("skip", false);
|
||||||
|
updateArmorPowderSpecials("skip", false);
|
||||||
updateBoosts("skip", false);
|
updateBoosts("skip", false);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -645,10 +646,10 @@ function updatePowderSpecials(buttonId, recalcStats) {
|
||||||
|
|
||||||
/* Updates PASSIVE powder special boosts (armors)
|
/* Updates PASSIVE powder special boosts (armors)
|
||||||
*/
|
*/
|
||||||
function updateArmorPowderSpecials(elem_id) {
|
function updateArmorPowderSpecials(elem_id, recalc_stats) {
|
||||||
console.log(player_build);
|
|
||||||
//we only update the powder special + external stats if the player has a build
|
//we only update the powder special + external stats if the player has a build
|
||||||
if (player_build !== undefined) {
|
if (elem_id !== "skip") {
|
||||||
|
if (player_build !== undefined && player_build.weapon !== undefined && player_build.weapon.get("name") !== "No Weapon") {
|
||||||
let wynn_elem = elem_id.split("_")[0]; //str, dex, int, def, agi
|
let wynn_elem = elem_id.split("_")[0]; //str, dex, int, def, agi
|
||||||
|
|
||||||
//update the label associated w/ the slider
|
//update the label associated w/ the slider
|
||||||
|
@ -674,14 +675,38 @@ function updateArmorPowderSpecials(elem_id) {
|
||||||
player_build.externalStats.set(dmg_id, new_dmgboost);
|
player_build.externalStats.set(dmg_id, new_dmgboost);
|
||||||
player_build.externalStats.get("damageBonus")[skp_names.indexOf(wynn_elem)] = new_dmgboost;
|
player_build.externalStats.get("damageBonus")[skp_names.indexOf(wynn_elem)] = new_dmgboost;
|
||||||
|
|
||||||
//calc build stats and display powder special
|
|
||||||
calculateBuildStats();
|
|
||||||
// displaysq2PowderSpecials(document.getElementById("powder-special-stats"), powderSpecials, player_build, true);
|
|
||||||
|
|
||||||
//update the slider's graphics
|
//update the slider's graphics
|
||||||
let bg_color = elem_colors[skp_names.indexOf(wynn_elem)];
|
let bg_color = elem_colors[skp_names.indexOf(wynn_elem)];
|
||||||
let pct = Math.round(100 * value / powderSpecialStats[skp_names.indexOf(wynn_elem)].cap);
|
let pct = Math.round(100 * value / powderSpecialStats[skp_names.indexOf(wynn_elem)].cap);
|
||||||
elem.style.background = `linear-gradient(to right, ${bg_color}, ${bg_color} ${pct}%, #AAAAAA ${pct}%, #AAAAAA 100%)`;
|
elem.style.background = `linear-gradient(to right, ${bg_color}, ${bg_color} ${pct}%, #AAAAAA ${pct}%, #AAAAAA 100%)`;
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < skp_names.length; ++i) {
|
||||||
|
skp_name = skp_names[i];
|
||||||
|
skp_char = elem_chars[i];
|
||||||
|
build.externalStats.set(skp_char + "DamPct", build.externalStats.get(skp_char + "DamPct") - document.getElementById(skp_name+"_boost_armor").value);
|
||||||
|
build.externalStats.get("damageBonus")[i] -= document.getElementById(skp_name+"_boost_armor").value;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (recalc_stats) {
|
||||||
|
//calc build stats and display powder special
|
||||||
|
calculateBuildStats();
|
||||||
|
// displaysq2PowderSpecials(document.getElementById("powder-special-stats"), powderSpecials, player_build, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetArmorPowderSpecials() {
|
||||||
|
for (const skp of skp_names) {
|
||||||
|
document.getElementById(skp + "_boost_armor").value = 0;
|
||||||
|
document.getElementById(skp + "_boost_armor_prev").value = 0;
|
||||||
|
|
||||||
|
document.getElementById(skp + "_boost_armor").style.background = `linear-gradient(to right, #AAAAAA, #AAAAAA 0%, #AAAAAA 100%)`;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue