Fix a bunch of bugs from discord bug reports channel

This commit is contained in:
hppeng 2022-09-04 12:17:01 -07:00
parent 68197b0532
commit bf6fc1a69e
8 changed files with 113 additions and 96 deletions

View file

@ -73,7 +73,7 @@ const atrees = {
{ {
"type": "replace_spell", "type": "replace_spell",
"name": "Escape", "name": "Escape",
"cost": 25, "cost": 20,
"base_spell": 2, "base_spell": 2,
"display": "", "display": "",
"parts": [] "parts": []
@ -408,12 +408,19 @@ const atrees = {
{ {
"name": "Single Bow", "name": "Single Bow",
"type": "total", "type": "total",
"hits": { "Single Shot": "Arrow Shield.shots" } "hits": { "Single Shot": "Arrow Shield.shots" },
"display": false
},
{
"name": "Single Volley",
"type": "total",
"hits": { "Single Shot": "Arrow Shield.charges" },
"display": false
}, },
{ {
"name": "DPS", "name": "DPS",
"type": "total", "type": "total",
"hits": { "Single Shot": "Arrow Shield.charges" } "hits": { "Single Volley": 2 }
}, },
{ {
"name": "Total Damage", "name": "Total Damage",
@ -688,12 +695,12 @@ const atrees = {
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
"base_spell": 2, "base_spell": 2,
"target_part": "Stomp Damage", "target_part": "Total Damage",
"cost": 0, "cost": 0,
"hits": { "hits": {
"Fierce Stomp": 1 "Fierce Stomp": 1
}, },
"display": "Stomp Damage" "display": "Total Damage"
} }
] ]
}, },
@ -843,11 +850,11 @@ const atrees = {
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
"base_spell": 2, "base_spell": 2,
"target_part": "Per Arrow", "target_part": "Escape Artist Arrow",
"multipliers": [ "multipliers": [
20, 70,
0, 0,
10, 30,
0, 0,
0, 0,
0 0
@ -856,11 +863,11 @@ const atrees = {
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
"base_spell": 2, "base_spell": 2,
"target_part": "Max Damage (Escape Artist)", "target_part": "Total Damage",
"hits": { "hits": {
"Per Arrow": 120 "Escape Artist Arrow": 1
}, },
"display": "Max Damage (Escape Artist)" "display": "Total Damage"
} }
] ]
}, },
@ -929,7 +936,7 @@ const atrees = {
{ {
"name": "DPS", "name": "DPS",
"hits": { "hits": {
"Single Hit": 4 "Single Hit": 3.3333333333333
} }
} }
] ]
@ -1003,7 +1010,7 @@ const atrees = {
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
"base_spell": 2, "base_spell": 2,
"target_part": "Stomp Damage", "target_part": "Total Damage",
"hits": { "hits": {
"Geyser Stomp": 1 "Geyser Stomp": 1
} }
@ -2074,7 +2081,7 @@ const atrees = {
}, },
{ {
"display_name": "Elusive", "display_name": "Elusive",
"desc": "If you do not get hit for 8+ seconds, become immune to self-damage and remove Arrow Storm's recoil. (Dodging counts as not getting hit)", "desc": "If you do not get hit for 5+ seconds, become immune to self-damage and remove Arrow Storm's recoil. (Dodging counts as not getting hit)",
"archetype": "Boltslinger", "archetype": "Boltslinger",
"archetype_req": 0, "archetype_req": 0,
"parents": [ "parents": [
@ -2531,23 +2538,15 @@ const atrees = {
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
"base_spell": 4, "base_spell": 4,
"target_part": "Arrow Rain (Per Arrow)", "target_part": "Arrow Rain",
"multipliers": [ "multipliers": [
80, 100,
0, 0,
0, 0,
0, 0,
0, 0,
60 50
] ]
},
{
"type": "add_spell_prop",
"base_spell": 4,
"target_part": "Arrow Rain (Total)",
"hits": {
"Arrow Rain (Per Arrow)": 150
}
} }
] ]
}, },
@ -4067,7 +4066,7 @@ const atrees = {
"icon": "node_1" "icon": "node_1"
}, },
"properties": { "properties": {
"range": 2 "range": 1
}, },
"effects": [ "effects": [
{ {
@ -4751,7 +4750,7 @@ const atrees = {
"parts": [ "parts": [
{ {
"name": "Heal", "name": "Heal",
"power": 0.1 "power": 0.15
} }
] ]
} }
@ -5228,7 +5227,7 @@ const atrees = {
}, },
{ {
"display_name": "Thunderstorm", "display_name": "Thunderstorm",
"desc": "After casting Meteor, summon 3 lightning strikes and deal additional damage", "desc": "After casting Meteor, summon 4 lightning strikes and deal additional damage",
"base_abil": "Meteor", "base_abil": "Meteor",
"parents": [ "parents": [
"Wind Slash", "Wind Slash",
@ -5253,9 +5252,9 @@ const atrees = {
"target_part": "Lightning Damage", "target_part": "Lightning Damage",
"base_spell": 3, "base_spell": 3,
"multipliers": [ "multipliers": [
30, 25,
0, 0,
15, 10,
0, 0,
0, 0,
0 0
@ -5266,7 +5265,7 @@ const atrees = {
"target_part": "Total Damage", "target_part": "Total Damage",
"base_spell": 3, "base_spell": 3,
"hits": { "hits": {
"Lightning Damage": 3 "Lightning Damage": 4
} }
} }
] ]
@ -5564,7 +5563,7 @@ const atrees = {
{ {
"display_name": "Purification", "display_name": "Purification",
"desc": "Heal and Arcane Transfer will purify you of all negative effects and fire. (3s Cooldown)", "desc": "Heal and Arcane Transfer will purify you of all negative effects and fire. (3s Cooldown)",
"base_abil": 1, "base_abil": "Heal",
"parents": [ "parents": [
"Ophanim", "Ophanim",
"Cheaper Heal", "Cheaper Heal",
@ -5662,7 +5661,7 @@ const atrees = {
"name": "nConvBase:3.Lightning Damage" "name": "nConvBase:3.Lightning Damage"
} }
], ],
"scaling": [15] "scaling": [10]
}, },
{ {
"type": "stat_scaling", "type": "stat_scaling",
@ -5682,7 +5681,7 @@ const atrees = {
"name": "eConvBase:3.Lightning Damage" "name": "eConvBase:3.Lightning Damage"
} }
], ],
"scaling": [10] "scaling": [8]
} }
] ]
}, },
@ -6029,7 +6028,8 @@ const atrees = {
"archetype": "Riftwalker", "archetype": "Riftwalker",
"archetype_req": 5, "archetype_req": 5,
"parents": [ "parents": [
"Cheaper Ice Snake" "Cheaper Ice Snake",
"Fluid Healing"
], ],
"dependencies": [ "dependencies": [
"Ice Snake", "Ice Snake",
@ -6149,7 +6149,7 @@ const atrees = {
"type": "add_spell_prop", "type": "add_spell_prop",
"base_spell": 1, "base_spell": 1,
"target_part": "Second and Third Pulses", "target_part": "Second and Third Pulses",
"power": 0.15 "power": 0.20
}, },
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
@ -6204,7 +6204,9 @@ const atrees = {
"col": 4, "col": 4,
"icon": "node_3" "icon": "node_3"
}, },
"properties": {}, "properties": {
"range": 7
},
"effects": [ "effects": [
{ {
"type": "replace_spell", "type": "replace_spell",
@ -6216,11 +6218,11 @@ const atrees = {
"name": "Single Orb", "name": "Single Orb",
"type": "damage", "type": "damage",
"multipliers": [ "multipliers": [
40, 70,
0, 0,
0, 0,
0, 0,
20, 30,
0 0
] ]
}, },
@ -6735,7 +6737,8 @@ const atrees = {
"archetype": "Light Bender", "archetype": "Light Bender",
"archetype_req": 0, "archetype_req": 0,
"parents": [ "parents": [
"Better Ophanim" "Better Ophanim",
"Dynamic Faith"
], ],
"dependencies": [ "dependencies": [
"Healthier Ophanim I" "Healthier Ophanim I"
@ -6752,7 +6755,7 @@ const atrees = {
}, },
{ {
"display_name": "Sunflare", "display_name": "Sunflare",
"desc": "After healing 400% of your max health within 10s, your next Heal will make every nearby ally temporarily immune.", "desc": "After healing 300% of your max health within 10s, your next Heal will make every nearby ally temporarily immune. Cooldown: 20s",
"archetype": "Light Bender", "archetype": "Light Bender",
"archetype_req": 12, "archetype_req": 12,
"base_abil": "Heal", "base_abil": "Heal",
@ -10726,7 +10729,7 @@ const atrees = {
"parts": [ "parts": [
{ {
"name": "Effigy Hit", "name": "Effigy Hit",
"multipliers": [ 50, 0, 0, 50, 0, 0 ] "multipliers": [ 40, 0, 0, 40, 0, 0 ]
}, },
{ {
"name": "Single Effigy DPS", "name": "Single Effigy DPS",
@ -10913,7 +10916,7 @@ const atrees = {
}, },
{ {
"display_name": "Blood Rite", "display_name": "Blood Rite",
"desc": "When yourself or an ally gets hit while standing in your Totem's range, add 25% of the damage taken into your Blood Pool. (Max 10%)", "desc": "When yourself or an ally gets hit while standing in your Totem's range, add 35% of the damage taken into your Blood Pool. (Max 10%)",
"archetype": "Acolyte", "archetype": "Acolyte",
"archetype_req": 9, "archetype_req": 9,
"parents": ["Fluid Healing", "More Blood Pool II"], "parents": ["Fluid Healing", "More Blood Pool II"],
@ -10946,7 +10949,14 @@ const atrees = {
"properties": { "properties": {
"max_effigy": 1 "max_effigy": 1
}, },
"effects": [] "effects": [
{
"type": "add_spell_prop",
"base_spell": 7,
"name": "Effigy Hit",
"multipliers": [ -10, 0, 0, -10, 0, 0 ]
}
]
}, },
{ {
"display_name": "Chant of the Fanatic", "display_name": "Chant of the Fanatic",
@ -11060,7 +11070,7 @@ const atrees = {
}, },
{ {
"display_name": "Mengdu", "display_name": "Mengdu",
"desc": "For every 1% Thorns you have from item IDs, gain +1% Water Damage. (Max 100%)", "desc": "For every 1% Thorns you have from item IDs, gain +1% Water Damage. (Max 40%)",
"parents": ["Chant of the Fanatic", "Invigorating Wave"], "parents": ["Chant of the Fanatic", "Invigorating Wave"],
"dependencies": [], "dependencies": [],
"blockers": [], "blockers": [],
@ -11086,7 +11096,7 @@ const atrees = {
"name": "wDamPct" "name": "wDamPct"
}, },
"scaling": [ 1 ], "scaling": [ 1 ],
"max": 100 "max": 40
} }
] ]
}, },

File diff suppressed because one or more lines are too long

View file

@ -29,8 +29,7 @@ let boosts_node = new (class extends ComputeNode {
let elem = document.getElementById(key + "-boost") let elem = document.getElementById(key + "-boost")
if (elem.classList.contains("toggleOn")) { if (elem.classList.contains("toggleOn")) {
damage_boost += value; damage_boost += value;
if (key === "warscream") { def_boost += .10 } if (key === "warscream") { def_boost += .20 }
if (key === "vanish") { def_boost += .15 }
} }
} }
let res = new Map(); let res = new Map();
@ -629,48 +628,51 @@ class SpellDamageCalcNode extends ComputeNode {
else { else {
continue; continue;
} }
spell_result.name = part.name; const {name, display = true} = part;
spell_result.name = name;
spell_result.display = display;
spell_results.push(spell_result); spell_results.push(spell_result);
spell_result_map.set(part.name, spell_result); spell_result_map.set(name, spell_result);
} }
for (const part of spell_parts) { for (const part of spell_parts) {
if ('hits' in part) { if (!('hits' in part)) { continue; }
let spell_result = { let spell_result = {
normal_min: [0, 0, 0, 0, 0, 0], normal_min: [0, 0, 0, 0, 0, 0],
normal_max: [0, 0, 0, 0, 0, 0], normal_max: [0, 0, 0, 0, 0, 0],
normal_total: [0, 0], normal_total: [0, 0],
crit_min: [0, 0, 0, 0, 0, 0], crit_min: [0, 0, 0, 0, 0, 0],
crit_max: [0, 0, 0, 0, 0, 0], crit_max: [0, 0, 0, 0, 0, 0],
crit_total: [0, 0], crit_total: [0, 0],
heal_amount: 0 heal_amount: 0
}
const dam_res_keys = ['normal_min', 'normal_max', 'normal_total', 'crit_min', 'crit_max', 'crit_total'];
for (const [subpart_name, hits] of Object.entries(part.hits)) {
const subpart = spell_result_map.get(subpart_name);
if (!subpart) { continue; }
if (spell_result.type) {
if (subpart.type !== spell_result.type) {
throw "SpellCalc total subpart type mismatch";
}
}
else {
spell_result.type = subpart.type;
}
if (spell_result.type === 'damage') {
for (const key of dam_res_keys) {
for (let i in spell_result.normal_min) {
spell_result[key][i] += subpart[key][i] * hits;
}
}
}
else {
spell_result.heal_amount += subpart.heal_amount * hits;
}
}
spell_result.name = part.name;
spell_results.push(spell_result);
spell_result_map.set(part.name, spell_result);
} }
const dam_res_keys = ['normal_min', 'normal_max', 'normal_total', 'crit_min', 'crit_max', 'crit_total'];
for (const [subpart_name, hits] of Object.entries(part.hits)) {
const subpart = spell_result_map.get(subpart_name);
if (!subpart) { continue; }
if (spell_result.type) {
if (subpart.type !== spell_result.type) {
throw "SpellCalc total subpart type mismatch";
}
}
else {
spell_result.type = subpart.type;
}
if (spell_result.type === 'damage') {
for (const key of dam_res_keys) {
for (let i in spell_result.normal_min) {
spell_result[key][i] += subpart[key][i] * hits;
}
}
}
else {
spell_result.heal_amount += subpart.heal_amount * hits;
}
}
const {name, display = true} = part;
spell_result.name = name;
spell_result.display = display;
spell_results.push(spell_result);
spell_result_map.set(name, spell_result);
} }
return spell_results; return spell_results;
} }

View file

@ -249,11 +249,13 @@ spell_damage: {
name: str != "total" Name of the part. name: str != "total" Name of the part.
type: "damage" [TODO: DEPRECATED/REMOVE] flag signaling what type of part it is. Can infer from fields type: "damage" [TODO: DEPRECATED/REMOVE] flag signaling what type of part it is. Can infer from fields
multipliers: array[num, 6] floating point spellmults (though supposedly wynn only supports integer mults) multipliers: array[num, 6] floating point spellmults (though supposedly wynn only supports integer mults)
display: bool To show part or not (for some spells there are too many intermediate calc parts). Default: True
} }
spell_heal: { spell_heal: {
name: str != "total" Name of the part. name: str != "total" Name of the part.
type: "heal" [TODO: DEPRECATED/REMOVE] flag signaling what type of part it is. Can infer from fields type: "heal" [TODO: DEPRECATED/REMOVE] flag signaling what type of part it is. Can infer from fields
power: num floating point healing power (1 is 100% of max hp). power: num floating point healing power (1 is 100% of max hp).
display: bool To show part or not (for some spells there are too many intermediate calc parts). Default: True
} }
spell_total: { spell_total: {
name: str != "total" Name of the part. name: str != "total" Name of the part.
@ -261,6 +263,7 @@ spell_total: {
hits: Map[str, Union[str, num]] Keys are other part names, numbers are the multipliers. Undefined behavior if subparts hits: Map[str, Union[str, num]] Keys are other part names, numbers are the multipliers. Undefined behavior if subparts
are not the same type of spell. Can only pull from spells defined before it. are not the same type of spell. Can only pull from spells defined before it.
Alternatively, a property reference of the format <ability_id>.propname Alternatively, a property reference of the format <ability_id>.propname
display: bool To show part or not (for some spells there are too many intermediate calc parts). Default: True
} }

View file

@ -114,7 +114,7 @@ function displayBuildStats(parent_id,build,command_group,stats){
id_val = Math.ceil(id_val*stats.get("poisonPct")/100); id_val = Math.ceil(id_val*stats.get("poisonPct")/100);
} }
displayFixedID(parent_div, id, id_val, elemental_format, style); displayFixedID(parent_div, id, id_val, elemental_format, style);
if (id === "poison" && id_val > 0) { /*if (id === "poison" && id_val > 0) {
let row = make_elem('div', ['row']); let row = make_elem('div', ['row']);
let value_elem = make_elem('div', ['col', 'text-end']); let value_elem = make_elem('div', ['col', 'text-end']);
@ -127,7 +127,7 @@ function displayBuildStats(parent_id,build,command_group,stats){
row.appendChild(value_elem); row.appendChild(value_elem);
parent_div.appendChild(row); parent_div.appendChild(row);
} }
else if (id === "ls" && id_val != 0) { else */if (id === "ls" && id_val != 0) {
let row = make_elem('div', ['row']); let row = make_elem('div', ['row']);
let value_elem = make_elem('div', ['col', 'text-end']); let value_elem = make_elem('div', ['col', 'text-end']);
@ -1014,7 +1014,8 @@ function displayPoisonDamage(overallparent_elem, statMap) {
title_elemavg.append(make_elem('span', [], { textContent: "Poison Stats" })); title_elemavg.append(make_elem('span', [], { textContent: "Poison Stats" }));
spell_summary.append(title_elemavg); spell_summary.append(title_elemavg);
let poison_tick = Math.ceil(statMap.get("poison") * (1+skillPointsToPercentage(statMap.get('str'))) * (statMap.get("poisonPct"))/100 /3); let poison_tick = Math.floor(statMap.get("poison")/3);
//let poison_tick = Math.ceil(statMap.get("poison") * (1+skillPointsToPercentage(statMap.get('str'))) * (statMap.get("poisonPct"))/100 /3);
let overallpoisonDamage = make_elem("p"); let overallpoisonDamage = make_elem("p");
overallpoisonDamage.append( overallpoisonDamage.append(
@ -1456,6 +1457,7 @@ function displaySpellDamage(parent_elem, _overallparent_elem, stats, spell, spel
for (let i = 0; i < spell_results.length; ++i) { for (let i = 0; i < spell_results.length; ++i) {
const spell_info = spell_results[i]; const spell_info = spell_results[i];
if (!spell_info.display) { continue; }
let part_div = make_elem("p", ["pt-3"]); let part_div = make_elem("p", ["pt-3"]);
parent_elem.append(part_div); parent_elem.append(part_div);

View file

@ -157,7 +157,7 @@ let idSuffixes = {"displayName": "",
"spRaw3":"", "spRaw3":"",
"spPct4":"%", "spPct4":"%",
"spRaw4":"", "spRaw4":"",
"rainbowRaw":"", "rSdRaw":"",
"sprint":"%", "sprint":"%",
"sprintReg":"%", "sprintReg":"%",
"jh":"", "jh":"",
@ -255,7 +255,7 @@ let build_detailed_display_commands = [
"ref", "thorns", "ref", "thorns",
"expd", "expd",
"spd", "spd",
"rainbowRaw", "rSdRaw",
"sprint", "sprintReg", "sprint", "sprintReg",
"jh", "jh",
"xpb", "lb", "lq", "xpb", "lb", "lq",

View file

@ -1,4 +1,4 @@
const TOME_DB_VERSION = 4; const TOME_DB_VERSION = 5;
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA // @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
let tdb; let tdb;

View file

@ -56,8 +56,8 @@
"restrict": "Soulbound Item", "restrict": "Soulbound Item",
"lvl": 100, "lvl": 100,
"defMobs": 5, "defMobs": 5,
"thorns": 6, "exploding": 6,
"reflection": 6, "mdPct": 6,
"fixID": false, "fixID": false,
"id": 3, "id": 3,
"alias": "Melee II" "alias": "Melee II"
@ -806,4 +806,4 @@
"alias": "Rainbow" "alias": "Rainbow"
} }
] ]
} }