User:FINNER/common.js

/* FINNER/Test9 START */ if ($('#w_slider_div').length) { var w_name = "Nidus"; var w_health_v = parseInt(health.innerHTML, 10); var w_shields_v = parseInt(shields.innerHTML, 10);

var w_armor_v = parseInt(armor.innerHTML, 10); var w_energy_v = parseInt(energy.innerHTML, 10); var base_rank_v = 0; var w_slider_width = 93; if (navigator.userAgent.indexOf("Firefox") != -1){ w_slider_div.innerHTML = " " + base_rank_v + " 30 "; } else if ((navigator.userAgent.indexOf("MSIE") != -1) || (!!document.documentMode === true )){ w_slider_div.innerHTML = " " + base_rank_v + " 30 "; } else { w_slider_div.innerHTML = " " + base_rank_v + " 30 "; }   out_rank.innerHTML = ""; w_reset_btn.innerHTML = "Reset "; w_update_scaling; }

function w_update_scaling { if (w_name === "Nidus") { w_nidus(w_ehp_input.value); } else if (w_name === "Inaros") { w_inaros(w_ehp_input.value); } else { w_normal_frame(w_ehp_input.value); } }

function w_nidus(curr_rank) { var i = 0; var w_h = 0; var w_a = 0; var w_e = 0; if (curr_rank <= 0) { w_h = 0; w_a = 0; w_e = 0; } else if (curr_rank > 30) { w_h = 10; w_a = 5; w_e = 5; } else { while ((curr_rank != 1) && (curr_rank != 2) && (curr_rank != 5) && (curr_rank > 0)) { curr_rank -= 6; i += 1; }       if (curr_rank == -3) { w_h = i*2-1; w_a = i; w_e = i-1; } else if (curr_rank == -2) { w_h = i*2; w_a = i; w_e = i-1; } else if (curr_rank === 0) { w_h = i*2; w_a = i; w_e = i;       } else if (curr_rank == 1) { w_h = i*2+1; w_a = i; w_e = i;       } else if (curr_rank == 2) { w_h = i*2+1; w_a = i+1; w_e = i;       } else { w_h = i*2+2; w_a = i+1; w_e = i+1; }   }    health.innerHTML = (w_health_v * (1 + 0.2 * w_h)).toLocaleString; shields.innerHTML = (w_shields_v).toLocaleString; armor.innerHTML = (w_armor_v * (1 + 0.1 * w_a)).toLocaleString; w_damage_redux = (Math.round((1 - 300 / (w_armor_v * (1 + 0.1 * w_a) + 300)) * 10000) / 10000) * 100; damage_redux.innerHTML = (w_damage_redux).toLocaleString; out_ehp.innerHTML = (Math.round((w_health_v * (1 + 0.2 * w_h) / (1 - w_damage_redux / 100) + w_shields_v) * 100) / 100).toLocaleString; energy.innerHTML = (w_energy_v * (1 + 0.1 * w_e)).toLocaleString; }

function w_normal_frame(curr_rank) { var i = 0; var w_h = 0; var w_s = 0; var w_e = 0; if (curr_rank <= 0) { w_h = 0; w_s = 0; w_e = 0; } else if (curr_rank > 30) { w_h = 10; w_s = 10; w_e = 10; } else { while ((curr_rank != 1) && (curr_rank != 2) && (curr_rank != 3)) { curr_rank -= 3; i += 1; }       if (curr_rank == 1) { w_h = i+1; w_s = i; w_e = i;       } else if (curr_rank == 2) { w_h = i+1; w_s = i+1; w_e = i;       } else { w_h = i+1; w_s = i+1; w_e = i+1; }   }    health.innerHTML = (w_health_v * (1 + 0.2 * w_h)).toLocaleString; shields.innerHTML = (w_shields_v * (1 + 0.2 * w_s)).toLocaleString; armor.innerHTML = (w_armor_v).toLocaleString; w_damage_redux = (Math.round((1 - 300 / (w_armor_v + 300)) * 10000) / 10000) * 100; damage_redux.innerHTML = (w_damage_redux).toLocaleString; out_ehp.innerHTML = (Math.round((w_health_v * (1 + 0.2 * w_h) / (1 - w_damage_redux / 100) + w_shields_v * (1 + 0.2 * w_s)) * 100) / 100).toLocaleString; energy.innerHTML = (w_energy_v * (1 + 0.05 * w_e)).toLocaleString; }   /* FINNER/Test9 END */ ///////////////////////////////////////////////////////////////////////////////// dil = new Array; function findDupImages(gf) { output = ""; url = "/api.php?action=query&generator=allimages&prop=duplicatefiles&gailimit=500&format=json"; if (gf) url += "&gaifrom=" + gf; $.getJSON(url,function (data) { if (data.query) { pages = data.query.pages; for (pageID in pages) { dils = ","+dil.join; if (dils.indexOf(","+pages[pageID].title) == -1 && pages[pageID].title.indexOf("File::") == -1 && pages[pageID].duplicatefiles) { output += " "+pages[pageID].title+" \n\n"; for (x=0;xFile:"+pages[pageID].duplicatefiles[x].name+"\n"; dil.push("File:"+pages[pageID].duplicatefiles[x].name.replace(/_/g," ")); } output += "\n\n"; } } $("#mw-dupimages").append(output); if (data["query-continue"]) setTimeout("findDupImages('"+data["query-continue"].allimages.gaifrom+"');",5000); } }); } $(function { if ($("#mw-dupimages").length) findDupImages; });