pattern match indirect knockouts specifically
This commit is contained in:
parent
25b80a71a1
commit
7138482b88
8
main.py
8
main.py
@ -207,12 +207,10 @@ def parse_log(game: str, log: str, into: sqlite3.Connection):
|
||||
LOG.debug(f"{line} <- {last_move}")
|
||||
last_status_set[(mon, cond)] = last_move[0]
|
||||
|
||||
case ["-damage", mon, *rest]:
|
||||
# rest is new_hp and sometimes a source (if not from a move)
|
||||
# in a knockout, new_hp is "0 fnt"
|
||||
if rest[0] == "0 fnt" and len(rest) > 1:
|
||||
case ["-damage", mon, "0 fnt", from_]:
|
||||
# mon has fainted from an indirect damage source
|
||||
LOG.debug(f"tracing source for {line}")
|
||||
source = rest[1].replace("[from] ", "")
|
||||
source = from_.replace("[from] ", "")
|
||||
source_user = None
|
||||
|
||||
test_hazard = last_env_set.get((mon[0:1], source))
|
||||
|
Loading…
Reference in New Issue
Block a user