User:Twilight053/common.js

/* User:Twilight053/Test1 START */ function update_scaling { if((curr_lvl = ehp_input.value) >= base_lvl_v) { clonedflesh.innerHTML = (Math.round(clonedflesh_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; flesh.innerHTML = (Math.round(flesh_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; fossilized.innerHTML = (Math.round(fossilized_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; infested.innerHTML = (Math.round(infested_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; infestedflesh.innerHTML = (Math.round(infestedflesh_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; infestedsinew.innerHTML = (Math.round(infestedsinew_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; machinery.innerHTML = (Math.round(machinery_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; robotic.innerHTML = (Math.round(robotic_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.015)* 100) / 100).toLocaleString; ferritearmor.innerHTML = (Math.round(ferritearmor_v * (1 + Math.pow(curr_lvl - base_lvl_v, 1.75) * 0.005)* 100) / 100).toLocaleString; alloyarmor.innerHTML = (Math.round(alloyarmor_v * (1 + Math.pow(curr_lvl - base_lvl_v, 1.75) * 0.005)* 100) / 100).toLocaleString; shield.innerHTML = (Math.round(shieldx_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.0075)* 100) / 100).toLocaleString; protoshield.innerHTML = (Math.round(protoshield_v * (1 + Math.pow(curr_lvl - base_lvl_v, 2) * 0.0075)* 100) / 100).toLocaleString; out_ehp.innerHTML = (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).toLocaleString; affinity.innerHTML = (Math.round(affinity_v * (1 + Math.pow(curr_lvl - base_lvl_v, 0.5) * 0.1425)* 100) / 100).toLocaleString; } } if ($('#slider_div').length) { var clonedflesh_v = parseInt(clonedflesh.innerHTML, 10); var flesh_v = parseInt(flesh.innerHTML, 10); var fossilized_v = parseInt(fossilized.innerHTML, 10); var infested_v = parseInt(infested.innerHTML, 10); var infestedflesh_v = parseInt(infestedflesh.innerHTML, 10); var infestedsinew_v = parseInt(infestedsinew.innerHTML, 10); var machinery_v = parseInt(machinery.innerHTML, 10); var robotic_v = parseInt(robotic.innerHTML, 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.innerHTML, 10); var alloyarmor_v = parseInt(alloyarmor.innerHTML, 10); var armor_v = ferritearmor_v + alloyarmor_v; var shieldx_v = parseInt(shield.innerHTML, 10); var protoshield_v = parseInt(protoshield.innerHTML, 10); var shield_v = shieldx_v + protoshield_v; var affinity_v = parseInt(affinity.innerHTML, 10); var base_lvl_v = parseInt(baselevel.innerHTML, 10); if (base_lvl_v > 9) { var slider_width = 89; } else { var slider_width = 92; } if (navigator.userAgent.indexOf("Firefox") != -1){ slider_div.innerHTML = " " + base_lvl_v + " " + slider_max.innerHTML + " "; } else if ((navigator.userAgent.indexOf("MSIE") != -1) || (!!document.documentMode == true )){ slider_div.innerHTML = " " + base_lvl_v + " " + slider_max.innerHTML + " "; } else { slider_div.innerHTML = " " + base_lvl_v + " " + slider_max.innerHTML + " "; }   out_lvl.innerHTML = ""; reset_btn.innerHTML = "Reset "; update_scaling; } /* User:Twilight053/Test1 END */