Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions Resources/scripts/data/gen8/ability_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@
# data_path contains the countents of the `message` folder found in sword/shield's romfs:/bin/
if __name__ == "__main__":
path = os.path.abspath(os.path.dirname(__file__))
data_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "..", "data")
csv_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "pokedex", "data", "csv")
data_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "..", "data"
)
csv_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
"..",
"..",
"..",
"pokedex",
"data",
"csv",
)

languages = {
"JPN": 1,
Expand All @@ -25,13 +35,17 @@
entries = []

# conquest abilities
with open(os.path.join(csv_path, "ability_names.csv"), "r", encoding="utf-8", newline="") as csv_file:
with open(
os.path.join(csv_path, "ability_names.csv"), "r", encoding="utf-8", newline=""
) as csv_file:
reader = csv.reader(csv_file, delimiter=",")
for row in reader:
if row[0].isnumeric() and int(row[0]) > 10000:
entries.append([int(row[0]), int(row[1]), row[2]])

with open(os.path.join(csv_path, "ability_names.csv"), "w", encoding="utf-8", newline="") as csv_file:
with open(
os.path.join(csv_path, "ability_names.csv"), "w", encoding="utf-8", newline=""
) as csv_file:
writer = csv.writer(csv_file, delimiter=",", lineterminator="\n")
for language_dir, language_id in languages.items():
try:
Expand Down
22 changes: 18 additions & 4 deletions Resources/scripts/data/gen8/move_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@
# data_path contains the countents of the `message` folder found in sword/shield's romfs:/bin/
if __name__ == "__main__":
path = os.path.abspath(os.path.dirname(__file__))
data_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "..", "data")
csv_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "pokedex", "data", "csv")
data_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "..", "data"
)
csv_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
"..",
"..",
"..",
"pokedex",
"data",
"csv",
)

languages = {
"JPN": 1,
Expand All @@ -25,13 +35,17 @@
entries = []

# shadow moves
with open(os.path.join(csv_path, "move_names.csv"), "r", encoding="utf-8", newline="") as csv_file:
with open(
os.path.join(csv_path, "move_names.csv"), "r", encoding="utf-8", newline=""
) as csv_file:
reader = csv.reader(csv_file, delimiter=",")
for row in reader:
if row[0].isnumeric() and int(row[0]) > 10000:
entries.append([int(row[0]), int(row[1]), row[2]])

with open(os.path.join(csv_path, "move_names.csv"), "w", encoding="utf-8", newline="") as csv_file:
with open(
os.path.join(csv_path, "move_names.csv"), "w", encoding="utf-8", newline=""
) as csv_file:
writer = csv.writer(csv_file, delimiter=",", lineterminator="\n")
for language_dir, language_id in languages.items():
try:
Expand Down
Loading