Skip to content

Commit

Permalink
2022/7/28 アンソロジー実装で動かなくなったのを改修
Browse files Browse the repository at this point in the history
  • Loading branch information
poslogithub committed Jul 27, 2022
1 parent 2130848 commit 701c31b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions script/generate_set_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def generate_set_map(loc, cards, enums, set_name):
else:
set_number = int(card["collectorNumber"])

grp_id = card["grpid"]
grp_id = card["grpId"]
abilities = []

abilities_raw = card["abilities"]
Expand Down Expand Up @@ -133,7 +133,7 @@ def generate_set_map(loc, cards, enums, set_name):
output_lines.append(new_card_str)

except Exception:
print("hit an error on {} / {} / {}".format(card["grpid"], loc_map[card["titleId"]], card["collectorNumber"]))
print("hit an error on {} / {} / {}".format(card["grpId"], loc_map[card["titleId"]], card["collectorNumber"]))
raise
header = """
import sys
Expand Down
22 changes: 11 additions & 11 deletions source/mtga/set_data/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def del_ruby(s):
else:
set_number = int(card["collectorNumber"])
except ValueError:
set_number = card["grpid"]
set_number = card["grpId"]

grp_id = card["grpid"]
grp_id = card["grpId"]
abilities = []

try:
Expand All @@ -194,10 +194,10 @@ def del_ruby(s):
try:
abilities_raw = card["abilities"]
except KeyError:
abilities_raw = []
for ability in abilities_raw:
aid = ability["Id"]
textid = ability.get("TextId")
abilities_raw = ""
for ability in abilities_raw.split(","):
aid = ability.split(":")[0]
textid = ability.split(":")[1] if len(ability.split(":")) >= 2 else None
text = ""
try:
if textid:
Expand All @@ -212,10 +212,10 @@ def del_ruby(s):
try:
hidden_abilities_raw = card["hiddenAbilities"]
except KeyError:
hidden_abilities_raw = []
for ability in hidden_abilities_raw:
aid = ability["Id"]
textid = ability.get("TextId")
hidden_abilities_raw = ""
for ability in hidden_abilities_raw.split(","):
aid = ability.split(":")[0]
textid = ability.split(":")[1] if len(ability.split(":")) >= 2 else None
text = ""
try:
if textid:
Expand All @@ -235,7 +235,7 @@ def del_ruby(s):
set_card_objs.append(new_card_obj)

except Exception:
print("hit an error on {} / {} / {}".format(card["grpid"], loc_map[card["titleId"]],
print("hit an error on {} / {} / {}".format(card["grpId"], loc_map[card["titleId"]],
card["collectorNumber"]))
raise
card_set_obj = Set(set_name_class_cased, cards=set_card_objs)
Expand Down

0 comments on commit 701c31b

Please sign in to comment.