mirror of
https://github.com/mhwikicn/mhdos-armor-set-searcher
synced 2025-12-06 13:39:03 +08:00
account for torso up in get-skills script
This commit is contained in:
parent
9d7f1c8e22
commit
eb67470b6e
@ -21,13 +21,17 @@ if __name__ == "__main__":
|
|||||||
for (id, skill) in enumerate(skills):
|
for (id, skill) in enumerate(skills):
|
||||||
# get attributes
|
# get attributes
|
||||||
name = skill["name"]
|
name = skill["name"]
|
||||||
if name == "Torso Up": continue # special case for torso up
|
|
||||||
category = 0
|
category = 0
|
||||||
|
|
||||||
# init skill map and skill names map
|
# init skill map and skill names map
|
||||||
acts = []
|
acts = []
|
||||||
skill_names[id] = name
|
skill_names[id] = name
|
||||||
|
|
||||||
|
# handle torso up
|
||||||
|
if name == "Torso Up":
|
||||||
|
skill_activations[id] = []
|
||||||
|
continue
|
||||||
|
|
||||||
# iterate over activations of this skill
|
# iterate over activations of this skill
|
||||||
for activation in skill["stagesFormatted"]:
|
for activation in skill["stagesFormatted"]:
|
||||||
# bump activations id
|
# bump activations id
|
||||||
@ -39,8 +43,8 @@ if __name__ == "__main__":
|
|||||||
is_positive = bool(points > 0)
|
is_positive = bool(points > 0)
|
||||||
a_name = clean_name(activation["name"])
|
a_name = clean_name(activation["name"])
|
||||||
|
|
||||||
# build object and push object
|
# model and push object
|
||||||
build_activation = {
|
modeled_activation = {
|
||||||
"category": category,
|
"category": category,
|
||||||
"id": a_id,
|
"id": a_id,
|
||||||
"isPositive": is_positive,
|
"isPositive": is_positive,
|
||||||
@ -48,12 +52,12 @@ if __name__ == "__main__":
|
|||||||
"requiredPoints": points,
|
"requiredPoints": points,
|
||||||
"requiredSkill": id,
|
"requiredSkill": id,
|
||||||
}
|
}
|
||||||
acts.append(build_activation)
|
acts.append(modeled_activation)
|
||||||
|
|
||||||
# reverse acts (positive acts should be first) and append to map
|
# reverse acts (positive acts should be first) and append to map
|
||||||
acts.reverse()
|
acts.reverse()
|
||||||
skill_activations[id] = acts
|
skill_activations[id] = acts
|
||||||
|
|
||||||
# save files
|
# save files
|
||||||
with open("../data/skills.json", "w") as f:
|
with open("../data/skills.json", "w") as f:
|
||||||
f.write(json.dumps(skill_activations, indent=4))
|
f.write(json.dumps(skill_activations, indent=4))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user