Merge pull request #117 from hppeng-wynn/damage-calc-update

Implement critDamPct, update melee modifiers to what we see ingame, f…
This commit is contained in:
hppeng-wynn 2022-07-12 19:41:31 -05:00 committed by GitHub
commit 1763afc0cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 46 deletions

View file

@ -13,8 +13,9 @@ Additional Contributors, in no particular order:
- ITechnically (coding emotional support / misc) - ITechnically (coding emotional support / misc)
- touhoku (best IM) - touhoku (best IM)
- HeyZeer0 (huge help in getting our damage formulas right) - HeyZeer0 (huge help in getting our damage formulas right)
- blankman (fin444 github) (beautifying atree visuals)
- Lennon (Skill point formula reversing) - Lennon (Skill point formula reversing)
- Phanta (WynnAtlas custom expression parser / item search) - Phanta (WynnAtlas custom expression parser / item search)
- nbcss (Crafted Item mechanics reverse engineering) - nbcss (and WIM team) (Crafted Item mechanics reverse engineering, testing)
- dr_carlos (Hiding UI elements properly, fade animations, proper error handling) - dr_carlos (Hiding UI elements properly, fade animations, proper error handling)
- Atlas Inc discord (feedback, ideas, damage calc, etc) - Atlas Inc discord (feedback, ideas, damage calc, etc)

View file

@ -920,18 +920,12 @@ const atrees = {
"cost": 1, "cost": 1,
"display": { "row": 2, "col": 4, "icon": "node_0"}, "display": { "row": 2, "col": 4, "icon": "node_0"},
"properties": {}, "properties": {},
"effects": [ "effects": [{
{ "type": "add_spell_prop",
"type": "raw_stat", "base_spell": 0,
"bonuses": [ "target_part": "Single Shot",
{ "multipliers": [5, 0, 0, 0, 0, 0]
"type": "stat", }]
"name": "mdPct",
"value": 5
}
]
}
]
}, },
{ {
"display_name": "Cheaper Arrow Bomb", "display_name": "Cheaper Arrow Bomb",
@ -2038,18 +2032,12 @@ const atrees = {
"properties": { "properties": {
"melee_range": 1 "melee_range": 1
}, },
"effects": [ "effects": [{
{ "type": "add_spell_prop",
"type": "raw_stat", "base_spell": 0,
"bonuses": [ "target_part": "melee",
{ "multipliers": [5, 0, 0, 0, 0, 0]
"type": "stat", }]
"name": "mdPct",
"value": 5
}
]
}
]
}, },
{ {
@ -2843,18 +2831,12 @@ const atrees = {
"properties": { "properties": {
"melee_range": 1 "melee_range": 1
}, },
"effects": [ "effects": [{
{ "type": "add_spell_prop",
"type": "raw_stat", "base_spell": 0,
"bonuses": [ "target_part": "melee",
{ "multipliers": [5, 0, 0, 0, 0, 0]
"type": "stat", }]
"name": "mdPct",
"value": 5
}
]
}
]
}, },
{ {

File diff suppressed because one or more lines are too long

View file

@ -129,6 +129,7 @@ class Build{
} }
} }
statMap.set("poisonPct", 100); statMap.set("poisonPct", 100);
statMap.set("critDamPct", 100);
// The stuff relevant for damage calculation!!! @ferricles // The stuff relevant for damage calculation!!! @ferricles
statMap.set("atkSpd", this.weapon.statMap.get("atkSpd")); statMap.set("atkSpd", this.weapon.statMap.get("atkSpd"));

View file

@ -151,15 +151,11 @@ function calculateSpellDamage(stats, weapon, _conversions, use_spell_damage, ign
let min_boost = raw_boost; let min_boost = raw_boost;
let max_boost = raw_boost; let max_boost = raw_boost;
if (total_max > 0) { // TODO: what about total negative all raw? if (total_max > 0) { // TODO: what about total negative all raw?
if (total_min > 0) {
min_boost += (damages_obj[0] / total_min) * prop_raw; min_boost += (damages_obj[0] / total_min) * prop_raw;
}
max_boost += (damages_obj[1] / total_max) * prop_raw; max_boost += (damages_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
if (total_elem_min > 0) {
min_boost += (damages_obj[0] / total_elem_min) * rainbow_raw; min_boost += (damages_obj[0] / total_elem_min) * rainbow_raw;
}
max_boost += (damages_obj[1] / total_elem_max) * rainbow_raw; max_boost += (damages_obj[1] / total_elem_max) * rainbow_raw;
} }
damages_obj[0] += min_boost * total_convert; damages_obj[0] += min_boost * total_convert;
@ -185,12 +181,14 @@ function calculateSpellDamage(stats, weapon, _conversions, use_spell_damage, ign
damage_mult *= (1 + v/100); damage_mult *= (1 + v/100);
} }
const crit_mult = stats.get("critDamPct")/100;
for (const damage of damages) { for (const damage of damages) {
const res = [ const res = [
damage[0] * strBoost * damage_mult, // Normal min damage[0] * strBoost * damage_mult, // Normal min
damage[1] * strBoost * damage_mult, // Normal max damage[1] * strBoost * damage_mult, // Normal max
damage[0] * (strBoost + 1) * damage_mult, // Crit min damage[0] * (strBoost + crit_mult) * damage_mult, // Crit min
damage[1] * (strBoost + 1) * damage_mult, // Crit max damage[1] * (strBoost + crit_mult) * damage_mult, // Crit max
]; ];
damages_results.push(res); damages_results.push(res);
total_dam_norm[0] += res[0]; total_dam_norm[0] += res[0];