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

Create a 'Switched Out' state and separate switching out from switching in #10912

Open
andrebastosdias opened this issue Feb 16, 2025 · 0 comments

Comments

@andrebastosdias
Copy link
Contributor

andrebastosdias commented Feb 16, 2025

Usually, when a Pokémon switches out (without fainting), a switch request is triggered immediately. However, there is at least one case where this does not happen: if a Pokémon's Emergency Exit ability activates in the middle of a so-called fieldEvent—which includes switch-ins and residual effects. In this case, the entire fieldEvent sequence completes before the player has the opportunity to switch in another Pokémon.

This leads to some strange mechanics. For example, if a Pokémon leaves the field during switch-ins, Intimidate will not lower that Pokémon's Attack, but the ability message will still be displayed. Essentially, the Pokémon in that slot is still considered active (as indicated in-game if you attempt to switch in the Emergency Exit Pokémon again), but it is completely immune to everything—damage, healing, stat changes, status conditions, non-volatile statuses, item changes, ability changes, etc.

Some mechanics still need to be tested. For example, in a doubles battle, does Imposter fail or does it transform into the other opponent's Pokémon?

This is also a good excuse to finally separate the action of switching out from the action of switching in, as the Emergency Exit Pokémon should leave the field immediately, only being replaced at the end of the fieldEvent. Additionally, abilities like Neutralizing Gas and Primordial Sea should deactivate after the user leaves the field, and moves like U-turn should make the Pokémon leave the field before allowing the player to choose the switch-in (which is mostly client-relevant).

I would like to start working on this after this PR #10902 gets merged, as it already addresses some mechanics, such as the Emergency Exit skipping other events during the fieldEvent sequence. It also includes the Intimidate test above.

If anyone remembers other relevant cases, feel free to share!

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