User:Hennils/common.js

$(document).ready(function{   if ($('#slider_div').length) {        var html = "";        document.getElementById('slider_div').innerHTML = html;

var health = parseInt(document.getElementById("clonedflesh").innerHTML, 10) + parseInt(document.getElementById("flesh").innerHTML, 10) + parseInt(document.getElementById("fossilized").innerHTML, 10) + parseInt(document.getElementById("infested").innerHTML, 10) + parseInt(document.getElementById("infestedflesh").innerHTML, 10) + parseInt(document.getElementById("infestedsinew").innerHTML, 10) + parseInt(document.getElementById("machinery").innerHTML, 10) + parseInt(document.getElementById("robotic").innerHTML, 10); var armor = parseInt(document.getElementById("ferritearmor").innerHTML, 10) + parseInt(document.getElementById("alloyarmor").innerHTML, 10); var shield = parseInt(document.getElementById("shield").innerHTML, 10) + parseInt(document.getElementById("protoshield").innerHTML, 10); var base_lvl = parseInt(document.getElementById("baselevel").innerHTML, 10);

document.getElementById("ehp_slider").oninput = function { var curr_lvl = this.value; document.getElementById("out_lvl").innerHTML = curr_lvl; document.getElementById("out_ehp").innerHTML = health * (1 + Math.pow(curr_lvl - base_lvl, 2) * 0.015) * (1 + armor * (1 + Math.pow(curr_lvl - base_lvl, 1.75) * 0.005) / 300) + shield * (1 + Math.pow(curr_lvl - base_lvl, 2) * 0.0075); };   } });