track knockouts

This commit is contained in:
xeals 2023-03-27 21:51:50 +11:00
parent 83093f8c81
commit 5f9ae3e145
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C

12
main.py
View File

@ -114,6 +114,18 @@ def parse_log(game: str, log: str, into: sqlite3.Connection):
""",
(game, player, name, specie.split(", ")[0]),
)
case ["faint", mon]:
player, mon = resolve_mon(mon)
conn.execute(
"""
INSERT INTO knockouts(game, turn, player, name)
VALUES(?, ?, ?, ?)
ON CONFLICT DO NOTHING
""",
(game, turn, player, mon),
)
case _:
debug(f"unhandled message {chunks[0]}")
@dataclass(frozen=True)