wynnbuilder-forked-for-changes/js/display_constants.js
hppeng 1d6b302f38 parent 3e725eded8
author hppeng <hppeng> 1699417872 -0800
committer hppeng <hppeng> 1720354753 -0700

parent 3e725eded8
author hppeng <hppeng> 1699417872 -0800
committer hppeng <hppeng> 1720354749 -0700

parent 3e725eded8
author hppeng <hppeng> 1699417872 -0800
committer hppeng <hppeng> 1720354744 -0700

parent 3e725eded8
author hppeng <hppeng> 1699417872 -0800
committer hppeng <hppeng> 1720354739 -0700

parent 3e725eded8
author hppeng <hppeng> 1699417872 -0800
committer hppeng <hppeng> 1720354735 -0700

parent 3e725eded8
author hppeng <hppeng> 1699417872 -0800
committer hppeng <hppeng> 1720354730 -0700

parent 3e725eded8
author hppeng <hppeng> 1699417872 -0800
committer hppeng <hppeng> 1720354688 -0700

Update recipes.json (#265)

Change ratio of gems to oil as it has been updated in 2.0.4

> Updated the Jeweling Recipe Changes (Bracelet- 2:1 gems:oil, Necklaces- 3:1 gems:oil)

https://forums.wynncraft.com/threads/2-0-4-full-changelog-new-bank-lootruns-more.310535/

Finish updating recipes.json

why are there 4 versions of this file active at any given time

Fix damage calculation for rainbow raw

wow this bug has been here for a LONG time

also bump version for ing db

Bunch of bugfixes

- new major ID
- divine honor: reduce earth damage
- radiance: don't boost tomes, xp/loot bonuses

atree:
- parry: minor typo
- death magnet: marked dep
- nightcloak knife: 15s desc

Api v3 (#267)

* Tweak ordering to be consistent internally

* v3 items  (#266)

* item_wrapper script

for updating item data with v3 endpoint

* metadata from v3

* v3 item format

For the purpose of wynnbuilder, additional mapping might be needed.

* v3 item format

additional mapping might be needed for wb

* v3 compressed item json

* clean item json v3 format

* Update translate map to api v3

partially... we will need to redo scripts to flatmap all the items

* Fix items for 2.0.4.3

finally

* New ingredients (and parse script update)

just realized I forgot to commit the parse script this whole time

* Forgot to commit data files, and bump ing db version

* Sketchily reverse translate major ids

internalname and separate lookup table lol

* Forgot to update data files

todo: script should update all files at once

* Bump wynn version number

already outdated...

* Forgot to update 2.0.4.3 major ids

---------

Co-authored-by: hppeng <hppeng>
Co-authored-by: RawFish69 <108964215+RawFish69@users.noreply.github.com>

Add missing fields to ingreds

missing ids and consumableIDs tags in some ingreds

Fix missing properties in item search setup

these should be unified maybe to avoid duplicated code

Fix sacshrine dependency on fluid healing

also: fix ": " in item searcher

I managed to mess up all major ids

note: major ids min file is generated along with atree. it uses numeric ids, not just json compress

2.0.4.4 update (#269)

* 2.0.4.4 update

Fix v3 item api debug script
Implement hellfire (discombob disallow not happening yet)

* Fix boiling blood implementation

slightly more intuitive
also, janky first pass implementation for hellfire

* Atree default update

Allow sliders to specify a default value, for puppet and boiling blood for now

* Fix rainbow def

display on items and build stats
Calculate into raw def correctly

* Atree backend improvements

Allow major ids to have dependencies
Implement cherry bomb new ver. (wooo replace_spell just works out of the box!)
Add comments to atree.js

* Fix name of normal items

don't you love it when wynn api makes breaking changes for no reason

* Misc bugfix

Reckless abandon req Tempest
new damage ID in search

* Fix major id search

and temblor desc

* Fix blockers on mage

* Fix flaming uppercut implementation

* Force base dps display to display less digits

* Tomes finally pulling from the API

but still with alias feature enabled!

* Lootrun tomes (finally?)

cool? maybe?

* Fix beachside set set bonus

---------

Co-authored-by: hppeng <hppeng>

Fix rainbow def

display on items and build stats
Calculate into raw def correctly

Fix major id search

and temblor desc

Force base dps display to display less digits

Fix beachside set set bonus

Fix build decode error

reading only 7 tome fields no matter what

Give NONE tomes correct ids in load_tome

i hate this system so much

Allow searching for max/min of ranges

Fix crafted item damage display

in the process, also update powder calculation logic! Should be fully correct now...

TL;DR: Weapon damage is floating point; item display is wrong; ingame displays (damage floaters and compass) are floored.

Fluid healing now multiplicative with heal efficiency ID

NOTE: this breaks backwards compatibility with older atree jsons.
Do we care about this?

Realizing how much of a nightmare it will be (and already is) to keep
atree fully backwards compatible. Maybe that will be something left to
`git clone` instead.

fix (#274)
2024-07-07 05:19:16 -07:00

474 lines
11 KiB
JavaScript

let colorMap = new Map(
[
["Normal", "#fff"],
["Unique", "#ff5"],
["Rare","#f5f"],
["Legendary","#5ff"],
["Fabled","#f55"],
["Mythic","#a0a"],
["Crafted","#0aa"],
["Custom","#0aa"],
["Set","#5f5"]
]
);
let idPrefixes = {"displayName": "",
"lvl":"Combat Level Min: ",
"classReq":"Class Req: ",
"strReq":"Strength Min: ",
"dexReq":"Dexterity Min: ",
"intReq":"Intelligence Min: ",
"defReq":"Defense Min: ",
"agiReq":"Agility Min: ",
"nDam_":"Neutral Damage: ",
"eDam_":"Earth Damage: ",
"tDam_":"Thunder Damage: ",
"wDam_":"Water Damage: ",
"fDam_":"Fire Damage: ",
"aDam_":"Air Damage: ",
"atkSpd":"Attack Speed: ",
"hp":"Health : ",
"eDef":"Earth Defense: ",
"tDef":"Thunder Defense: ",
"wDef":"Water Defense: ",
"fDef":"Fire Defense: ",
"aDef":"Air Defense: ",
"str":"Strength: ",
"dex":"Dexterity: ",
"int":"Intelligence: ",
"def":"Defense: ",
"agi":"Agility: ",
"hpBonus":"Health Bonus: ",
"hprRaw":"Raw Health Regen: ",
"hprPct":"Health Regen %: ",
"healPct":"Healing Effectiveness %",
"sdRaw":"Spell Damage Raw: ",
"rSdRaw":"Elem. Spell Damage Raw: ",
"nSdRaw":"Neut. Spell Damage Raw: ",
"eSdRaw":"Earth Spell Damage Raw: ",
"tSdRaw":"Thunder Spell Damage Raw: ",
"wSdRaw":"Water Spell Damage Raw: ",
"fSdRaw":"Fire Spell Damage Raw: ",
"aSdRaw":"Air Spell Damage Raw: ",
"sdPct":"Spell Damage %: ",
"rSdPct":"Elem. Spell Damage %: ",
"nSdPct":"Neut. Spell Damage %: ",
"eSdPct":"Earth Spell Damage %: ",
"tSdPct":"Thunder Spell Damage %: ",
"wSdPct":"Water Spell Damage %: ",
"fSdPct":"Fire Spell Damage %: ",
"aSdPct":"Air Spell Damage %: ",
"mdRaw":"Melee Damage Raw: ",
"rMdRaw":"Elem. Melee Damage Raw: ",
"nMdRaw":"Neut. Melee Damage Raw: ",
"eMdRaw":"Earth Melee Damage Raw: ",
"tMdRaw":"Thunder Melee Damage Raw: ",
"wMdRaw":"Water Melee Damage Raw: ",
"fMdRaw":"Fire Melee Damage Raw: ",
"aMdRaw":"Air Melee Damage Raw: ",
"mdPct":"Melee Damage %: ",
"rMdPct":"Elem. Melee Damage %: ",
"nMdPct":"Neut. Melee Damage %: ",
"eMdPct":"Earth Melee Damage %: ",
"tMdPct":"Thunder Melee Damage %: ",
"wMdPct":"Water Melee Damage %: ",
"fMdPct":"Fire Melee Damage %: ",
"aMdPct":"Air Melee Damage %: ",
"damRaw":"Damage Raw: ",
"rDamRaw":"Elemental Damage Raw: ",
"nDamRaw":"Neutral Damage Raw: ",
"eDamRaw":"Earth Damage Raw: ",
"tDamRaw":"Thunder Damage Raw: ",
"wDamRaw":"Water Damage Raw: ",
"fDamRaw":"Fire Damage Raw: ",
"aDamRaw":"Air Damage Raw: ",
"damPct":"Damage %: ",
"rDamPct":"Elemental Damage %: ",
"nDamPct":"Neutral Damage %: ",
"eDamPct":"Earth Damage %: ",
"tDamPct":"Thunder Damage %: ",
"wDamPct":"Water Damage %: ",
"fDamPct":"Fire Damage %: ",
"aDamPct":"Air Damage %: ",
"mr":"Mana Regen: ",
"ms":"Mana Steal: ",
"ref":"Reflection: ",
"ls":"Life Steal: ",
"poison":"Poison: ",
"thorns":"Thorns: ",
"expd":"Exploding: ",
"spd":"Walk Speed Bonus: ",
"atkTier":"Attack Speed Bonus: ",
"eDefPct":"Earth Defense %: ",
"tDefPct":"Thunder Defense %: ",
"wDefPct":"Water Defense %: ",
"fDefPct":"Fire Defense %: ",
"aDefPct":"Air Defense %: ",
"rDefPct":"Elemental Defense %: ",
"spPct1":"1st Spell Cost %: ",
"spRaw1":"1st Spell Cost Raw: ",
"spPct2":"2nd Spell Cost %: ",
"spRaw2":"2nd Spell Cost Raw: ",
"spPct3":"3rd Spell Cost %: ",
"spRaw3":"3rd Spell Cost Raw: ",
"spPct4":"4th Spell Cost %: ",
"spRaw4":"4th Spell Cost Raw: ",
"sprint":"Sprint Bonus: ",
"sprintReg":"Sprint Regen Bonus: ",
"jh":"Jump Height: ",
"xpb":"Combat XP Bonus: ",
"lb":"Loot Bonus: ",
"lq":"Loot Quality: ",
"spRegen":"Soul Point Regen: ",
"eSteal":"Stealing: ",
"gXp":"Gathering XP Bonus: ",
"gSpd":"Gathering Speed Bonus: ",
"kb":"Knockback: ",
"weakenEnemy":"Weaken Enemy: ",
"slowEnemy":"Slow Enemy: ",
"slots":"Powder Slots: ",
"set":"Set: ",
"quest":"Quest Req: ",
"restrict":"",
"lore": ""
};
let idSuffixes = {"displayName": "",
"lvl":"",
"classReq":"",
"strReq":"",
"dexReq":"",
"intReq":"",
"defReq":"",
"agiReq":"",
"nDam_":"",
"eDam_":"",
"tDam_":"",
"wDam_":"",
"fDam_":"",
"aDam_":"",
"atkSpd":"",
"hp":"",
"eDef":"",
"tDef":"",
"wDef":"",
"fDef":"",
"aDef":"",
"str":"",
"dex":"",
"int":"",
"def":"",
"agi":"",
"hpBonus":"",
"hprRaw":"",
"hprPct":"%",
"healPct":"%",
"sdRaw":"",
"rSdRaw":"",
"nSdRaw":"",
"eSdRaw":"",
"tSdRaw":"",
"wSdRaw":"",
"fSdRaw":"",
"aSdRaw":"",
"sdPct":"%",
"rSdPct":"%",
"nSdPct":"%",
"eSdPct":"%",
"tSdPct":"%",
"wSdPct":"%",
"fSdPct":"%",
"aSdPct":"%",
"mdRaw":"",
"rMdRaw":"",
"nMdRaw":"",
"eMdRaw":"",
"tMdRaw":"",
"wMdRaw":"",
"fMdRaw":"",
"aMdRaw":"",
"mdPct":"%",
"rMdPct":"%",
"nMdPct":"%",
"eMdPct":"%",
"tMdPct":"%",
"wMdPct":"%",
"fMdPct":"%",
"aMdPct":"%",
"damRaw":"",
"rDamRaw":"",
"nDamRaw":"",
"eDamRaw":"",
"tDamRaw":"",
"wDamRaw":"",
"fDamRaw":"",
"aDamRaw":"",
"damPct":"%",
"rDamPct":"%",
"nDamPct":"%",
"eDamPct":"%",
"tDamPct":"%",
"wDamPct":"%",
"fDamPct":"%",
"aDamPct":"%",
"mr":"/5s",
"ms":"/3s",
"ref":"%",
"ls":"/3s",
"poison":"/3s",
"thorns":"%",
"expd":"%",
"spd":"%",
"atkTier":" tier",
"eDefPct":"%",
"tDefPct":"%",
"wDefPct":"%",
"fDefPct":"%",
"aDefPct":"%",
"rDefPct":"%",
"spPct1":"%",
"spRaw1":"",
"spPct2":"%",
"spRaw2":"",
"spPct3":"%",
"spRaw3":"",
"spPct4":"%",
"spRaw4":"",
"sprint":"%",
"sprintReg":"%",
"jh":"",
"xpb":"%",
"lb":"%",
"lq":"%",
"spRegen":"%",
"eSteal":"%",
"gXp":"%",
"gSpd":"%",
"kb": "%",
"weakenEnemy": "%",
"slowEnemy": "%",
"slots":"",
"set":" set.",
"quest":"",
"restrict":"",
"lore": "",
};
//Used for item IDs and ingredient id field IDs
//Used for ingredient IDs - name, lvl, tier. As of now, not used.
/*let ingPrefixes = {"name": "", "lvl": "", "tier": ""};
let ingSuffixes = {"name": "", "lvl": "", "tier": ""}*/
//Used for ingredient consumableIDs
let consumableIDPrefixes = {
"charges": "Charges: ",
"dura": "Duration: "
}
let consumableIDSuffixes = {
"charges": "",
"dura": " sec."
}
//Used for ingredient itemIDs
let itemIDPrefixes = {
"dura": "Durability: ",
"strReq": "Strength Min: ",
"dexReq": "Dexterity Min: ",
"intReq": "Intelligence Min: ",
"defReq": "Defense Min: ",
"agiReq": "Agility Min: "
}
//Used for ingredient posMods IDs
let posModPrefixes = {
"left":"Effectiveness Left: ",
"right":"Effectiveness Right: ",
"above":"Effectiveness Above: ",
"under":"Effectiveness Under: ",
"touching":"Effectiveness Touching: ",
"notTouching":"Effectiveness Not Touching: "
}
let posModSuffixes = {
"left":"%",
"right":"%",
"above":"%",
"under":"%",
"touching":"%",
"notTouching":"%"
}
/*
* Display commands
*/
let build_overall_display_commands = [
"#defense-stats",
"str", "dex", "int", "def", "agi",
"!spacer",
"mr", "ms",
"ls",
"poison",
"ref", "thorns",
"expd",
"spd",
"sprint", "sprintReg",
"jh",
"xpb", "lb", "lq",
"spRegen",
"eSteal",
"gXp", "gSpd",
"kb", "weakenEnemy", "slowEnemy",
];
let build_detailed_display_commands = [
"#defense-stats",
"str", "dex", "int", "def", "agi",
"!spacer",
"mr", "ms",
"hprRaw", "hprPct", "healPct",
"ls",
"sdRaw", "nSdRaw", "rSdRaw",
"sdPct", "nSdPct", "rSdPct",
"mdRaw", "nMdRaw", "rMdRaw",
"mdPct", "nMdPct", "rMdPct",
"damRaw", "nDamRaw", "rDamRaw",
"damPct", "nDamPct", "rDamPct",
"!elemental",
"fSdRaw", "wSdRaw", "aSdRaw", "tSdRaw", "eSdRaw",
"fSdPct", "wSdPct", "aSdPct", "tSdPct", "eSdPct",
"fMdRaw", "wMdRaw", "aMdRaw", "tMdRaw", "eMdRaw",
"fMdPct", "wMdPct", "aMdPct", "tMdPct", "eMdPct",
"fDamRaw", "wDamRaw", "aDamRaw", "tDamRaw", "eDamRaw",
"fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct",
"fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct",
"!elemental",
"rDefPct",
"spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4",
"atkTier",
"poison",
"ref", "thorns",
"expd",
"spd",
"rSdRaw",
"sprint", "sprintReg",
"jh",
"xpb", "lb", "lq",
"spRegen",
"eSteal",
"gXp", "gSpd",
"kb", "weakenEnemy", "slowEnemy",
];
// full
//"#defense-stats",
//"str", "dex", "int", "def", "agi",
//"!spacer",
//"mr", "ms",
//"hprRaw", "hprPct",
//"ls",
//"sdRaw", "sdPct",
//"mdRaw", "mdPct",
//"!elemental",
//"fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct",
//"!elemental",
//"spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4",
//"atkTier",
//"poison",
//"ref", "thorns",
//"expd",
//"spd",
//"rainbowRaw",
//"sprint", "sprintReg",
//"jh",
//"xpb", "lb", "lq",
//"spRegen",
//"eSteal",
//"gXp", "gSpd",
let build_basic_display_commands = [
'#defense-stats',
// defense stats [hp, ehp, hpr, ]
// "sPot", // base * atkspd + spell raws
// melee potential
// "mPot", // melee% * (base * atkspd) + melee raws
"mr", "ms",
"ls",
"poison",
"spd",
"atkTier",
]
let sq2_item_display_commands = [
"displayName",
"atkSpd",
"!elemental",
"hp",
"nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_",
"!spacer",
"fDef", "wDef", "aDef", "tDef", "eDef",
"!elemental",
"classReq",
"lvl",
"strReq", "dexReq", "intReq", "defReq","agiReq",
"!spacer",
"str", "dex", "int", "def", "agi",
"hpBonus",
"hprRaw", "hprPct", "healPct",
"mr", "ms",
"ref", "thorns",
"ls",
"poison",
"expd",
"spd",
"atkTier",
"sdRaw", "nSdRaw", "rSdRaw",
"sdPct", "nSdPct", "rSdPct",
"mdRaw", "nMdRaw", "rMdRaw",
"mdPct", "nMdPct", "rMdPct",
"damRaw", "nDamRaw", "rDamRaw",
"damPct", "nDamPct", "rDamPct",
"!elemental",
"fSdRaw", "wSdRaw", "aSdRaw", "tSdRaw", "eSdRaw",
"fSdPct", "wSdPct", "aSdPct", "tSdPct", "eSdPct",
"fMdRaw", "wMdRaw", "aMdRaw", "tMdRaw", "eMdRaw",
"fMdPct", "wMdPct", "aMdPct", "tMdPct", "eMdPct",
"fDamRaw", "wDamRaw", "aDamRaw", "tDamRaw", "eDamRaw",
"fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct",
"fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct",
"!elemental",
"rDefPct",
"spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4",
"sprint", "sprintReg",
"jh",
"xpb", "lb", "lq",
"spRegen",
"eSteal",
"gXp", "gSpd",
"kb", "weakenEnemy", "slowEnemy",
"majorIds",
"!spacer",
"slots",
"!spacer",
"set",
"lore",
"quest",
"restrict",
];
let sq2_ing_display_order = [
"displayName", //tier will be displayed w/ name
"!spacer",
"ids",
"!spacer",
"posMods",
"itemIDs",
"consumableIDs",
"!spacer",
"lvl",
"skills",
]
let elem_colors = [
"#00AA00",
"#FFFF55",
"#55FFFF",
"#FF5555",
"#FFFFFF"
]