atlas hotfix

This commit is contained in:
fin444 2022-09-16 08:29:38 -04:00
parent ec8e0e7003
commit d0326b00fb

View file

@ -1,9 +1,8 @@
const translate_mappings = { // commented out filters
//"Name": "name", //"Name": "name",
//"Display Name": "displayName", //"Display Name": "displayName",
//"Tier": "tier", //"Tier": "tier",
//"Set": "set", //"Set": "set",
"Powder Slots": "slots",
//"Type": "type", //"Type": "type",
//"Drop type": "drop", BROKEN //"Drop type": "drop", BROKEN
//"Quest requirement": "quest", BROKEN //"Quest requirement": "quest", BROKEN
@ -15,6 +14,13 @@ const translate_mappings = {
//"Base Thunder Damage": "tDam", //"Base Thunder Damage": "tDam",
//"Base Earth Damage": "eDam", //"Base Earth Damage": "eDam",
//"Base Attack Speed": "atkSpd", //"Base Attack Speed": "atkSpd",
//"Class Requirement": "classReq",
// "Fixed IDs": "fixID", BROKEN
// "Custom Skin": "skin", BROKEN
//"Item Category": "category",
const translate_mappings = {
"Powder Slots": "slots",
"Health": "hp", "Health": "hp",
"Raw Fire Defense": "fDef", "Raw Fire Defense": "fDef",
"Raw Water Defense": "wDef", "Raw Water Defense": "wDef",
@ -22,7 +28,6 @@ const translate_mappings = {
"Raw Thunder Defense": "tDef", "Raw Thunder Defense": "tDef",
"Raw Earth Defense": "eDef", "Raw Earth Defense": "eDef",
"Combat Level": "lvl", "Combat Level": "lvl",
//"Class Requirement": "classReq",
"Req Strength": "strReq", "Req Strength": "strReq",
"Req Dexterity": "dexReq", "Req Dexterity": "dexReq",
"Req Intelligence": "intReq", "Req Intelligence": "intReq",
@ -63,10 +68,6 @@ const translate_mappings = {
"% Air Defense": "aDefPct", "% Air Defense": "aDefPct",
"% Thunder Defense": "tDefPct", "% Thunder Defense": "tDefPct",
"% Earth Defense": "eDefPct", "% Earth Defense": "eDefPct",
"Fixed IDs": "fixID",
"Custom Skin": "skin",
//"Item Category": "category",
"1st Spell Cost %": "-spPct1", "1st Spell Cost %": "-spPct1",
"1st Spell Cost Raw": "-spRaw1", "1st Spell Cost Raw": "-spRaw1",
"2nd Spell Cost %": "-spPct2", "2nd Spell Cost %": "-spPct2",
@ -75,27 +76,20 @@ const translate_mappings = {
"3rd Spell Cost Raw": "-spRaw3", "3rd Spell Cost Raw": "-spRaw3",
"4th Spell Cost %": "-spPct4", "4th Spell Cost %": "-spPct4",
"4th Spell Cost Raw": "-spRaw4", "4th Spell Cost Raw": "-spRaw4",
"Rainbow Spell Damage": "rainbowRaw", "Rainbow Spell Damage": "rainbowRaw",
"Sprint": "sprint", "Sprint": "sprint",
"Sprint Regen": "sprintReg", "Sprint Regen": "sprintReg",
"Jump Height": "jh", "Jump Height": "jh",
"Loot Quality": "lq", "Loot Quality": "lq",
"Gather XP Bonus": "gXp", "Gather XP Bonus": "gXp",
"Gather Speed Bonus": "gSpd", "Gather Speed Bonus": "gSpd"
}; };
const special_mappings = { const special_mappings = {
"Sum (skill points)": "str+dex+int+def+agi", "Sum (skill points)": "str+dex+int+def+agi",
"Sum (Mana Sustain)": "mr+ms", "Sum (Mana Sustain)": "mr+ms",
"Sum (Life Sustain)": "hpr+ls", "Sum (Life Sustain)": "hpr+ls",
"Sum (Health + Health Bonus)": "hp+hpBonus", "Sum (Health + Health Bonus)": "hp+hpBonus"
// "No Strength Req": "strReq=0",
// "No Dexterity Req": "dexReq=0",
// "No Intelligence Req": "intReq=0",
// "No Agility Req": "agiReq=0",
// "No Defense Req": "defReq=0",
}; };
let item_filters = []; let item_filters = [];
@ -191,6 +185,9 @@ function do_item_search() {
let zero_in_min_max = (isNaN(min) || min < 0) && (isNaN(max) || max > 0); let zero_in_min_max = (isNaN(min) || min < 0) && (isNaN(max) || max > 0);
let raw_name = filter.input_elem.value; let raw_name = filter.input_elem.value;
if (raw_name == "") {
continue; // empty
}
let filter_name = translate_mappings[raw_name]; let filter_name = translate_mappings[raw_name];
if (filter_name === undefined) { if (filter_name === undefined) {
filter_name = special_mappings[raw_name]; filter_name = special_mappings[raw_name];
@ -216,16 +213,15 @@ function do_item_search() {
// excludes // excludes
for (const exclude of excludes) { for (const exclude of excludes) {
let raw_name = exclude.input_elem.value; let raw_name = exclude.input_elem.value;
if (raw_name == "") {
continue; // empty
}
let filter_name = translate_mappings[raw_name]; let filter_name = translate_mappings[raw_name];
if (filter_name === undefined) {
filter_name = special_mappings[raw_name];
if (filter_name === undefined) { if (filter_name === undefined) {
document.getElementById("summary").innerHTML = "Error: The excluded filter \"" + exclude.input_elem.value + "\" is not recognized"; document.getElementById("summary").innerHTML = "Error: The excluded filter \"" + exclude.input_elem.value + "\" is not recognized";
return; return;
} }
filter_name = "(" + filter_name + ")"; queries.push("f:" + filter_name + "=0");
}
queries.push("f:" + filter_name + "!=0");
} }
let filter_query = "true"; let filter_query = "true";