Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var summary = document.querySelectorAll(".above-wrapper")
- for(k=summary.length-1; k > -1; k--){
- var type = [".int",".str",".dex",".pwr",".cha"]
- var match = false;
- var matchs = 0, wpow = 0, lpow = 0, epow = 0, fpow = 0;
- var weles = summary[k].offsetParent.querySelector(".trait").firstChild.className.trim();
- var price = parseFloat(summary[k].innerText.substring(7,11));
- if(weles == "lightning-icon"){trait = "CHA";}
- else if(weles == "water-icon"){trait = "INT";}
- else if(weles == "earth-icon"){trait = "DEX";}
- else if(weles == "fire-icon"){trait = "STR";}
- for (j = 0; j < type.length; j++){
- var divs = summary[k].offsetParent.querySelectorAll(type[j]), i
- for (i = 0; i < divs.length; ++i) {
- var stat = divs[i].innerText.trim();
- var ele = stat.substring(0, 3);
- stat = parseInt(stat.substring(stat.length - 3, stat.length));
- if(ele == trait){match = true; matchs++;}
- if(ele == "CHA"){
- lpow = lpow + stat * 0.002675;
- wpow = wpow + stat * 0.0025;
- epow = epow + stat * 0.0025;
- fpow = fpow + stat * 0.0025;
- }
- else if(ele == "INT"){
- wpow = wpow + stat * 0.002675;
- epow = epow + stat * 0.0025;
- fpow = fpow + stat * 0.0025;
- lpow = lpow + stat * 0.0025;
- }
- else if(ele == "DEX"){
- epow = epow + stat * 0.002675;
- wpow = wpow + stat * 0.0025;
- fpow = fpow + stat * 0.0025;
- lpow = lpow + stat * 0.0025;
- }
- else if(ele == "STR"){
- fpow = fpow + stat * 0.002675;
- wpow = wpow + stat * 0.0025;
- epow = epow + stat * 0.0025;
- lpow = lpow + stat * 0.0025;
- }
- else if(ele == "PWR"){
- wpow = wpow + stat * 0.002575;
- epow = epow + stat * 0.002575;
- fpow = fpow + stat * 0.002575;
- lpow = lpow + stat * 0.002575;
- }
- }
- }
- if(wpow >= Math.max(epow, fpow, lpow)){
- summary[k].offsetParent.querySelector(".name").innerText = "Water : " + (wpow * 100).toFixed(2) + " %";
- }
- if(epow >= Math.max(wpow, fpow, lpow)){
- summary[k].offsetParent.querySelector(".name").innerText = "Earth : " + (epow * 100).toFixed(2) + " %";
- }
- if(fpow >= Math.max(epow, fpow, lpow)){
- summary[k].offsetParent.querySelector(".name").innerText = "Fire : " + (fpow * 100).toFixed(2) + " %";
- }
- if(lpow >= Math.max(wpow, fpow, epow)){
- summary[k].offsetParent.querySelector(".name").innerText = "Lightning : " + (lpow * 100).toFixed(2) + " %";
- }
- if(summary[k].offsetParent.querySelector(".sold") != null){
- summary[k].offsetParent.style.display = "none";;
- }
- // else if(matchs >= 2){} //if match 2 or more
- else if(match == true){} //if match 1 or more
- else if(price < 4){} //if price less than x
- else if(Math.max(epow, fpow, lpow, wpow) >= 2.8){} //if multiplier more than x (3.21 is the max, match 3 400 value)
- else{
- summary[k].offsetParent.style.display = "none";;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement