Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force_switch is forced before the events of a battle are processed #616

Open
caymansimpson opened this issue Oct 14, 2024 · 0 comments · May be fixed by #666
Open

force_switch is forced before the events of a battle are processed #616

caymansimpson opened this issue Oct 14, 2024 · 0 comments · May be fixed by #666

Comments

@caymansimpson
Copy link
Contributor

When we get a force_switch request, Showdown sends the request object and then the events of the turn that led up to that request afterwards. This isn't handled in poke-env, where we're forced to make a decision based on no information about what transpired earlier in the turn.

Here's a printout of the path of poke-env during execution:

in player._handle_battle_message [['>battle-gen9vgc2024regg-93'], ['', 'request', '{"forceSwitch":[false,true],"side":{"name":"elitefurretai","id":"p1","pokemon":[redacted for brevity],"noCancel":true,"rqid":6}']]
in player.handle_battle_request
in choose_move on turn #1; force_switch: [False, True].
in player._handle_battle_message [['>battle-gen9vgc2024regg-93'], ['', ''], ['', 't:', '1728869837'], ['', '-terastallize', 'p1b: Raichu', 'Ground'], ['', 'move', 'p1a: Delibird', 'Fake Out', 'p2a: Delibird'], ['', '-damage', 'p2a: Delibird', '83/100'], ['', 'move', 'p1b: Raichu', 'Volt Switch', 'p2b: Raichu'], ['', '-resisted', 'p2b: Raichu'], ['', '-damage', 'p2b: Raichu', '82/100']]```
@cameronangliss cameronangliss linked a pull request Dec 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant