HOTFIX: Raw and % happen in the "same step" now (both based on pre-boost damage)
This commit is contained in:
parent
0b56bdbef2
commit
755def77f3
1 changed files with 12 additions and 8 deletions
|
@ -126,15 +126,18 @@ function calculateSpellDamage(stats, weapon, _conversions, use_spell_damage, ign
|
||||||
// These do not count raw damage. I think. Easy enough to change
|
// These do not count raw damage. I think. Easy enough to change
|
||||||
let total_min = 0;
|
let total_min = 0;
|
||||||
let total_max = 0;
|
let total_max = 0;
|
||||||
|
let save_prop = [];
|
||||||
for (let i in damage_elements) {
|
for (let i in damage_elements) {
|
||||||
|
save_prop.push(damages[i].slice());
|
||||||
|
total_min += damages[i][0];
|
||||||
|
total_max += damages[i][1];
|
||||||
|
|
||||||
let damage_specific = damage_elements[i] + specific_boost_str + 'Pct';
|
let damage_specific = damage_elements[i] + specific_boost_str + 'Pct';
|
||||||
let damageBoost = 1 + skill_boost[i] + static_boost
|
let damageBoost = 1 + skill_boost[i] + static_boost
|
||||||
+ ((stats.get(damage_specific) + stats.get(damage_elements[i]+'DamPct')) /100);
|
+ ((stats.get(damage_specific) + stats.get(damage_elements[i]+'DamPct')) /100);
|
||||||
damages[i][0] *= Math.max(damageBoost, 0);
|
damages[i][0] *= Math.max(damageBoost, 0);
|
||||||
damages[i][1] *= Math.max(damageBoost, 0);
|
damages[i][1] *= Math.max(damageBoost, 0);
|
||||||
// Collect total damage post %boost
|
// Collect total damage post %boost
|
||||||
total_min += damages[i][0];
|
|
||||||
total_max += damages[i][1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let total_elem_min = total_min - damages[0][0];
|
let total_elem_min = total_min - damages[0][0];
|
||||||
|
@ -144,6 +147,7 @@ function calculateSpellDamage(stats, weapon, _conversions, use_spell_damage, ign
|
||||||
let prop_raw = stats.get(specific_boost_str.toLowerCase()+'Raw') + stats.get('damRaw');
|
let prop_raw = stats.get(specific_boost_str.toLowerCase()+'Raw') + stats.get('damRaw');
|
||||||
let rainbow_raw = stats.get('r'+specific_boost_str+'Raw') + stats.get('rDamRaw');
|
let rainbow_raw = stats.get('r'+specific_boost_str+'Raw') + stats.get('rDamRaw');
|
||||||
for (let i in damages) {
|
for (let i in damages) {
|
||||||
|
let save_obj = save_prop[i];
|
||||||
let damages_obj = damages[i];
|
let damages_obj = damages[i];
|
||||||
let damage_prefix = damage_elements[i] + specific_boost_str;
|
let damage_prefix = damage_elements[i] + specific_boost_str;
|
||||||
// Normie raw
|
// Normie raw
|
||||||
|
@ -157,22 +161,22 @@ function calculateSpellDamage(stats, weapon, _conversions, use_spell_damage, ign
|
||||||
if (total_max > 0) { // TODO: what about total negative all raw?
|
if (total_max > 0) { // TODO: what about total negative all raw?
|
||||||
// TODO: compute actual chance of 0 damage. For now we just copy max ratio
|
// TODO: compute actual chance of 0 damage. For now we just copy max ratio
|
||||||
if (total_min === 0) {
|
if (total_min === 0) {
|
||||||
min_boost += (damages_obj[1] / total_max) * prop_raw;
|
min_boost += (save_obj[1] / total_max) * prop_raw;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
min_boost += (damages_obj[0] / total_min) * prop_raw;
|
min_boost += (save_obj[0] / total_min) * prop_raw;
|
||||||
}
|
}
|
||||||
max_boost += (damages_obj[1] / total_max) * prop_raw;
|
max_boost += (save_obj[1] / total_max) * prop_raw;
|
||||||
}
|
}
|
||||||
if (i != 0 && total_elem_max > 0) { // rainraw TODO above
|
if (i != 0 && total_elem_max > 0) { // rainraw TODO above
|
||||||
// TODO: compute actual chance of 0 damage. For now we just copy max ratio
|
// TODO: compute actual chance of 0 damage. For now we just copy max ratio
|
||||||
if (total_elem_min === 0) {
|
if (total_elem_min === 0) {
|
||||||
min_boost += (damages_obj[1] / total_elem_max) * rainbow_raw;
|
min_boost += (save_obj[1] / total_elem_max) * rainbow_raw;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
min_boost += (damages_obj[0] / total_elem_min) * rainbow_raw;
|
min_boost += (save_obj[0] / total_elem_min) * rainbow_raw;
|
||||||
}
|
}
|
||||||
max_boost += (damages_obj[1] / total_elem_max) * rainbow_raw;
|
max_boost += (save_obj[1] / total_elem_max) * rainbow_raw;
|
||||||
}
|
}
|
||||||
damages_obj[0] += min_boost * total_convert;
|
damages_obj[0] += min_boost * total_convert;
|
||||||
damages_obj[1] += max_boost * total_convert;
|
damages_obj[1] += max_boost * total_convert;
|
||||||
|
|
Loading…
Reference in a new issue