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

Handle invalid choices (e.g. trapping) #5

Closed
taylorhansen opened this issue Feb 17, 2019 · 0 comments
Closed

Handle invalid choices (e.g. trapping) #5

taylorhansen opened this issue Feb 17, 2019 · 0 comments
Assignees

Comments

@taylorhansen
Copy link
Owner

taylorhansen commented Feb 17, 2019

Certain abilities keep the opponent from being able to switch, but is only partially revealed when the opponent tries to switch out.

Sample:

<< |request|{...(in RequestPokemon obj: maybeTrapped=true)}
>> /choose switch 2
<< |callback|trapped|0
<< |error|[Invalid choice] Can't switch: The active Pokémon is trapped

Parse the |callback| message and send it to the Battle instance so it can use that info to send a new Choice. The network won't need to know whether its choices are restricted, since it already ranks all of its available choices.

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

No branches or pull requests

1 participant