|
@@ -1,7 +1,6 @@
|
|
|
import io
|
|
|
import math
|
|
|
import itertools
|
|
|
-from multiprocessing import Pool
|
|
|
import multiprocessing
|
|
|
from typing import Callable, NamedTuple
|
|
|
|
|
@@ -24,8 +23,8 @@ start_with_filters = [
|
|
|
# no significant visual changes
|
|
|
"arceus-", "silvally-", "genesect-", "pumpkaboo-", "gourgeist-", "unown-", "giratina-",
|
|
|
# cannot start the battle in alternate form
|
|
|
- "castform-", "cherrim-", "aegislash-", "xerneas-", "wishiwashi-", "eiscue-", "mimikyu-",
|
|
|
- "cramorant-", "morepeko-",
|
|
|
+ "castform-", "cherrim-", "aegislash-", "xerneas-", "wishiwashi-",
|
|
|
+ "eiscue-", "mimikyu-", "cramorant-", "morpeko-",
|
|
|
# weird event thing
|
|
|
"greninja-", "eevee-", "pikachu-", "zarude-", "magearna-",
|
|
|
# pokestars
|
|
@@ -42,8 +41,6 @@ end_with_filters = [
|
|
|
full_filters = [
|
|
|
# darmanitan zen forms (cannot start in zen)
|
|
|
"darmanitan-galarzen.gif", "darmanitan-zen.gif",
|
|
|
- # morpeko hangry (cannot start hangry)
|
|
|
- "morpeko-hangry.gif",
|
|
|
# minior core forms (cannot start in anything but -meteor, renamed below)
|
|
|
"minior.gif", "minior-blue.gif", "minior-green.gif", "minior-indigo.gif",
|
|
|
"minior-orange.gif", "minior-violet.gif", "minior-yellow.gif",
|
|
@@ -279,19 +276,20 @@ if __name__ == "__main__":
|
|
|
print("Found", len(pkmn), "sprites...")
|
|
|
errors = []
|
|
|
|
|
|
- def ingest_and_format(name: str) -> str:
|
|
|
+ def ingest_and_format(pair: tuple[int, str]) -> str:
|
|
|
+ index, name = pair
|
|
|
try:
|
|
|
- print(f"Ingesting {name}...")
|
|
|
+ print(f"Ingesting #{index+1}: {name}...")
|
|
|
stats = get_stats(name)
|
|
|
format_name = rename.get(name, name)
|
|
|
- print(f"Finished {name}, saving under {format_name}")
|
|
|
+ print(f"Finished #{index+1}: {name}, saving under {format_name}")
|
|
|
return f' [ "{format_name}", {", ".join(str(n) for n in stats)} ],\n'
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
errors.append((name, e))
|
|
|
|
|
|
with multiprocessing.Pool(4) as pool:
|
|
|
- stats = sorted(pool.imap_unordered(ingest_and_format, pkmn, 100))
|
|
|
+ stats = sorted(pool.imap_unordered(ingest_and_format, enumerate(pkmn), 100))
|
|
|
|
|
|
print(f"Calculated {len(stats)} statistics, writing...")
|
|
|
|