wynnbuilder-forked-for-changes/py_script/items_common.py
hppeng-wynn dec0a95279
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>
2024-05-31 00:54:23 -07:00

44 lines
1.4 KiB
Python

import json
with open("translate_mappings.json", 'r') as infile:
translate_mappings = json.load(infile)
delete_keys = [
#"addedLore",
#"skin",
#"armorType",
#"armorColor",
#"material"
]
if __name__ == "__main__":
# SELF TEST: compare dict keys with `item_metadata.json`.
from item_wrapper import Items
local_metadata_file = "item_metadata.json"
def debug(*args, **kwargs):
print(*args, **kwargs)
try:
debug("updating item metadata...")
metadata_check = Items().get_metadata()
with open(local_metadata_file, 'w') as outfile:
json.dump(metadata_check, outfile, indent=2)
except:
debug("Could not update item metadata. using local wynn metadata")
with open(local_metadata_file, 'r') as infile:
metadata_check = json.load(infile)
checklist = set(x for x in translate_mappings['identifications'].keys())
debug(f"Checking {len(checklist)} identifications")
n = 0
for identification in metadata_check['identifications']:
if identification in checklist:
checklist.remove(identification)
else:
print(f"WARNING: id not accounted for: {identification}")
n += 1
debug(f"{n} unmapped API identifications.")
for identification in checklist:
print(f"WARNING: unused translate map entry {identification}")
debug(f"{len(checklist)} unused translation entries.")