OM Various Fervent Impersonation bugs

What type of bug are you reporting? OM

What is the bug?
Fervent Impersonation Bug: Nickname Pokemon's Ability changes after switch

Are you able to replicate it? If so, how?
Non-primary abilities of nickname mons change to primary ability after switch.

https://replay.pokemonshowdown.com/...-2134709748-wrm3z0ugr8y1cyrv15u8xy0796o47l4pw

As shown in this replay, Garganacl's Sturdy correctly chooses Water Absorb as Clodsire's ability, but after it switches out, it changes to Poison Point for the rest of the game. This bug occurs for hidden abilities as well, so for example a nickname transformed Ho-oh will only trigger Regenerator once but its ability will become Pressure the next time it switches in.
 
I found another weird interaction: Mimikyu can infinitely regain disguise if it has no nickname and is at <50% HP ash shown below.
https://replay.pokemonshowdown.com/...-2135093506-zgxa411macf92me9rfff4exydewe93gpw

In a similar case, Eiscue can permanently regain Ice Face under Snow if it is <50% HP.
https://replay.pokemonshowdown.com/...-2135095383-4ac14u3mcntjkvgfvc8ydysxkbrc1itpw

If this proves to be difficult to fix, may I ask for Mimikyu, Eiscue and Cramorant to be temporarily banned? Thank you for your time.
 
Last edited:
So I looked at the code, did some testing and would like to identify the problem and provide some potential solutions.

1. Mimikyu/Eiscue Bug: this bug occurs because the transformation check occurs indiscriminately at the end of every turn. If a Pokemon is NOT in the forme of its nickname AND is below 50% hp, the Pokemon transforms. Although this logic is fine for the majority of mons, it does not consider mons that are able to transform by themselves, such as Mimikyu, Eiscue, Cramorant and probably, Aegislash, Zygarde, Mew and Megas. This also occurs when the base pokemon is NOT Mimikyu, Eiscue, etc. as shown in the replay below. I think that a potential solution to this problem is to give a Pokemon which has transformed via the om mechanic a marker/flag which prevents it from triggering the transformation again. This way, each Pokemon on your team can only transform once via om mechanic per game. Although I'm not familiar with the code, I want to say that the code has to make sure these markers/flags are not removed after transformation so they can work properly.

2. Ability Change Bug: this bug occurs because currently, non-primary abilities are accessed via the same method as things like Skill Swap, Entrainment, Simple Beam and Worry Seed. After a Pokemon transforms, its ability is set as the primary ability, THEN it is swapped to the correct ability. As shown in the replay below, the Multiscale Dragonite transforms into an Intimidate Salamence which then has its ability swapped to it's HA Moxie. I'm not sure how to fix this bug but I think the nickname Pokemon's ability has to be defined via a different method because the aforementioned skill-swapping methods are removed after a switch.


https://replay.pokemonshowdown.com/...-2135736584-7i6ov9yx4e4dc8f66fi3xdhc8gbwpj6pw
 
Back
Top