hsahovic / poke-env

A python interface for training Reinforcement Learning bots to battle on pokemon showdown
https://poke-env.readthedocs.io/
MIT License
297 stars 100 forks source link

Hazard layer amount #110

Closed mancho1987 closed 3 years ago

mancho1987 commented 3 years ago

Hi,

How can I get the number of layers of each specific entry hazard?

hsahovic commented 3 years ago

Hi @mancho1987,

Thanks for opening this issue. Right now, this is not implemented. I will take a look at some relevant battle logs sometime this week and get back to you.

mancho1987 commented 3 years ago

Great, thanks :) Also, is there a way to get if the mon is locked into a move like outrage?

hsahovic commented 3 years ago

If your pokemon is locked into a move, Battle.available_switches will be empty and Battle.available_moves will only contain one move. Additionally, if showdown indicates that your pokemon is trapped, Battle.trapped will be True.

hsahovic commented 3 years ago

Version 0.4.7 takes care of counting SideCondition, which includes spikes, toxic spikes, and other similar moves.

Before 0.4.7, Battle.side_conditions and Battle.opponent_side_conditions were sets of SideCondition objects. Now, they are dicts whose values correspond to the number of layers in place. For instance, you can now use battle.opponent_side_conditions.get(SideCondition.SPIKES, 0) to get the number of spikes layers on your opponent's side of the battle