Display Set Summary only if there are set bonuses

This commit is contained in:
b 2021-01-11 15:33:03 -06:00
parent 4d5fa370e3
commit 4b4bb1ccf9

View file

@ -174,17 +174,19 @@ function displayBuildStats(build, parent_id){
parent_div.append(title); parent_div.append(title);
parent_div.append(document.createElement("br")); parent_div.append(document.createElement("br"));
let set_summary_elem = document.createElement('p'); if (build.activeSetCounts.size > 0) {
set_summary_elem.classList.add('itemp'); let set_summary_elem = document.createElement('p');
set_summary_elem.classList.add('left'); set_summary_elem.classList.add('itemp');
set_summary_elem.textContent = "Set Summary:"; set_summary_elem.classList.add('left');
parent_div.append(set_summary_elem); set_summary_elem.textContent = "Set Summary:";
for (const [setName, count] of build.activeSetCounts) { parent_div.append(set_summary_elem);
let set_elem = document.createElement('p'); for (const [setName, count] of build.activeSetCounts) {
set_elem.classList.add('itemp'); let set_elem = document.createElement('p');
set_elem.classList.add('left'); set_elem.classList.add('itemp');
set_elem.textContent = " "+setName+" Set: "+count+"/"+sets[setName].items.length; set_elem.classList.add('left');
set_summary_elem.append(set_elem); set_elem.textContent = " "+setName+" Set: "+count+"/"+sets[setName].items.length;
set_summary_elem.append(set_elem);
}
} }
let stats = build.statMap; let stats = build.statMap;
@ -1001,7 +1003,7 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell
save_damages.push(averageDamage); save_damages.push(averageDamage);
} }
else if (part.type == "heal") { 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"); let healLabel = document.createElement("p");
healLabel.textContent = heal_amount; healLabel.textContent = heal_amount;
healLabel.classList.add("damagep"); healLabel.classList.add("damagep");