-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix: Protean + Neutralizing Gas interaction #10805
Fix: Protean + Neutralizing Gas interaction #10805
Conversation
data/abilities.ts
Outdated
@@ -2875,6 +2875,12 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { | |||
} | |||
} | |||
}, | |||
onAnySwitchIn(pokemon) { | |||
if (this.event.target === pokemon && ['libero', 'protean'].includes(pokemon.getAbility().id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best or standard way to check if this is the Pokémon switching in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you're asking but pokemon
will always be the Pokémon switching in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong, but I'm pretty sure that when a switch occurs, onAnySwitchIn
is called for every active Pokémon and pokemon
does not refer to the Pokémon switching in.
I wanted to know if this.event.target
is the best way to access the switching-in Pokémon or if there is another variable that could be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onAnySwitchIn
is called for every active effect with that handler, but pokemon
is always the Pokémon switching in; if you wanted to know which Pokémon has Neutralizing Gas, you would need to look at this.effectState.target
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm dumb. onAnySwitchIn
is called for every active Pokémon, but only the one with Neutralizing Gas triggers this specific function. Thanks!
This bug would also apply for Abilities like Embody Aspect, since they also only activate once per time out on the field. |
data/abilities.ts
Outdated
@@ -2875,6 +2875,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { | |||
} | |||
} | |||
}, | |||
onAnySwitchIn(pokemon) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should not be tied to Neutralizing Gas specifically. I'm sure there's some Baton Pass Gastro Acid shenanigans you can do to cause the same thing to happen. Wouldn't it be better to just delete the effectState for Protean/Libero/Embody Aspect when the Pokemon leaves the field / loses the Ability (like how Slow Start does it)? I don't see why we're removing it on switchin in the first place.
You can't merge the effectStates for Protean and Libero either, I don't think. If you change type with Libero, then Skill Swap it Protean, you can still change type with the newly acquired Protean. In general, you can Skill Swap around Libero / Protean and change your type again each time, too (e.g. use Bite with Libero -> change to Dark-type; be given Protean; use Tackle with Protean -> change to Normal-type; be given Libero; use Bite with Libero -> change to Dark-type). It should only hold the effectState for as long as the Pokemon has the Ability. |
The ability states are being reset. pokemon-showdown/data/moves.ts Lines 17214 to 17223 in c8bc6be
|
Skill Swap Libero -> Skill Swap Libero works, yeah. The effectState is tied to the particular instance of the Ability, so to speak. As another example, using Libero Bite -> change to Dark-type, then switch in Neutralizing Gas and switch it out, then using Shore Up will not change to Ground-type. |
We could add an ability check with Perhaps we could use |
Does just using |
cfc16e0
to
4a3d5e2
Compare
Thanks andrebastosdias! |
"If a Protean/Libero Pokemon activates its ability once, switches out, then switches back in while a Neutralizing Gas Pokemon is active, Protean/Libero won't activate even after Neutralizing Gas stops working. This is because Protean/Libero use an event callback to reset the flag, which Neutralizing Gas suppresses."