Skip to content

Commit

Permalink
Handle magician in item messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hsahovic committed Dec 10, 2024
1 parent 9f85fa1 commit 524b047
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/poke_env/environment/abstract_battle.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,16 @@ def parse_message(self, split_message: List[str]):
item = event[3]

self.get_pokemon(pickpocket).item = to_id_str(item)
self.get_pokemon(pickpocket).ability = to_id_str(
cause.replace("[from] ability: ", "")
)
self.get_pokemon(pickpocket).ability = to_id_str("pickpocket")
self.get_pokemon(pickpocketed).item = None
elif cause == "[from] ability: Magician":
magician = event[2]
victim = event[5].replace("[of] ", "")
item = event[3]

self.get_pokemon(magician).item = to_id_str(item)
self.get_pokemon(magician).ability = to_id_str("magician")
self.get_pokemon(victim).item = None
elif cause in {"[from] move: Thief"}:
thief = event[2]
victim = event[5].replace("[of] ", "")
Expand Down

0 comments on commit 524b047

Please sign in to comment.