From 9332d6575b9b3a0899a36637f41a70cd6b3db454 Mon Sep 17 00:00:00 2001 From: b Date: Sat, 9 Jan 2021 07:15:30 -0600 Subject: [PATCH] Remove some debugging prints, fix -skillpoint weapon bug --- damage_calc.js | 2 +- display.js | 5 +---- skillpoints.js | 5 +++-- test.js | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/damage_calc.js b/damage_calc.js index 28a0050..17195e9 100644 --- a/damage_calc.js +++ b/damage_calc.js @@ -20,7 +20,7 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier, neutralRemainingRaw[0] = Math.floor(neutralRemainingRaw[0] - min_diff); neutralRemainingRaw[1] = Math.floor(neutralRemainingRaw[1] - max_diff); } - console.log(damages); + //console.log(damages); let rawBoosts = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]; for (const powderID of weapon.get("powders")) { const powder = powderStats[powderID]; diff --git a/display.js b/display.js index 2f06dfa..4b69e86 100644 --- a/display.js +++ b/display.js @@ -38,9 +38,7 @@ function expandItem(item, powders){ } } for (const id of nonRolledIDs){ - if(item[id]){ - expandedItem.set(id,item[id]); - } + expandedItem.set(id,item[id]); } expandedItem.set("minRolls",minRolls); expandedItem.set("maxRolls",maxRolls); @@ -408,7 +406,6 @@ function displaySpellDamage(parent_elem, build, spell, spellIdx) { part_div.append(nonCritLabel); let damageClasses = ["Neutral","Earth","Thunder","Water","Fire","Air"]; - console.log(results); for (let i = 0; i < 6; i++){ if (results[i][1] > 0){ let p = document.createElement("p"); diff --git a/skillpoints.js b/skillpoints.js index e529a44..85a768a 100644 --- a/skillpoints.js +++ b/skillpoints.js @@ -63,10 +63,11 @@ function calculate_skillpoints(equipment, weapon) { let best_skillpoints = [0, 0, 0, 0, 0]; let best_total = Infinity; + let allFalse = [false, false, false, false, false]; if (consider.length > 0 || noboost.length > 0) { // Try every combination and pick the best one. for (let permutation of perm(consider)) { - let has_skillpoint = [false, false, false, false, false]; + let has_skillpoint = allFalse.slice(); permutation = permutation.concat(noboost); @@ -120,7 +121,7 @@ function calculate_skillpoints(equipment, weapon) { // } // } // } - result = apply_to_fit(skillpoints, weapon); + result = apply_to_fit(skillpoints, weapon, allFalse); needed_skillpoints = result[0]; total_diff = result[1]; for (let i = 0; i < 5; ++i) { diff --git a/test.js b/test.js index 07ab2d9..67ddfe1 100644 --- a/test.js +++ b/test.js @@ -11,7 +11,7 @@ console.log(url_tag); * END testing section */ -const BUILD_VERSION = "2.7"; +const BUILD_VERSION = "2.8"; document.getElementById("header").textContent = "Wynn build calculator "+BUILD_VERSION+" (db version "+DB_VERSION+")";