MediaWiki:EnemyInfoboxSlider.js

function update_scaling { if((curr_lvl = ehp_input.value) >= base_lvl_v) { clonedflesh.innerText = Math.round(clonedflesh_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; flesh.innerText = Math.round(flesh_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; fossilized.innerText = Math.round(fossilized_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; infested.innerText = Math.round(infested_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; infestedflesh.innerText = Math.round(infestedflesh_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; infestedsinew.innerText = Math.round(infestedsinew_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; machinery.innerText = Math.round(machinery_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; robotic.innerText = Math.round(robotic_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * 100) / 100; ferritearmor.innerText = Math.round(ferritearmor_v * (1 + Math.pow(curr_lvl - base_lvl_v, 1.75) * 0.005)*100) / 100; alloyarmor.innerText = Math.round(alloyarmor_v * (1 + Math.pow(curr_lvl - base_lvl_v, 1.75) * 0.005)*100) / 100; shield.innerText = Math.round(shieldx_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.0075)*100)/100; protoshield.innerText = Math.round(protoshield_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.0075)*100)/100; out_ehp.innerText = Math.round((health_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015) * (1 + armor_v * (1 + Math.pow(curr_lvl - base_lvl_v, 1.75) * 0.005) / 300) + shield_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.0075))*100)/100; affinity.innerText = Math.round(affinity_v * (1 + Math.pow(curr_lvl - base_lvl_v, 0.5) * 0.1425) * 100) / 100; } } if ($('#slider_div').length) { var clonedflesh_v = parseInt(clonedflesh.innerText, 10); var flesh_v = parseInt(flesh.innerText, 10); var fossilized_v = parseInt(fossilized.innerText, 10); var infested_v = parseInt(infested.innerText, 10); var infestedflesh_v = parseInt(infestedflesh.innerText, 10); var infestedsinew_v = parseInt(infestedsinew.innerText, 10); var machinery_v = parseInt(machinery.innerText, 10); var robotic_v = parseInt(robotic.innerText, 10); var health_v = clonedflesh_v + flesh_v + fossilized_v + infested_v + infestedflesh_v + infestedsinew_v + machinery_v + robotic_v; var ferritearmor_v = parseInt(ferritearmor.innerText, 10); var alloyarmor_v = parseInt(alloyarmor.innerText, 10); var armor_v = ferritearmor_v + alloyarmor_v; var shieldx_v = parseInt(shield.innerText, 10); var protoshield_v = parseInt(protoshield.innerText, 10); var shield_v = shieldx_v + protoshield_v; var affinity_v = parseInt(affinity.innerText, 10); var base_lvl_v = parseInt(baselevel.innerText, 10); slider_div.innerHTML = " " + base_lvl_v + " " + slider_max.innerText + " "; out_lvl.innerHTML = ""; reset_btn.innerHTML = "Reset "; update_scaling; }