From aa23b055adb6e96086fbf5ad116ee9804d39969b Mon Sep 17 00:00:00 2001 From: reschan <49411618+reschan@users.noreply.github.com> Date: Sun, 10 Jan 2021 17:16:22 -0500 Subject: [PATCH] Add files via upload --- damage_calc.js | 38 ++++++++++++++++++++------------------ display.js | 33 ++++++++++++++++++--------------- index.html | 2 +- 3 files changed, 39 insertions(+), 34 deletions(-) diff --git a/damage_calc.js b/damage_calc.js index bca4310..c5eda9c 100644 --- a/damage_calc.js +++ b/damage_calc.js @@ -92,84 +92,86 @@ const spell_table = { { title: "Heal", cost: 6, parts: [ { subtitle: "First Pulse", type: "heal", strength: 0.2 }, { subtitle: "Second and Third Pulses", type: "heal", strength: 0.05 }, - { subtitle: "Total Heal", type: "heal", strength: 0.3 } + { subtitle: "Total Heal", type: "heal", strength: 0.3, summary: true } ] }, { title: "Teleport", cost: 4, parts: [ - { subtitle: "", type: "damage", multiplier: 100, conversion: [60, 0, 40, 0, 0, 0] }, + { subtitle: "Total Damage", type: "damage", multiplier: 100, conversion: [60, 0, 40, 0, 0, 0], summary: true }, ] }, { title: "Meteor", cost: 8, parts: [ - { subtitle: "Blast Damage", type: "damage", multiplier: 500, conversion: [40, 30, 0, 0, 30, 0] }, + { subtitle: "Blast Damage", type: "damage", multiplier: 500, conversion: [40, 30, 0, 0, 30, 0], summary: true }, { subtitle: "Burn Damage", type: "damage", multiplier: 125, conversion: [100, 0, 0, 0, 0, 0] }, ] }, { title: "Ice Snake", cost: 4, parts: [ - { subtitle: "", type: "damage", multiplier: 70, conversion: [50, 0, 0, 50, 0, 0] }, + { subtitle: "Total Damage", type: "damage", multiplier: 70, conversion: [50, 0, 0, 50, 0, 0], summary: true }, ] }, ], "spear": [ { title: "Bash", cost: 6, parts: [ { subtitle: "First Damage", type: "damage", multiplier: 130, conversion: [60, 40, 0, 0, 0, 0]}, { subtitle: "Explosion Damage", type: "damage", multiplier: 130, conversion: [100, 0, 0, 0, 0, 0]}, + { subtitle: "Total Damage", type: "total", factors: [1, 1], summary: true }, ] }, { title: "Charge", cost: 4, parts: [ - { subtitle: "", type: "damage", multiplier: 150, conversion: [60, 0, 0, 0, 40, 0] }, + { subtitle: "Total Damage", type: "damage", multiplier: 150, conversion: [60, 0, 0, 0, 40, 0], summary: true }, ] }, { title: "Uppercut", cost: 10, parts: [ { subtitle: "First Damage", type: "damage", multiplier: 300, conversion: [70, 20, 10, 0, 0, 0] }, { subtitle: "Fireworks Damage", type: "damage", multiplier: 50, conversion: [60, 0, 40, 0, 0, 0] }, { subtitle: "Crash Damage", type: "damage", multiplier: 50, conversion: [80, 0, 20, 0, 0, 0] }, + { subtitle: "Total Damage", type: "total", factors: [1, 1, 1], summary: true }, ] }, { title: "War Scream", cost: 6, parts: [ - { subtitle: "Area Damage", type: "damage", multiplier: 50, conversion: [0, 0, 0, 0, 75, 25] }, + { subtitle: "Area Damage", type: "damage", multiplier: 50, conversion: [0, 0, 0, 0, 75, 25], summary: true }, { subtitle: "Air Shout (Per Hit)", type: "damage", multiplier: 30, conversion: [0, 0, 0, 0, 75, 25] }, ] }, ], "bow": [ { title: "Arrow Storm", cost: 6, parts: [ - { subtitle: "Total Damage", type: "damage", multiplier: 600, conversion: [60, 0, 25, 0, 15, 0]}, + { subtitle: "Total Damage", type: "damage", multiplier: 600, conversion: [60, 0, 25, 0, 15, 0], summary: true }, { subtitle: "Per Arrow", type: "damage", multiplier: 10, conversion: [60, 0, 25, 0, 15, 0]}, ] }, { title: "Escape", cost: 3, parts: [ - { subtitle: "Landing Damage", type: "damage", multiplier: 100, conversion: [50, 0, 0, 0, 0, 50] }, + { subtitle: "Landing Damage", type: "damage", multiplier: 100, conversion: [50, 0, 0, 0, 0, 50], summary: true }, ] }, { title: "Bomb Arrow", cost: 8, parts: [ - { subtitle: "", type: "damage", multiplier: 250, conversion: [60, 25, 0, 0, 15, 0] }, + { subtitle: "Total Damage", type: "damage", multiplier: 250, conversion: [60, 25, 0, 0, 15, 0], summary: true }, ] }, { title: "Arrow Shield", cost: 10, parts: [ - { subtitle: "Shield Damage", type: "damage", multiplier: 100, conversion: [70, 0, 0, 0, 0, 30] }, + { subtitle: "Shield Damage", type: "damage", multiplier: 100, conversion: [70, 0, 0, 0, 0, 30], summary: true }, { subtitle: "Arrow Rain Damage", type: "damage", multiplier: 200, conversion: [70, 0, 0, 0, 0, 30] }, ] }, ], "dagger": [ { title: "Spin Attack", cost: 6, parts: [ - { subtitle: "", type: "damage", multiplier: 150, conversion: [70, 0, 30, 0, 0, 0]}, + { subtitle: "Total Damage", type: "damage", multiplier: 150, conversion: [70, 0, 30, 0, 0, 0], summary: true}, ] }, { title: "Vanish", cost: 1, parts: [ - { subtitle: "No Damage", type: "none" } + { subtitle: "No Damage", type: "none", summary: true } ] }, { title: "Multihit", cost: 8, parts: [ { subtitle: "1st to 10th Hit", type: "damage", multiplier: 27, conversion: [100, 0, 0, 0, 0, 0] }, { subtitle: "Fatality", type: "damage", multiplier: 120, conversion: [20, 0, 30, 50, 0, 0] }, - { subtitle: "Total Damage", type: "total", factors: [10, 1] }, + { subtitle: "Total Damage", type: "total", factors: [10, 1], summary: true }, ] }, { title: "Smoke Bomb", cost: 8, parts: [ { subtitle: "Tick Damage", type: "damage", multiplier: 60, conversion: [45, 25, 0, 0, 0, 30] }, - { subtitle: "Total Damage", type: "damage", multiplier: 600, conversion: [45, 25, 0, 0, 0, 30] }, + { subtitle: "Total Damage", type: "damage", multiplier: 600, conversion: [45, 25, 0, 0, 0, 30], summary: true }, ] }, ], "relik": [ { title: "Totem", cost: 4, parts: [ { subtitle: "Smash Damage", type: "damage", multiplier: 100, conversion: [80, 0, 0, 0, 20, 0]}, { subtitle: "Damage Tick", type: "damage", multiplier: 20, conversion: [80, 0, 0, 0, 0, 20]}, - { subtitle: "Heal Tick", type: "heal", strength: 0.04 }, + { subtitle: "Heal Tick", type: "heal", strength: 0.04, summary: true }, ] }, { title: "Haul", cost: 1, parts: [ - { subtitle: "", type: "damage", multiplier: 100, conversion: [80, 0, 20, 0, 0, 0] }, + { subtitle: "Total Damage", type: "damage", multiplier: 100, conversion: [80, 0, 20, 0, 0, 0], summary: true }, ] }, { title: "Aura", cost: 8, parts: [ - { subtitle: "One Wave", type: "damage", multiplier: 200, conversion: [70, 0, 0, 30, 0, 0] }, + { subtitle: "One Wave", type: "damage", multiplier: 200, conversion: [70, 0, 0, 30, 0, 0], summary: true }, ] }, { title: "Uproot", cost: 6, parts: [ - { subtitle: "", type: "damage", multiplier: 50, conversion: [70, 30, 0, 0, 0, 0] }, + { subtitle: "Total Damage", type: "damage", multiplier: 50, conversion: [70, 30, 0, 0, 0, 0], summary: true }, ] }, ] }; diff --git a/display.js b/display.js index 3e7232e..59fa9fd 100644 --- a/display.js +++ b/display.js @@ -796,10 +796,11 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell subtitle_elem.textContent = part.subtitle; part_div.append(subtitle_elem); - let subtitle_elemavg = document.createElement("p"); - subtitle_elemavg.textContent = part.subtitle; - part_divavg.append(subtitle_elemavg); - + if (part.summary == true) { + let subtitle_elemavg = document.createElement("p"); + subtitle_elemavg.textContent = part.subtitle; + part_divavg.append(subtitle_elemavg); + } if (part.type === "damage") { let _results = calculateSpellDamage(stats, part.conversion, @@ -822,16 +823,17 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell averageLabel.classList.add("damageSubtitle"); part_div.append(averageLabel); - let overallaverageLabel = document.createElement("p"); - overallaverageLabel.textContent = "Average: "+averageDamage.toFixed(2); - overallaverageLabel.classList.add("damageSubtitle"); - part_divavg.append(overallaverageLabel); + if (part.summary == true) { + let overallaverageLabel = document.createElement("p"); + overallaverageLabel.textContent = "Average: "+averageDamage.toFixed(2); + overallaverageLabel.classList.add("damageSubtitle"); + part_divavg.append(overallaverageLabel); + } let nonCritLabel = document.createElement("p"); nonCritLabel.textContent = "Non-Crit Average: "+nonCritAverage.toFixed(2); nonCritLabel.classList.add("damageSubtitle"); part_div.append(nonCritLabel); - for (let i = 0; i < 6; i++){ if (results[i][1] > 0){ @@ -865,11 +867,12 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell healLabel.textContent = heal_amount; healLabel.classList.add("damagep"); part_div.append(healLabel); - - let overallhealLabel = document.createElement("p"); - overallhealLabel.textContent = heal_amount; - overallhealLabel.classList.add("damagep") - part_divavg.append(overallhealLabel); + if (part.summary == true) { + let overallhealLabel = document.createElement("p"); + overallhealLabel.textContent = heal_amount; + overallhealLabel.classList.add("damagep") + part_divavg.append(overallhealLabel); + } } else if (part.type === "total") { let total_damage = 0; @@ -884,7 +887,7 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell let overallaverageLabel = document.createElement("p"); overallaverageLabel.textContent = "Average: "+total_damage.toFixed(2); overallaverageLabel.classList.add("damageSubtitle"); - part_divavg.append(averageLabel); + part_divavg.append(overallaverageLabel); } } } diff --git a/index.html b/index.html index 8eb6744..6bf5213 100644 --- a/index.html +++ b/index.html @@ -171,7 +171,7 @@
-

Overall Build Stats:

+