Merge pull request #224 from hppeng-wynn/atlas-upgrades

Atlas hotfixes
This commit is contained in:
hppeng-wynn 2022-09-17 07:51:54 -07:00 committed by GitHub
commit 38a2ec19e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 24 deletions

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 Raw": "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) { if (filter_name === undefined) {
filter_name = special_mappings[raw_name]; document.getElementById("summary").innerHTML = "Error: The excluded filter \"" + exclude.input_elem.value + "\" is not recognized";
if (filter_name === undefined) { return;
document.getElementById("summary").innerHTML = "Error: The excluded filter \"" + exclude.input_elem.value + "\" is not recognized";
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";

View file

@ -112,6 +112,7 @@ const itemQueryProps = (function() {
maxId(['mainatkrawdmg', 'mainatkrawdam', 'mainatkneutraldmg', 'mainatkneutraldam', 'meleerawdmg', 'meleerawdam', 'meleeneutraldmg', 'meleeneutraldam', 'mdraw'], 'mdRaw'); maxId(['mainatkrawdmg', 'mainatkrawdam', 'mainatkneutraldmg', 'mainatkneutraldam', 'meleerawdmg', 'meleerawdam', 'meleeneutraldmg', 'meleeneutraldam', 'mdraw'], 'mdRaw');
maxId(['spelldmg', 'spelldam', 'spelldmg%', 'spelldam%', 'sdpct'], 'sdPct'); maxId(['spelldmg', 'spelldam', 'spelldmg%', 'spelldam%', 'sdpct'], 'sdPct');
maxId(['spellrawdmg', 'spellrawdam', 'spellneutraldmg', 'spellneutraldam', 'sdraw'], 'sdRaw'); maxId(['spellrawdmg', 'spellrawdam', 'spellneutraldmg', 'spellneutraldam', 'sdraw'], 'sdRaw');
maxId(['rainbowraw'], 'rSdRaw');
const atkSpdIndices = { SUPER_SLOW: -3, VERY_SLOW: -2, SLOW: -1, NORMAL: 0, FAST: 1, VERY_FAST: 2, SUPER_FAST: 3 }; const atkSpdIndices = { SUPER_SLOW: -3, VERY_SLOW: -2, SLOW: -1, NORMAL: 0, FAST: 1, VERY_FAST: 2, SUPER_FAST: 3 };
prop(['attackspeed', 'atkspd'], 'string', (i, ie) => i.atkSpd ? atkSpdIndices[i.atkSpd] : 0); prop(['attackspeed', 'atkspd'], 'string', (i, ie) => i.atkSpd ? atkSpdIndices[i.atkSpd] : 0);