diff --git a/builder/index.html b/builder/index.html index 39391fe..a226881 100644 --- a/builder/index.html +++ b/builder/index.html @@ -1,2 +1,2 @@ - WynnBuilder
Join the discord today to suggest new features, submit bug reports, and hangout/talk to devs!
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Level:
Assign: 0
Original: 0
Assign: 0
Original: 0
Assign: 0
Original: 0
Assign: 0
Original: 0
Assign: 0
Original: 0
Active boosts
Earth
Thunder
Water
Fire
Air
Curse (Active)
Concentration (Passive)
Offense
Defense
Overall
melee
poison
Input a weapon to see abilities!
+ WynnBuilder
Join the discord today to suggest new features, submit bug reports, and hangout/talk to devs!
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Level:
Assign: 0
Original: 0
Assign: 0
Original: 0
Assign: 0
Original: 0
Assign: 0
Original: 0
Assign: 0
Original: 0
Active boosts
Earth
Thunder
Water
Fire
Air
Curse (Active)
Concentration (Passive)
Offense
Defense
Overall
Input a weapon to see abilities!
diff --git a/builder/index_full.html b/builder/index_full.html index 2f2b716..33f8073 100644 --- a/builder/index_full.html +++ b/builder/index_full.html @@ -5,17 +5,6 @@ - - WynnBuilder @@ -35,8 +24,6 @@ - -
+
+
+
Input a weapon to see abilities!
+
+
-
-
melee
- -
-
-
poison
-
-
-
-
Input a weapon to see abilities!
-
-
-
+
-
@@ -1198,20 +1177,6 @@
-
@@ -1278,10 +1243,8 @@
-
- @@ -1290,7 +1253,6 @@ - diff --git a/js/builder_graph.js b/js/builder_graph.js index 36b7c4c..724d027 100644 --- a/js/builder_graph.js +++ b/js/builder_graph.js @@ -656,59 +656,10 @@ class SpellDisplayNode extends ComputeNode { const i = this.spell_idx; let parent_elem = document.getElementById("spell"+i+"-info"); let overallparent_elem = document.getElementById("spell"+i+"-infoAvg"); - displaySpellDamage(parent_elem, overallparent_elem, stats, spell, i+1, damages); + displaySpellDamage(parent_elem, overallparent_elem, stats, spell, i, damages); } } -/* Get melee stats for build. - Returns an array in the order: -*/ -function getMeleeStats(stats, weapon) { - stats = new Map(stats); // Shallow copy - const weapon_stats = weapon.statMap; - const skillpoints = [ - stats.get('str'), - stats.get('dex'), - stats.get('int'), - stats.get('def'), - stats.get('agi') - ]; - if (weapon_stats.get("tier") === "Crafted") { - stats.set("damageBases", [weapon_stats.get("nDamBaseHigh"),weapon_stats.get("eDamBaseHigh"),weapon_stats.get("tDamBaseHigh"),weapon_stats.get("wDamBaseHigh"),weapon_stats.get("fDamBaseHigh"),weapon_stats.get("aDamBaseHigh")]); - } - let adjAtkSpd = attackSpeeds.indexOf(stats.get("atkSpd")) + stats.get("atkTier"); - if(adjAtkSpd > 6){ - adjAtkSpd = 6; - }else if(adjAtkSpd < 0){ - adjAtkSpd = 0; - } - - if (weapon_stats.get("type") === "relik") { - merge_stat(stats, 'damMult.ShamanMelee', 0.99); // CURSE YOU WYNNCRAFT - //One day we will create WynnWynn and no longer have shaman 99% melee injustice. - //In all seriousness 99% is because wynn uses 0.33 to estimate dividing the damage by 3 to split damage between 3 beams. - } - let results = calculateSpellDamage(stats, weapon_stats, [100, 0, 0, 0, 0, 0], false, true); - - let dex = skillpoints[1]; - - let totalDamNorm = results[0]; - let totalDamCrit = results[1]; - totalDamNorm.push(1-skillPointsToPercentage(dex)); - totalDamCrit.push(skillPointsToPercentage(dex)); - let damages_results = results[2]; - - let singleHitTotal = ((totalDamNorm[0]+totalDamNorm[1])*(totalDamNorm[2]) - +(totalDamCrit[0]+totalDamCrit[1])*(totalDamCrit[2]))/2; - - //Now do math - let normDPS = (totalDamNorm[0]+totalDamNorm[1])/2 * baseDamageMultiplier[adjAtkSpd]; - let critDPS = (totalDamCrit[0]+totalDamCrit[1])/2 * baseDamageMultiplier[adjAtkSpd]; - let avgDPS = (normDPS * (1 - skillPointsToPercentage(dex))) + (critDPS * (skillPointsToPercentage(dex))); - //[[n n n n] [e e e e] [t t t t] [w w w w] [f f f f] [a a a a] [lowtotal hightotal normalChance] [critlowtotal crithightotal critChance] normalDPS critCPS averageDPS adjAttackSpeed, singleHit] - return damages_results.concat([totalDamNorm,totalDamCrit,normDPS,critDPS,avgDPS,adjAtkSpd, singleHitTotal]).concat(results[3]); -} - /** * Display build stats. * @@ -723,13 +674,10 @@ class BuildDisplayNode extends ComputeNode { displayBuildStats('overall-stats', build, build_all_display_commands, stats); displayBuildStats("offensive-stats", build, build_offensive_display_commands, stats); displaySetBonuses("set-info", build); - let meleeStats = getMeleeStats(stats, build.weapon); // TODO: move weapon out? - displayMeleeDamage(document.getElementById("build-melee-stats"), document.getElementById("build-melee-statsAvg"), meleeStats); - displayDefenseStats(document.getElementById("defensive-stats"), stats); - displayPoisonDamage(document.getElementById("build-poison-stats"), build); + //displayPoisonDamage(document.getElementById("build-poison-stats"), build); displayEquipOrder(document.getElementById("build-order"), build.equip_order); } } diff --git a/js/display.js b/js/display.js index 8a2926a..9244057 100644 --- a/js/display.js +++ b/js/display.js @@ -1022,152 +1022,6 @@ function displayEquipOrder(parent_elem, buildOrder){ } } -function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats) { - let attackSpeeds = ["Super Slow", "Very Slow", "Slow", "Normal", "Fast", "Very Fast", "Super Fast"]; - //let damagePrefixes = ["Neutral Damage: ","Earth Damage: ","Thunder Damage: ","Water Damage: ","Fire Damage: ","Air Damage: "]; - parent_elem.textContent = ""; - overallparent_elem.textContent = ""; - const stats = meleeStats.slice(); - - for (let i = 0; i < 6; ++i) { - for (let j in stats[i]) { - stats[i][j] = stats[i][j].toFixed(2); - } - } - for (let i = 6; i < 8; ++i) { - for (let j = 0; j < 2; j++) { - stats[i][j] = stats[i][j].toFixed(2); - } - } - for (let i = 8; i < 11; ++i) { - stats[i] = stats[i].toFixed(2); - } - - //title - let title_elem = document.createElement("p"); - title_elem.classList.add("title"); - title_elem.textContent = "Melee Stats"; - parent_elem.append(title_elem); - parent_elem.append(document.createElement("br")); - - //overall title - let title_elemavg = document.createElement("b"); - title_elemavg.textContent = "Melee Stats"; - overallparent_elem.append(title_elemavg); - - //average DPS - let averageDamage = document.createElement("p"); - averageDamage.classList.add("left"); - averageDamage.textContent = "Average DPS: " + stats[10]; - parent_elem.append(averageDamage); - - //overall average DPS - let overallaverageDamage = document.createElement("p"); - let overallaverageDamageFirst = document.createElement("span"); - overallaverageDamageFirst.textContent = "Average DPS: " - - let overallaverageDamageSecond = document.createElement("span"); - overallaverageDamageSecond.classList.add("Damage"); - overallaverageDamageSecond.textContent = stats[10]; - overallaverageDamage.appendChild(overallaverageDamageFirst); - overallaverageDamage.appendChild(overallaverageDamageSecond); - - overallparent_elem.append(overallaverageDamage); - //overallparent_elem.append(document.createElement("br")); - - //attack speed - let atkSpd = document.createElement("p"); - atkSpd.classList.add("left"); - atkSpd.textContent = "Attack Speed: " + attackSpeeds[stats[11]]; - parent_elem.append(atkSpd); - parent_elem.append(document.createElement("br")); - - //overall attack speed - let overallatkSpd = document.createElement("p"); - let overallatkSpdFirst = document.createElement("span"); - overallatkSpdFirst.textContent = "Attack Speed: "; - let overallatkSpdSecond = document.createElement("span"); - overallatkSpdSecond.classList.add("Damage"); - overallatkSpdSecond.textContent = attackSpeeds[stats[11]]; - overallatkSpd.appendChild(overallatkSpdFirst); - overallatkSpd.appendChild(overallatkSpdSecond); - overallparent_elem.append(overallatkSpd); - - //Non-Crit: n->elem, total dmg, DPS - let nonCritStats = document.createElement("p"); - nonCritStats.classList.add("left"); - nonCritStats.textContent = "Non-Crit Stats: "; - nonCritStats.append(document.createElement("br")); - for (let i = 0; i < 6; i++) { - if (stats[i][1] != 0) { - let dmg = document.createElement("p"); - dmg.textContent = stats[i][0] + " \u2013 " + stats[i][1]; - dmg.classList.add(damageClasses[i]); - dmg.classList.add("itemp"); - nonCritStats.append(dmg); - } - } - - let normalDamage = document.createElement("p"); - normalDamage.textContent = "Total: " + stats[6][0] + " \u2013 " + stats[6][1]; - nonCritStats.append(normalDamage); - - let normalDPS = document.createElement("p"); - normalDPS.textContent = "Normal DPS: " + stats[8]; - nonCritStats.append(normalDPS); - - //overall average DPS - let singleHitDamage = document.createElement("p"); - let singleHitDamageFirst = document.createElement("span"); - singleHitDamageFirst.textContent = "Single Hit Average: "; - let singleHitDamageSecond = document.createElement("span"); - singleHitDamageSecond.classList.add("Damage"); - singleHitDamageSecond.textContent = stats[12].toFixed(2); - singleHitDamage.appendChild(singleHitDamageFirst); - singleHitDamage.appendChild(singleHitDamageSecond); - overallparent_elem.append(singleHitDamage); - - let normalChance = document.createElement("p"); - normalChance.textContent = "Non-Crit Chance: " + (stats[6][2]*100).toFixed(2) + "%"; - normalChance.append(document.createElement("br")); - normalChance.append(document.createElement("br")); - nonCritStats.append(normalChance); - - parent_elem.append(nonCritStats); - parent_elem.append(document.createElement("br")); - - //Crit: n->elem, total dmg, DPS - let critStats = document.createElement("p"); - critStats.classList.add("left"); - critStats.textContent = "Crit Stats: "; - critStats.append(document.createElement("br")); - for (let i = 0; i < 6; i++){ - if(stats[i][3] != 0) { - dmg = document.createElement("p"); - dmg.textContent = stats[i][2] + " \u2013 " + stats[i][3]; - dmg.classList.add(damageClasses[i]); - dmg.classList.add("itemp"); - critStats.append(dmg); - } - } - let critDamage = document.createElement("p"); - critDamage.textContent = "Total: " + stats[7][0] + " \u2013 " + stats[7][1]; - critStats.append(critDamage); - - let critDPS = document.createElement("p"); - critDPS.textContent = "Crit DPS: " + stats[9]; - critStats.append(critDPS); - - let critChance = document.createElement("p"); - critChance.textContent = "Crit Chance: " + (stats[7][2]*100).toFixed(2) + "%"; - critChance.append(document.createElement("br")); - critChance.append(document.createElement("br")); - critStats.append(critChance); - - parent_elem.append(critStats); - addClickableArrow(overallparent_elem, parent_elem); -} - function displayDefenseStats(parent_elem, statMap, insertSummary){ let defenseStats = getDefenseStats(statMap); insertSummary = (typeof insertSummary !== 'undefined') ? insertSummary : false; @@ -1533,31 +1387,23 @@ function displaySpellDamage(parent_elem, overallparent_elem, stats, spell, spell // TODO: move cost calc out parent_elem.textContent = ""; - let title_elem = document.createElement("p"); + let title_elem = make_elem("p"); overallparent_elem.textContent = ""; let title_elemavg = document.createElement("b"); if ('cost' in spell) { - let first = document.createElement("span"); - first.textContent = spell.name + " ("; + let first = make_elem("span", [], { textContent: spell.name + " (" }); title_elem.appendChild(first.cloneNode(true)); //cloneNode is needed here. title_elemavg.appendChild(first); - let second = document.createElement("span"); - second.textContent = getSpellCost(stats, spell); - second.classList.add("Mana"); - + let second = make_elem("span", ["Mana"], { textContent: getSpellCost(stats, spell) }); title_elem.appendChild(second.cloneNode(true)); title_elemavg.appendChild(second); - - let third = document.createElement("span"); - third.textContent = ")";// [Base: " + getBaseSpellCost(stats, spellIdx, spell.cost) + " ]"; - title_elem.appendChild(third); - let third_summary = document.createElement("span"); - third_summary.textContent = ")"; - title_elemavg.appendChild(third_summary); + let third = make_elem("span", [], { textContent: ")" });// " + getBaseSpellCost(stats, spellIdx, spell.cost) + " ]"; + title_elem.appendChild(third.cloneNode(true)); + title_elemavg.appendChild(third); } else { title_elem.textContent = spell.name; @@ -1574,30 +1420,26 @@ function displaySpellDamage(parent_elem, overallparent_elem, stats, spell, spell let critChance = skillPointsToPercentage(stats.get('dex')); - let part_divavg = document.createElement("p"); + let part_divavg = make_elem("p"); overallparent_elem.append(part_divavg); function _summary(text, val, fmt) { - let overallaverageLabel = document.createElement("p"); - let first = document.createElement("span"); - let second = document.createElement("span"); - first.textContent = text; - second.textContent = val.toFixed(2); + if (typeof(val) === 'number') { val = val.toFixed(2); } + let overallaverageLabel = make_elem("p"); + let first = make_elem("span", [], { textContent: text }); + let second = make_elem("span", [fmt], { textContent: val }); overallaverageLabel.appendChild(first); overallaverageLabel.appendChild(second); - second.classList.add(fmt); part_divavg.append(overallaverageLabel); } for (let i = 0; i < spell_results.length; ++i) { const spell_info = spell_results[i]; - let part_div = document.createElement("p"); + let part_div = make_elem("p", ["pt-3"]); parent_elem.append(part_div); - let subtitle_elem = document.createElement("p"); - subtitle_elem.textContent = spell_info.name - part_div.append(subtitle_elem); + part_div.append(make_elem("p", [], { textContent: spell_info.name })); if (spell_info.type === "damage") { let totalDamNormal = spell_info.normal_total; @@ -1607,14 +1449,26 @@ function displaySpellDamage(parent_elem, overallparent_elem, stats, spell, spell let critAverage = (totalDamCrit[0]+totalDamCrit[1])/2 || 0; let averageDamage = (1-critChance)*nonCritAverage+critChance*critAverage || 0; - let averageLabel = document.createElement("p"); - averageLabel.textContent = "Average: "+averageDamage.toFixed(2); + let averageLabel = make_elem("p", [], { textContent: "Average: "+averageDamage.toFixed(2) }); // averageLabel.classList.add("damageSubtitle"); part_div.append(averageLabel); - if (spell_info.name === spell.display) { - _summary(spell_info.name+ ": ", averageDamage, "Damage"); + if (spellIdx === 0) { + let attackSpeeds = ["Super Slow", "Very Slow", "Slow", "Normal", "Fast", "Very Fast", "Super Fast"]; + let adjAtkSpd = attackSpeeds.indexOf(stats.get("atkSpd")) + stats.get("atkTier"); + if(adjAtkSpd > 6) { + adjAtkSpd = 6; + } else if(adjAtkSpd < 0) { + adjAtkSpd = 0; + } + _summary("Average DPS: ", averageDamage * baseDamageMultiplier[adjAtkSpd], "Damage"); + _summary("Attack Speed: ", attackSpeeds[adjAtkSpd], "Damage"); + _summary("Per Attack: ", averageDamage, "Damage"); + } + else { + _summary(spell_info.name+ ": ", averageDamage, "Damage"); + } } function _damage_display(label_text, average, dmg_min, dmg_max) {