pmariglia / showdown

A Pokemon Showdown Battle Bot written in Python
GNU General Public License v3.0
257 stars 175 forks source link

Get the adversary team #48

Closed Andyloris closed 3 years ago

Andyloris commented 3 years ago

Is there any ways to get the adversary team ?

Thanks in advance

hsahovic commented 3 years ago

Hi @Andyloris,

If I understand your question correctly, the answer is yes: you can access battle.opponent_team, which is a dictionary whose values are Pokemon objects representing the opponent's team.

Andyloris commented 3 years ago

ok thanks !

hsahovic commented 3 years ago

@Andyloris I just realized that I mistakenly responded to this issue, thinking it was opened in another similar repo - sorry about that, I didn't pay sufficient attention to the notification.

I think that you can use battle.opponent.reserve which should be a list quite similar to what I described above, but you'd want @pmariglia to confirm that.

pmariglia commented 3 years ago

Hi, sorry I just saw this now.

@hsahovic is correct that if you are interfacing with the battle object then the opponent's team is battle.opponent.reserve. If you are interfacing with the state object, then similarly it is state.opponent.reserve. (the state is part of the engine, and separate from the battle that is used to track the showdown battle)

If you need further clarification please feel free to re-open this and ask, thanks.