This commit is contained in:
ferricles 2021-02-12 09:00:09 -08:00
commit 5362b954fc
4 changed files with 31 additions and 17 deletions

View file

@ -7,5 +7,6 @@ The game, of course
Additional Contributors:
- Phanta (WynnAtlas custom expression parser / item search)
- QuantumNep (Layout code/layout ideas)
- nbcss (Crafter figuring-out-the-gamifying)
- dr_carlos (Hiding UI elements properly, fade animations, proper error handling)
- Atlas Inc discord (feedback, ideas, etc)

View file

@ -92,7 +92,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.);
@ -101,10 +102,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];
@ -112,15 +117,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;

View file

@ -1416,7 +1416,7 @@ function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats){
nonCritStats.textContent = "Non-Crit Stats: ";
nonCritStats.append(document.createElement("br"));
for (let i = 0; i < 6; i++){
if(stats[i][0] > 0){
if(stats[i][1] > 0){
let dmg = document.createElement("p");
dmg.textContent = stats[i][0] + "-" + stats[i][1];
dmg.classList.add(damageClasses[i]);
@ -1466,7 +1466,7 @@ function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats){
critStats.textContent = "Crit Stats: ";
critStats.append(document.createElement("br"));
for (let i = 0; i < 6; i++){
if(stats[i][2] > 0){
if(stats[i][3] > 0){
dmg = document.createElement("p");
dmg.textContent = stats[i][2] + "-" + stats[i][3];
dmg.classList.add(damageClasses[i]);

View file

@ -48,9 +48,9 @@ class IdQuery {
}
console.log("QUERY: ID, NONROLL");
}
else if (id in reversedIDs) {
else if (reversedIDs.includes(id)) {
this.compare = function(a, b) {
return b.get("maxRolls").get(id) - a.get("maxRolls").get(id);
return a.get("maxRolls").get(id) - b.get("maxRolls").get(id);
};
this.filter = function(a) {
return a.get("maxRolls").get(this.id);