light aesthetic changes, negative poison fix
This commit is contained in:
parent
78bc2423b4
commit
2f82f888e2
3 changed files with 30 additions and 21 deletions
26
display.js
26
display.js
|
@ -474,7 +474,7 @@ 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 specialSuffixes = new Map([ ["Duration", " seconds"], ["Radius", " blocks"], ["Chains", ""], ["Damage", "%"], ["Damage Boost", "%"], ["Knockback", " blocks"] ]);
|
||||
let specialSuffixes = new Map([ ["Duration", " sec"], ["Radius", " blocks"], ["Chains", ""], ["Damage", "%"], ["Damage Boost", "%"], ["Knockback", " blocks"] ]);
|
||||
let specialTitle = document.createElement("p");
|
||||
let specialEffects = document.createElement("p");
|
||||
specialTitle.classList.add("left");
|
||||
|
@ -483,27 +483,36 @@ function displayExpandedItem(item, parent_id){
|
|||
specialEffects.classList.add("left");
|
||||
specialEffects.classList.add("itemp");
|
||||
specialEffects.classList.add("nocolor");
|
||||
|
||||
let effects;
|
||||
if (item.get("category") === "weapon") {//weapon
|
||||
effects = powderSpecial["weaponSpecialEffects"];
|
||||
specialTitle.textContent = powderSpecial["weaponSpecialName"];
|
||||
let effects = powderSpecial["weaponSpecialEffects"];
|
||||
for (const [key,value] of effects) {
|
||||
/*for (const [key,value] of effects) {
|
||||
let effect = document.createElement("p");
|
||||
effect.classList.add("itemp");
|
||||
effect.textContent += key + ": " + value[power] + specialSuffixes.get(key);
|
||||
if(key === "Damage"){
|
||||
effect.textContent += elementIcons[skp_elements.indexOf(element)];
|
||||
}
|
||||
specialEffects.appendChild(effect);
|
||||
}
|
||||
specialTitle.append(specialEffects);
|
||||
powder_special.appendChild(specialTitle);
|
||||
powder_special.appendChild(specialTitle);*/
|
||||
}else if (item.get("category") === "armor") {//armor
|
||||
let effects = powderSpecial["armorSpecialEffects"];
|
||||
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);
|
||||
if(key === "Damage"){
|
||||
effect.textContent += elementIcons[skp_elements.indexOf(element)];
|
||||
}
|
||||
if (element === "w") {
|
||||
effect.textContent += " / Mana Used";
|
||||
}
|
||||
specialEffects.appendChild(effect);
|
||||
}else{
|
||||
specialTitle.textContent += "[ " + effects.get("Description") + " ]";
|
||||
|
@ -511,7 +520,6 @@ function displayExpandedItem(item, parent_id){
|
|||
}
|
||||
specialTitle.append(specialEffects);
|
||||
powder_special.appendChild(specialTitle);
|
||||
}
|
||||
|
||||
|
||||
parent_div.append(powder_special);
|
||||
|
@ -601,7 +609,7 @@ function displayPoisonDamage(overallparent_elem, build) {
|
|||
let overallpoisonDamage = document.createElement("p");
|
||||
overallpoisonDamage.classList.add("itemp");
|
||||
let poison_tick = Math.floor(build.statMap.get("poison") * (1+skillPointsToPercentage(build.total_skillpoints[0]))/3);
|
||||
overallpoisonDamage.textContent = "Poison Tick: " + poison_tick;
|
||||
overallpoisonDamage.textContent = "Poison Tick: " + Math.max(poison_tick,0);
|
||||
overallparent_elem.append(overallpoisonDamage);
|
||||
overallparent_elem.append(document.createElement("br"));
|
||||
}
|
||||
|
|
|
@ -251,5 +251,5 @@ input {
|
|||
color:#5f5;
|
||||
}
|
||||
.restrict {
|
||||
color: #ff006a;
|
||||
color: #ff8180;
|
||||
}
|
||||
|
|
1
test.js
1
test.js
|
@ -25,6 +25,7 @@ let item_fields = [ "name", "displayName", "tier", "set", "slots", "type", "mate
|
|||
|
||||
let skp_order = ["str","dex","int","def","agi"];
|
||||
let skp_elements = ["e","t","w","f","a"];
|
||||
let elementIcons = ["\u2724","\u2726", "\u2749", "\u2739", "\u274b" ];
|
||||
let skpReqs = skp_order.map(x => x + "Req");
|
||||
|
||||
let equipment_fields = [
|
||||
|
|
Loading…
Reference in a new issue