Multiplicative str/dex

This commit is contained in:
b 2021-02-11 13:07:43 -06:00
parent 00c46ea8f6
commit 8b36a3498b

View file

@ -90,7 +90,8 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier,
let damages_results = [];
// 0th skillpoint is strength, 1st is dex.
let str = total_skillpoints[0];
let staticBoost = (pctModifier / 100.) + skillPointsToPercentage(str);
let strBoost = 1 + skillPointsToPercentage(str);
let staticBoost = (pctModifier / 100.);// + skillPointsToPercentage(str);
let skillBoost = [0];
for (let i in total_skillpoints) {
skillBoost.push(skillPointsToPercentage(total_skillpoints[i]) + buildStats.get("damageBonus")[i] / 100.);
@ -99,10 +100,14 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier,
for (let i in damages) {
let damageBoost = 1 + skillBoost[i] + staticBoost;
damages_results.push([
Math.max(damages[i][0] * Math.max(damageBoost,0) * damageMult, 0), // Normal min
Math.max(damages[i][1] * Math.max(damageBoost,0) * damageMult, 0), // Normal max
Math.max(damages[i][0] * Math.max(1 + damageBoost, 0) * damageMult, 0), // Crit min
Math.max(damages[i][1] * Math.max(1 + damageBoost, 0) * damageMult, 0), // Crit max
Math.max(damages[i][0] * strBoost * Math.max(damageBoost,0) * damageMult, 0), // Normal min
Math.max(damages[i][1] * strBoost * Math.max(damageBoost,0) * damageMult, 0), // Normal max
Math.max(damages[i][0] * strBoost * 2 * Math.max(damageBoost,0) * damageMult, 0), // Crit min
Math.max(damages[i][1] * strBoost * 2 * Math.max(damageBoost,0) * damageMult, 0), // Crit max
//Math.max(damages[i][0] * Math.max(damageBoost,0) * damageMult, 0), // Normal min
//Math.max(damages[i][1] * Math.max(damageBoost,0) * damageMult, 0), // Normal max
//Math.max(damages[i][0] * Math.max(1 + damageBoost, 0) * damageMult, 0), // Crit min
//Math.max(damages[i][1] * Math.max(1 + damageBoost, 0) * damageMult, 0), // Crit max
]);
totalDamNorm[0] += damages_results[i][0];
totalDamNorm[1] += damages_results[i][1];
@ -110,15 +115,23 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier,
totalDamCrit[1] += damages_results[i][3];
}
if (melee) {
totalDamNorm[0] += Math.max(rawModifier, -damages_results[0][0]);
totalDamNorm[1] += Math.max(rawModifier, -damages_results[0][1]);
totalDamCrit[0] += Math.max(rawModifier, -damages_results[0][2]);
totalDamCrit[1] += Math.max(rawModifier, -damages_results[0][3]);
totalDamNorm[0] += Math.max(strBoost*rawModifier, -damages_results[0][0]);
totalDamNorm[1] += Math.max(strBoost*rawModifier, -damages_results[0][1]);
totalDamCrit[0] += Math.max(strBoost*2*rawModifier, -damages_results[0][2]);
totalDamCrit[1] += Math.max(strBoost*2*rawModifier, -damages_results[0][3]);
//totalDamNorm[0] += Math.max(rawModifier, -damages_results[0][0]);
//totalDamNorm[1] += Math.max(rawModifier, -damages_results[0][1]);
//totalDamCrit[0] += Math.max(rawModifier, -damages_results[0][2]);
//totalDamCrit[1] += Math.max(rawModifier, -damages_results[0][3]);
}
damages_results[0][0] += rawModifier;
damages_results[0][1] += rawModifier;
damages_results[0][2] += rawModifier;
damages_results[0][3] += rawModifier;
damages_results[0][0] += strBoost*rawModifier;
damages_results[0][1] += strBoost*rawModifier;
damages_results[0][2] += strBoost*2*rawModifier;
damages_results[0][3] += strBoost*2*rawModifier;
//damages_results[0][0] += rawModifier;
//damages_results[0][1] += rawModifier;
//damages_results[0][2] += rawModifier;
//damages_results[0][3] += rawModifier;
if (totalDamNorm[0] < 0) totalDamNorm[0] = 0;
if (totalDamNorm[1] < 0) totalDamNorm[1] = 0;