fixed huge -raw spell/melee% not tanking all damage
This commit is contained in:
parent
6362305f28
commit
644aa0c04a
3 changed files with 20 additions and 6 deletions
|
@ -87,18 +87,19 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier,
|
|||
}
|
||||
|
||||
for (let i in damages) {
|
||||
let damageBoost = Math.max(1 + skillBoost[i] + staticBoost, 0);
|
||||
let damageBoost = 1 + skillBoost[i] + staticBoost;
|
||||
damages_results.push([
|
||||
Math.max(damages[i][0] * damageBoost * damageMult, 0), // Normal min
|
||||
Math.max(damages[i][1] * damageBoost * damageMult, 0), // Normal max
|
||||
Math.max(damages[i][0] * (1 + damageBoost) * damageMult, 0), // Crit min
|
||||
Math.max(damages[i][1] * (1 + damageBoost) * damageMult, 0), // Crit max
|
||||
Math.max(damages[i][0] * Math.max(damageBoost,0) * damageMult, 0), // Normal min
|
||||
Math.max(damages[i][1] * Math.max(damageBoost,0) * damageMult, 0), // Normal max
|
||||
Math.max(damages[i][0] * Math.max(1 + damageBoost, 0) * damageMult, 0), // Crit min
|
||||
Math.max(damages[i][1] * Math.max(1 + damageBoost, 0) * damageMult, 0), // Crit max
|
||||
]);
|
||||
totalDamNorm[0] += damages_results[i][0];
|
||||
totalDamNorm[1] += damages_results[i][1];
|
||||
totalDamCrit[0] += damages_results[i][2];
|
||||
totalDamCrit[1] += damages_results[i][3];
|
||||
}
|
||||
console.log(damages_results);
|
||||
if (melee) {
|
||||
totalDamNorm[0] += Math.max(rawModifier, -damages_results[0][0]);
|
||||
totalDamNorm[1] += Math.max(rawModifier, -damages_results[0][1]);
|
||||
|
|
15
display.js
15
display.js
|
@ -293,6 +293,7 @@ function displayExpandedItem(item, parent_id){
|
|||
let display_commands = [
|
||||
"#cdiv",
|
||||
"displayName",
|
||||
//"type", //REPLACE THIS WITH SKIN
|
||||
"#ldiv",
|
||||
"atkSpd",
|
||||
"#ldiv",
|
||||
|
@ -407,6 +408,18 @@ function displayExpandedItem(item, parent_id){
|
|||
if (item.get("tier") !== " ") {
|
||||
p_elem.classList.add(item.get("tier"));
|
||||
}
|
||||
/*let validTypes = ["helmet", "chestplate", "leggings", "boots", "relik", "wand", "bow", "spear", "dagger", "ring", "bracelet", "necklace"];
|
||||
if (item.has("type") && validTypes.includes(item.get("type"))) {
|
||||
p = document.createElement("p");
|
||||
img = document.createElement("img");
|
||||
img.src = "./media/items/generic-"+item.get("type")+".png";
|
||||
img.alt = "image no display :(";
|
||||
img.classList.add("center");
|
||||
p.append(img);
|
||||
p.classList.add("itemp");
|
||||
|
||||
p_elem.append(p);
|
||||
}*/
|
||||
} else if (skp_order.includes(id)) { //id = str, dex, int, def, or agi
|
||||
p_elem.textContent = "";
|
||||
p_elem.classList.add("itemtable");
|
||||
|
@ -426,7 +439,7 @@ function displayExpandedItem(item, parent_id){
|
|||
p_elem.appendChild(row);
|
||||
} else if (id === "restrict") {
|
||||
p_elem.classList.add("restrict");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (rolledIDs.includes(id) && item.get("minRolls").get(id)){ // && item.get("maxRolls").get(id) ){//rolled ID & non-0/non-null/non-und ID
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 463 B |
Loading…
Reference in a new issue