Declare skillpoint final multipliers in a good place

This commit is contained in:
hppeng 2022-07-05 20:40:32 -07:00
parent 59be124de6
commit 5391b08b37
3 changed files with 11 additions and 6 deletions

View file

@ -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); //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. /*Turns the input amount of levels into skillpoints available.
* *
* @param level - the integer level count to be converted * @param level - the integer level count to be converted

View file

@ -502,8 +502,8 @@ class SpellSelectNode extends ComputeNode {
*/ */
function getDefenseStats(stats) { function getDefenseStats(stats) {
let defenseStats = []; let defenseStats = [];
let def_pct = skillPointsToPercentage(stats.get('def')) * 0.867; // lol let def_pct = skillPointsToPercentage(stats.get('def')) * skillpoint_final_mult[3];
let agi_pct = skillPointsToPercentage(stats.get('agi')) * 0.951; // lol2 let agi_pct = skillPointsToPercentage(stats.get('agi')) * skillpoint_final_mult[4];
//total hp //total hp
let totalHp = stats.get("hp") + stats.get("hpBonus"); let totalHp = stats.get("hp") + stats.get("hpBonus");
if (totalHp < 5) totalHp = 5; 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 skp_effects = ["% more damage dealt.","% chance to crit.","% spell cost reduction.","% less damage taken.","% chance to dodge."];
let total_assigned = 0; let total_assigned = 0;
const mults = [1, 1, 0.5, 0.867, 0.951];
for (let i in skp_order){ //big bren for (let i in skp_order){ //big bren
const assigned = skillpoints[i] - base_totals[i] + min_assigned[i] const assigned = skillpoints[i] - base_totals[i] + min_assigned[i]
setText(skp_order[i] + "-skp-base", "Original: " + base_totals[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]); setValue(skp_order[i] + "-skp", skillpoints[i]);
let linebreak = document.createElement("br"); let linebreak = document.createElement("br");
linebreak.classList.add("itemp"); 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 = '' document.getElementById(skp_order[i]+"-warnings").textContent = ''
if (assigned > 100) { if (assigned > 100) {
let skp_warning = document.createElement("p"); let skp_warning = document.createElement("p");

View file

@ -95,8 +95,9 @@ function calculateSpellDamage(stats, weapon, conversions, use_spell_damage, igno
} }
// 5.1: %boost application // 5.1: %boost application
let skill_boost = [0]; // no neutral skillpoint booster let skill_boost = [0]; // no neutral skillpoint booster
for (const skp of skp_order) { for (let i in skp_order) {
skill_boost.push(skillPointsToPercentage(stats.get(skp))); 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; let static_boost = (stats.get(specific_boost_str.toLowerCase()+'Pct') + stats.get('damPct')) / 100;