powders work on armor, powder specials display

This commit is contained in:
ferricles 2021-01-10 23:40:49 -08:00
parent 208b4e2378
commit e8b23f7db6
3 changed files with 41 additions and 6 deletions

View file

@ -466,10 +466,45 @@ function displayExpandedItem(item, parent_id){
if (element !== "") {//powder special is "[e,t,w,f,a]+[0,1,2,3,4]"
console.log(skp_elements.indexOf(element));
let powderSpecial = powderSpecialStats[ skp_elements.indexOf(element)];
let attackSpecialTitle = document.createElement("p");
attackSpecialTitle.classList.add("left");
attackSpecialTitle.textContent = powderSpecial["weaponSpecialName"];
powder_special.appendChild(attackSpecialTitle);
let specialSuffixes = new Map([ ["Duration", " seconds"], ["Radius", " blocks"], ["Chains", ""], ["Damage", "%"], ["Damage Boost", "%"], ["Knockback", " blocks"] ]);
let specialTitle = document.createElement("p");
let specialEffects = document.createElement("p");
specialTitle.classList.add("left");
specialTitle.classList.add("itemp");
specialTitle.classList.add(damageClasses[skp_elements.indexOf(element) + 1]);
specialEffects.classList.add("left");
specialEffects.classList.add("itemp");
specialEffects.classList.add("nocolor");
if (item.get("category") === "weapon") {//weapon
specialTitle.textContent = powderSpecial["weaponSpecialName"];
let effects = powderSpecial["weaponSpecialEffects"];
for (const [key,value] of effects) {
let effect = document.createElement("p");
effect.classList.add("itemp");
effect.textContent += key + ": " + value[power] + specialSuffixes.get(key);
specialEffects.appendChild(effect);
}
specialTitle.append(specialEffects);
powder_special.appendChild(specialTitle);
}else if (item.get("category") === "armor") {//armor
let effects = powderSpecial["armorSpecialEffects"];
specialTitle.textContent += powderSpecial["armorSpecialName"] + ": ";
for (const [key,value] of effects) {
if (key !== "Description") {
let effect = document.createElement("p");
effect.classList.add("itemp");
effect.textContent += key + ": " + value[power] + specialSuffixes.get(key);
specialEffects.appendChild(effect);
}else{
specialTitle.textContent += "[ " + effects.get("Description") + " ]";
}
}
specialTitle.append(specialEffects);
powder_special.appendChild(specialTitle);
}
parent_div.append(powder_special);
}

View file

@ -43,7 +43,7 @@ div {
gap: 5px;
grid-auto-rows: minmax(60px, auto);
}
.equipment, .skillpoints, .center, .header, .all{
.equipment, .skillpoints, .center, .header, .all, .nocolor{
background: #121516;
color: #aaa;
}

View file

@ -104,7 +104,7 @@ class PowderSpecial{
function _ps(a,b,c,d,e) { return new PowderSpecial(a,b,c,d,e); } //bruh moment
let powderSpecialStats = [
_ps("Quake",new Map([["Radius",[5,5.5,6,6.5,7]], ["Damage",[155,220,285,350,415]] ]),"Rage",new Map([ ["Damage", [0.3,0.4,0.5,0.7,1.0]],["Description", "% \2764 Missing"] ]),400), //e
_ps("Quake",new Map([["Radius",[5,5.5,6,6.5,7]], ["Damage",[155,220,285,350,415]] ]),"Rage",new Map([ ["Damage", [0.3,0.4,0.5,0.7,1.0]],["Description", "% " + "\u2764" + " Missing"] ]),400), //e
_ps("Chain Lightning",new Map([ ["Chains", [5,6,7,8,9]], ["Damage", [80,120,160,200,240]] ]),"Kill Streak",new Map([ ["Damage", [3,4.5,6,7.5,9]],["Duration", [5,5,5,5,5]],["Description", "Mob Killed"] ]),200), //t
_ps("Curse",new Map([ ["Duration", [7,7.5,8,8.5,9]],["Damage", [90,120,150,180,210]] ]),"Concentration",new Map([ ["Damage", [1,2,3,4,5]],["Duration",[1,1,1,1,1]],["Description", "Mana Used"] ]),150), //w
_ps("Courage",new Map([ ["Duration", [6,6.5,7,7.5,8]],["Damage", [75,87.5,100,112.5,125]],["Damage Boost", [70,90,110,130,150]] ]),"Endurance",new Map([ ["Damage", [2,3,4,5,6]],["Duration", [8,8,8,8,8]],["Description", "Hit Taken"] ]),200), //f