From bbb1c56aefea5a30b6182f9e1911bfbc4c291752 Mon Sep 17 00:00:00 2001 From: ferricles Date: Tue, 12 Jan 2021 14:49:02 -0800 Subject: [PATCH] set up spell_table entry for instant damage powders + powder special toggling works + powder special display up --- damage_calc.js | 11 +++++++++++ display.js | 34 ++++++++++++++++------------------ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/damage_calc.js b/damage_calc.js index 6b2ca75..d8f9ea9 100644 --- a/damage_calc.js +++ b/damage_calc.js @@ -188,5 +188,16 @@ const spell_table = { { title: "Uproot", cost: 6, parts: [ { subtitle: "Total Damage", type: "damage", multiplier: 50, conversion: [70, 30, 0, 0, 0, 0], summary: true }, ] }, + ], + "powder": [ //This is how instant-damage powder specials are implemented. To view time-boosted damage powder specials (curse, 2nd courage, air prison, view @TODO) + { title: "Quake", cost: 0, parts:[ + {type: "damage", multiplier: [155, 220, 285, 350, 415], conversion: [0,100,0,0,0,0], summary: true}, + ] }, + { title: "Chain Lightning", cost: 0, parts: [ + {type: "damage", multiplier: [80, 120, 160, 200, 240], conversion: [0,0,100,0,0,0], summary: true}, + ]}, + { title: "Courage", cost: 0, parts: [ + {type: "damage", multiplier: [75,87.5,100,112.5,125], conversion: [0,0,0,0,100,0], summary: true}, + ]}, ] }; diff --git a/display.js b/display.js index 31c9444..9b8c246 100644 --- a/display.js +++ b/display.js @@ -953,8 +953,21 @@ function displayPowderSpecials(parent_elem, powderSpecials) { specialEffects.classList.add("left"); specialEffects.classList.add("itemp"); specialEffects.classList.add("nocolor"); - let effects = special["weaponSpecialEffects"]; - specialTitle.textContent = "bruh"; + let effects = special[0]["weaponSpecialEffects"]; + let power = special[1]; + specialTitle.textContent = special[0]["weaponSpecialName"] + " " + power; + for (const [key,value] of effects) { + let effect = document.createElement("p"); + effect.classList.add("itemp"); + effect.textContent += key + ": " + value[power-1] + specialSuffixes.get(key); + if(key === "Damage"){ + effect.textContent += elementIcons[powderSpecialStats.indexOf(special[0])]; + } + if (powderSpecials.indexOf(special[0]) == 2) { + effect.textContent += " / Mana Used"; + } + specialEffects.appendChild(effect); + } //specialTitle.textContent = special["weaponSpecialName"]; /* if (element !== "") {//powder special is "[e,t,w,f,a]+[0,1,2,3,4]" @@ -966,22 +979,7 @@ function displayPowderSpecials(parent_elem, powderSpecials) { 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") + " ]"; - } - } + specialTitle.append(specialEffects); powder_special.appendChild(specialTitle);