From 4b4bb1ccf92e9ea8490ef418eb7cb4a4ae39f647 Mon Sep 17 00:00:00 2001 From: b Date: Mon, 11 Jan 2021 15:33:03 -0600 Subject: [PATCH] Display Set Summary only if there are set bonuses --- display.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/display.js b/display.js index 9b6f3dc..3b86e43 100644 --- a/display.js +++ b/display.js @@ -174,17 +174,19 @@ function displayBuildStats(build, parent_id){ parent_div.append(title); parent_div.append(document.createElement("br")); - let set_summary_elem = document.createElement('p'); - set_summary_elem.classList.add('itemp'); - set_summary_elem.classList.add('left'); - set_summary_elem.textContent = "Set Summary:"; - parent_div.append(set_summary_elem); - for (const [setName, count] of build.activeSetCounts) { - let set_elem = document.createElement('p'); - set_elem.classList.add('itemp'); - set_elem.classList.add('left'); - set_elem.textContent = " "+setName+" Set: "+count+"/"+sets[setName].items.length; - set_summary_elem.append(set_elem); + if (build.activeSetCounts.size > 0) { + let set_summary_elem = document.createElement('p'); + set_summary_elem.classList.add('itemp'); + set_summary_elem.classList.add('left'); + set_summary_elem.textContent = "Set Summary:"; + parent_div.append(set_summary_elem); + for (const [setName, count] of build.activeSetCounts) { + let set_elem = document.createElement('p'); + set_elem.classList.add('itemp'); + set_elem.classList.add('left'); + set_elem.textContent = " "+setName+" Set: "+count+"/"+sets[setName].items.length; + set_summary_elem.append(set_elem); + } } let stats = build.statMap; @@ -1001,7 +1003,7 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell save_damages.push(averageDamage); } else if (part.type == "heal") { - let heal_amount = (part.strength * build.getDefenseStats()[0] * Math.max(0, Math.min(1.5, 1 + 0.05 * stats.get("wDamPct")/100))).toFixed(2); + let heal_amount = (part.strength * build.getDefenseStats()[0] * Math.max(0, Math.min(1.75, 1 + 0.5 * stats.get("wDamPct")/100))).toFixed(2); let healLabel = document.createElement("p"); healLabel.textContent = heal_amount; healLabel.classList.add("damagep");