doshidak / showdex

Pokémon Showdown extension that harnesses the power of parabolic calculus to strategically extract your opponents' Elo.
GNU Affero General Public License v3.0
98 stars 18 forks source link

Disguised Zoroark and Stat changes #62

Open ec-03 opened 1 year ago

ec-03 commented 1 year ago

If a friendly disguised Zoroark changes one of its stats, until the disguise is broken, the calc won't realize that there was a stat change. h

doshidak commented 1 year ago

Nice find!

Unfortunately, this won't be a super easy one to solve since the boosts are stored in the corresponding client Pokémon (what your opponent sees), so there's no guaranteed mapping of the server-to-client Pokémon. Since the Zoroark is yours, the server Pokémon refers to the Zoroark, but the corresponding client Pokémon refers to that of the mimicked Pokémon (Spheal in your case).

Normally for client Pokémon, once the Illusion ends, the mimicked client Pokémon (Spheal) gets replaced with Zoroark's client Pokémon, hence why the boosts are applied then.

Thought about looking at the revealed moves of your client Pokémon (Nasty Plot in this case), then comparing it with the actual moves of the mimicked Pokémon (Spheal), which can't learn Nasty Plot, so we know that Spheal's client Pokémon is actually Zoroark.

However, you can probably guess this isn't foolproof since the mimicked Pokémon may have Nasty Plot as well, so this workaround would probably cause more problems down-the-line (especially in, say, Anything Goes or Hackmons, where Spheal could technically have Nasty Plot).

All this to say that this fix may take awhile to implement since I'll need to do some research in order to find a consistent way of mapping Illusion server Pokémon with the mimicked client Pokémon containing the boosts data. (I may not be able to get a fix out for the next upcoming version.)

In the meantime, you'll unfortunately have to manually set the boosts to your Zoroark yourself :(

I'll keep your issue open until this is fixed though!

Thanks!