From 5391b08b37a050bce7ec739b06f3f2c1aaef1edc Mon Sep 17 00:00:00 2001 From: hppeng Date: Tue, 5 Jul 2022 20:40:32 -0700 Subject: [PATCH] Declare skillpoint final multipliers in a good place --- js/build_utils.js | 5 +++++ js/builder_graph.js | 7 +++---- js/damage_calc.js | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/js/build_utils.js b/js/build_utils.js index a747156..5e03b5b 100644 --- a/js/build_utils.js +++ b/js/build_utils.js @@ -15,6 +15,11 @@ function skillPointsToPercentage(skp){ //return clamp((-0.0000000066695* Math.pow(Math.E, -0.00924033 * skp + 18.9) + 1.0771), 0.00, 0.808); } +// WYNN2: Skillpoint max scaling. Intel is cost reduction +const skillpoint_final_mult = [1, 1, 0.5, 0.867, 0.951]; +// intel damage and water% +const skillpoint_damage_mult = [1, 1, 1, 0.867, 0.951]; + /*Turns the input amount of levels into skillpoints available. * * @param level - the integer level count to be converted diff --git a/js/builder_graph.js b/js/builder_graph.js index 5f3077c..c02e784 100644 --- a/js/builder_graph.js +++ b/js/builder_graph.js @@ -502,8 +502,8 @@ class SpellSelectNode extends ComputeNode { */ function getDefenseStats(stats) { let defenseStats = []; - let def_pct = skillPointsToPercentage(stats.get('def')) * 0.867; // lol - let agi_pct = skillPointsToPercentage(stats.get('agi')) * 0.951; // lol2 + let def_pct = skillPointsToPercentage(stats.get('def')) * skillpoint_final_mult[3]; + let agi_pct = skillPointsToPercentage(stats.get('agi')) * skillpoint_final_mult[4]; //total hp let totalHp = stats.get("hp") + stats.get("hpBonus"); if (totalHp < 5) totalHp = 5; @@ -766,7 +766,6 @@ class DisplayBuildWarningsNode extends ComputeNode { ]; let skp_effects = ["% more damage dealt.","% chance to crit.","% spell cost reduction.","% less damage taken.","% chance to dodge."]; let total_assigned = 0; - const mults = [1, 1, 0.5, 0.867, 0.951]; for (let i in skp_order){ //big bren const assigned = skillpoints[i] - base_totals[i] + min_assigned[i] setText(skp_order[i] + "-skp-base", "Original: " + base_totals[i]); @@ -774,7 +773,7 @@ class DisplayBuildWarningsNode extends ComputeNode { setValue(skp_order[i] + "-skp", skillpoints[i]); let linebreak = document.createElement("br"); linebreak.classList.add("itemp"); - setText(skp_order[i] + "-skp-pct", (skillPointsToPercentage(skillpoints[i])*100*mults[i]).toFixed(1).concat(skp_effects[i])); + setText(skp_order[i] + "-skp-pct", (skillPointsToPercentage(skillpoints[i])*100*skillpoint_final_mult[i]).toFixed(1).concat(skp_effects[i])); document.getElementById(skp_order[i]+"-warnings").textContent = '' if (assigned > 100) { let skp_warning = document.createElement("p"); diff --git a/js/damage_calc.js b/js/damage_calc.js index b395e94..dddc9fd 100644 --- a/js/damage_calc.js +++ b/js/damage_calc.js @@ -95,8 +95,9 @@ function calculateSpellDamage(stats, weapon, conversions, use_spell_damage, igno } // 5.1: %boost application let skill_boost = [0]; // no neutral skillpoint booster - for (const skp of skp_order) { - skill_boost.push(skillPointsToPercentage(stats.get(skp))); + for (let i in skp_order) { + const skp = skp_order[i]; + skill_boost.push(skillPointsToPercentage(stats.get(skp)) * skillpoint_damage_mult[i]); } let static_boost = (stats.get(specific_boost_str.toLowerCase()+'Pct') + stats.get('damPct')) / 100;