fix: separate atree ids for each class
This commit is contained in:
parent
b4172744e1
commit
b36b16c49d
5 changed files with 412 additions and 239 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
146
js/atree_ids.json
Normal file
146
js/atree_ids.json
Normal file
|
@ -0,0 +1,146 @@
|
|||
{
|
||||
"Archer": {
|
||||
"Arrow Shield": 0,
|
||||
"Escape": 1,
|
||||
"Arrow Bomb": 2,
|
||||
"Heart Shatter": 3,
|
||||
"Fire Creep": 4,
|
||||
"Bryophyte Roots": 5,
|
||||
"Nimble String": 6,
|
||||
"Arrow Storm": 7,
|
||||
"Guardian Angels": 8,
|
||||
"Windy Feet": 9,
|
||||
"Basaltic Trap": 10,
|
||||
"Windstorm": 11,
|
||||
"Grappling Hook": 12,
|
||||
"Implosion": 13,
|
||||
"Twain's Arc": 14,
|
||||
"Fierce Stomp": 15,
|
||||
"Scorched Earth": 16,
|
||||
"Leap": 17,
|
||||
"Shocking Bomb": 18,
|
||||
"Mana Trap": 19,
|
||||
"Escape Artist": 20,
|
||||
"Initiator": 21,
|
||||
"Call of the Hound": 22,
|
||||
"Arrow Hurricane": 23,
|
||||
"Geyser Stomp": 24,
|
||||
"Crepuscular Ray": 25,
|
||||
"Grape Bomb": 26,
|
||||
"Tangled Traps": 27,
|
||||
"Snow Storm": 28,
|
||||
"All-Seeing Panoptes": 29,
|
||||
"Minefield": 30,
|
||||
"Bow Proficiency I": 31,
|
||||
"Cheaper Arrow Bomb": 32,
|
||||
"Cheaper Arrow Storm": 33,
|
||||
"Cheaper Escape": 34,
|
||||
"Earth Mastery": 35,
|
||||
"Thunder Mastery": 36,
|
||||
"Water Mastery": 37,
|
||||
"Air Mastery": 38,
|
||||
"Fire Mastery": 39,
|
||||
"More Shields": 40,
|
||||
"Stormy Feet": 41,
|
||||
"Refined Gunpowder": 42,
|
||||
"More Traps": 43,
|
||||
"Better Arrow Shield": 44,
|
||||
"Better Leap": 45,
|
||||
"Better Guardian Angels": 46,
|
||||
"Cheaper Arrow Storm (2)": 47,
|
||||
"Precise Shot": 48,
|
||||
"Cheaper Arrow Shield": 49,
|
||||
"Rocket Jump": 50,
|
||||
"Cheaper Escape (2)": 51,
|
||||
"Stronger Hook": 52,
|
||||
"Cheaper Arrow Bomb (2)": 53,
|
||||
"Bouncing Bomb": 54,
|
||||
"Homing Shots": 55,
|
||||
"Shrapnel Bomb": 56,
|
||||
"Elusive": 57,
|
||||
"Double Shots": 58,
|
||||
"Triple Shots": 59,
|
||||
"Power Shots": 60,
|
||||
"Focus": 61,
|
||||
"More Focus": 62,
|
||||
"More Focus (2)": 63,
|
||||
"Traveler": 64,
|
||||
"Patient Hunter": 65,
|
||||
"Stronger Patient Hunter": 66,
|
||||
"Frenzy": 67,
|
||||
"Phantom Ray": 68,
|
||||
"Arrow Rain": 69,
|
||||
"Decimator": 70
|
||||
},
|
||||
"Warrior": {
|
||||
"Bash": 0,
|
||||
"Spear Proficiency 1": 1,
|
||||
"Cheaper Bash": 2,
|
||||
"Double Bash": 3,
|
||||
"Charge": 4,
|
||||
"Heavy Impact": 5,
|
||||
"Vehement": 6,
|
||||
"Tougher Skin": 7,
|
||||
"Uppercut": 8,
|
||||
"Cheaper Charge": 9,
|
||||
"War Scream": 10,
|
||||
"Earth Mastery": 11,
|
||||
"Thunder Mastery": 12,
|
||||
"Water Mastery": 13,
|
||||
"Air Mastery": 14,
|
||||
"Fire Mastery": 15,
|
||||
"Quadruple Bash": 16,
|
||||
"Fireworks": 17,
|
||||
"Half-Moon Swipe": 18,
|
||||
"Flyby Jab": 19,
|
||||
"Flaming Uppercut": 20,
|
||||
"Iron Lungs": 21,
|
||||
"Generalist": 22,
|
||||
"Counter": 23,
|
||||
"Mantle of the Bovemists": 24,
|
||||
"Bak'al's Grasp": 25,
|
||||
"Spear Proficiency 2": 26,
|
||||
"Cheaper Uppercut": 27,
|
||||
"Aerodynamics": 28,
|
||||
"Provoke": 29,
|
||||
"Precise Strikes": 30,
|
||||
"Air Shout": 31,
|
||||
"Enraged Blow": 32,
|
||||
"Flying Kick": 33,
|
||||
"Stronger Mantle": 34,
|
||||
"Manachism": 35,
|
||||
"Boiling Blood": 36,
|
||||
"Ragnarokkr": 37,
|
||||
"Ambidextrous": 38,
|
||||
"Burning Heart": 39,
|
||||
"Stronger Bash": 40,
|
||||
"Intoxicating Blood": 41,
|
||||
"Comet": 42,
|
||||
"Collide": 43,
|
||||
"Rejuvenating Skin": 44,
|
||||
"Uncontainable Corruption": 45,
|
||||
"Radiant Devotee": 46,
|
||||
"Whirlwind Strike": 47,
|
||||
"Mythril Skin": 48,
|
||||
"Armour Breaker": 49,
|
||||
"Shield Strike": 50,
|
||||
"Sparkling Hope": 51,
|
||||
"Massive Bash": 52,
|
||||
"Tempest": 53,
|
||||
"Spirit of the Rabbit": 54,
|
||||
"Massacre": 55,
|
||||
"Axe Kick": 56,
|
||||
"Radiance": 57,
|
||||
"Cheaper Bash 2": 58,
|
||||
"Cheaper War Scream": 59,
|
||||
"Discombobulate": 60,
|
||||
"Thunderclap": 61,
|
||||
"Cyclone": 62,
|
||||
"Second Chance": 63,
|
||||
"Blood Pact": 64,
|
||||
"Haemorrhage": 65,
|
||||
"Brink of Madness": 66,
|
||||
"Cheaper Uppercut 2": 67,
|
||||
"Martyr": 68
|
||||
}
|
||||
}
|
29
py_script/atree-convertID.py
Normal file
29
py_script/atree-convertID.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""
|
||||
Generate a JSON Ability Tree [atree_constants_idfied.json] with:
|
||||
- All references replaced by numerical IDs
|
||||
given a JSON Ability Tree with reference as string AND a JSON Ability Names to IDs.
|
||||
"""
|
||||
import json
|
||||
|
||||
# Ability names to IDs data
|
||||
with open("atree_ids.json") as f:
|
||||
id_data = json.loads(f.read())
|
||||
|
||||
# Ability tree data with reference as string
|
||||
with open("atree_constants.json") as f:
|
||||
atree_data = json.loads(f.read())
|
||||
|
||||
for _class, info in atree_data.items():
|
||||
for abil in range(len(info)):
|
||||
info[abil]["id"] = id_data[_class][info[abil]["display_name"]]
|
||||
for ref in range(len(info[abil]["parents"])):
|
||||
info[abil]["parents"][ref] = id_data[_class][info[abil]["parents"][ref]]
|
||||
|
||||
for ref in range(len(info[abil]["dependencies"])):
|
||||
info[abil]["dependencies"][ref] = id_data[_class][info[abil]["dependencies"][ref]]
|
||||
|
||||
for ref in range(len(info[abil]["blockers"])):
|
||||
info[abil]["blockers"][ref] = id_data[_class][info[abil]["blockers"][ref]]
|
||||
|
||||
with open('atree_constants_idfied.json', 'w', encoding='utf-8') as abil_dest:
|
||||
json.dump(atree_data, abil_dest, ensure_ascii=False, indent=4)
|
|
@ -1,37 +1,35 @@
|
|||
"""
|
||||
Generate a JSON Ability Tree with:
|
||||
Generate a JSON Ability Tree [atree_constants_id.json] with:
|
||||
- All references replaced by numerical IDs
|
||||
- Extra JSON File with Original name as key and Assigned IDs as value.
|
||||
given a JSON Ability Tree.
|
||||
- Extra JSON File with Class: [Original name as key and Assigned IDs as value].
|
||||
given a JSON Ability Tree with reference as string.
|
||||
"""
|
||||
import json
|
||||
|
||||
id = 0
|
||||
abilDict = {}
|
||||
with open("atree-parse.json") as f:
|
||||
with open("atree_constants.json") as f:
|
||||
data = json.loads(f.read())
|
||||
for classType, info in data.items():
|
||||
#reset IDs for every class and start at 1
|
||||
id = 1
|
||||
_id = 0
|
||||
abilDict[classType] = {}
|
||||
for abil in info:
|
||||
abilDict[abil["display_name"]] = id
|
||||
id += 1
|
||||
abilDict[classType][abil["display_name"]] = _id
|
||||
_id += 1
|
||||
|
||||
with open("atree-ids.json", "w", encoding='utf-8') as id_dest:
|
||||
with open("atree_ids.json", "w", encoding='utf-8') as id_dest:
|
||||
json.dump(abilDict, id_dest, ensure_ascii=False, indent=4)
|
||||
|
||||
for classType, info in data.items():
|
||||
for abil in range(len(info)):
|
||||
info[abil]["id"] = abilDict[info[abil]["display_name"]]
|
||||
info[abil]["id"] = abilDict[classType][info[abil]["display_name"]]
|
||||
for ref in range(len(info[abil]["parents"])):
|
||||
info[abil]["parents"][ref] = abilDict[info[abil]["parents"][ref]]
|
||||
info[abil]["parents"][ref] = abilDict[classType][info[abil]["parents"][ref]]
|
||||
|
||||
for ref in range(len(info[abil]["dependencies"])):
|
||||
info[abil]["dependencies"][ref] = abilDict[info[abil]["dependencies"][ref]]
|
||||
info[abil]["dependencies"][ref] = abilDict[classType][info[abil]["dependencies"][ref]]
|
||||
|
||||
for ref in range(len(info[abil]["blockers"])):
|
||||
info[abil]["blockers"][ref] = abilDict[info[abil]["blockers"][ref]]
|
||||
data[classType] = info
|
||||
info[abil]["blockers"][ref] = abilDict[classType][info[abil]["blockers"][ref]]
|
||||
|
||||
with open('atree-constants-id.json', 'w', encoding='utf-8') as abil_dest:
|
||||
with open('atree_constants_id.json', 'w', encoding='utf-8') as abil_dest:
|
||||
json.dump(data, abil_dest, ensure_ascii=False, indent=4)
|
Loading…
Reference in a new issue