User:TunaInABottle/wikia.js

// -calculater function calculate_str { var WarframeSTR = (1 + getCurrent("Intensify") + getCurrent("Power_Drift") + getCurrent("Blind_Rage") + getCurrent("Transient_Fortitude") + getCurrent("Energy_Conversion") + getCurrentMalus('Overextended') + getCurrent('Growing_Power') + getCurrent("Pacify_&_Provoke")) * getCurrent("Parasitic_Link") * getCurrent("Corruption"); document.getElementById('abilitySTR').value = (WarframeSTR * 100).toFixed(2) + "%"; } function calculate_dur { var WarframeDUR = 1 + getCurrent("(Primed)_Continuity") + getCurrent("Constitution") + getCurrent("Narrow_Minded") + getCurrentMalus("Transient_Fortitude") + getCurrentMalus("Fleeting_Expertise"); document.getElementById('abilityDUR').value = (WarframeDUR * 100).toFixed(2) + "%"; } function calculate_rng { var WarframeRNG = (1 + getCurrent('Stretch') + getCurrent('Cunning_Drift') + getCurrent('Overextended') + getCurrentMalus("Narrow_Minded")) * getCurrent("Corruption"); document.getElementById('abilityRNG').value = (WarframeRNG * 100).toFixed(2) + "%"; } function calculate_eff { var WarframeEFF = 1 + getCurrent('Streamline') + getCurrent('Fleeting_Expertise') + getCurrentMalus("Blind_Rage"); document.getElementById('abilityEFF').value = (WarframeEFF * 100).toFixed(2) + "%"; } function calculate { calculate_str; calculate_dur; calculate_eff; calculate_rng; //var WarframeDamage = document.getElementById('baseDamage').value; //document.getElementById('result').value = (WarframeDamage * WarframeSTR).toFixed(2); } function getCurrent(name) { parent = document.getElementById(name); if (parent.getElementsByClassName('check')[0].checked) { return parent.getElementsByClassName('current')[0].value / 100; } else if (parent.className == "*"){ return 1; } else { return 0; } } function getCurrentMalus(name) { parent = document.getElementById(name); if (parent.getElementsByClassName('check')[0].checked) { return parent.getElementsByClassName('current')[1].value / 100; }else{ return 0; } } // -- loader $(document).ready(function { // stuff before the frame stats	var html = " ";	//frame stats	html += " ";	// occasional stuff	html += " ";	//ability stats	html += " "; }); function loadMod(name, ranks, bonus, malus, badStat, statCell) { var html = ""+statCell+" " + name + " "; html += " "; html += " "; html += " "; html += "% "; if (malus) {// checks if malus is unequal 0 html += " "; html += "% "+badStat+" "; }	return html+" "; } function loadBuff(name, buffstr, bonus, stat, operation) { var html = " " + name + " "; if (buffstr!=1) {html += " "; html += " "; } else {html+="  ";} html += " "; html += operation+"% "+stat+" "; return html+" "; } function makeRow(text1, id, ph, value) { return " " + text1 + ":  <input id=" + id + " readonly placeholder=" + ph + " value=" + value + ">  "; } function statCell(stat, id, numOfMods) { return "<td rowspan="+numOfMods+" class='statCell'>" + stat + ": <input class='stats' id=" + id + " readonly value='100.00%'> "; } function spaaaace{ return "<tr class='spacer'>  "; } // updater--- //disable mod inputs as long as the mod is disabled $('input:checkbox').change(function { var parent = this.closest("tr");  if (this.checked) {    parent.getElementsByClassName("rank")[0].disabled = false;    parent.getElementsByClassName("maxbtn")[0].disabled = false;		curr = parent.getElementsByClassName("current");		curr[0].style.color = "green";		if (curr.length > 1){curr[1].style.color = "red";}		if (parent.id == "Corruption"){document.body.style.backgroundColor = "lemonchiffon"; }		// count up cheat counter here  } else {    parent.getElementsByClassName("rank")[0].disabled = true;    parent.getElementsByClassName("maxbtn")[0].disabled = true;    curr = parent.getElementsByClassName("current");		curr[0].style.color = "#dadada";		if (curr.length > 1){curr[1].style.color = "#dadada";}		if (parent.id == "Corruption"){document.body.style.backgroundColor = "transparent"; }    // ... and down here  }  calculate; }); // update bonus dynamically $('.rank').change(function { var parent = this.closest("tr");  curr = parent.getElementsByClassName("current");	bonus = parent.getElementsByClassName("bonus");	if (this.className == "rank count") {	curr[0].value = parseInt(this.value) * bonus[0].value;	}else{	curr[0].value = (parseInt(this.value) + 1) * bonus[0].value;}	if (curr.length > 1){curr[1].value = (parseInt(this.value) + 1) * bonus[1].value;}  calculate; }); $('.maxbtn').click(function { var rank = this.closest("tr").getElementsByClassName("rank")[0];  rank.value = rank.max;  $(rank).trigger("change"); // force update! });