set up spell_table entry for instant damage powders + powder special toggling works + powder special display up

This commit is contained in:
ferricles 2021-01-12 14:49:02 -08:00
parent 96b837fcc6
commit bbb1c56aef
2 changed files with 27 additions and 18 deletions

View file

@ -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},
]},
]
};

View file

@ -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);