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

Dont copy opponent personality when swapping mon sprite during Mega Evolution #2852

Merged

Conversation

Ultimate-Bob
Copy link

Description

The Mega Evolution/Primal Reversion transformation animation uses HandleSpeciesGfxDataChange to swap sprites to the new species, but always passes TRUE into the trackEnemyPersonality param. This causes the opposing mon's personality to be used when swapping sprite palettes resulting in an issue where a shiny Pokemon will almost always mega evolve into its non-shiny colours (since its personality determines shiny). This is only cosmetic; opening a menu such as bag and then closing again will display the correct sprite palette again.

This change will pass in false for the trackEnemyPersonality param if megaEvo is non-zero so that its proper shiny/non-shiny palette will be used.

Images

image
image

Discord contact info

Ultimate_Bob#2163

@Ultimate-Bob Ultimate-Bob changed the title Dont copy opponent personality when swapping mon sprite during mega evo Dont copy opponent personality when swapping mon sprite during Mega Evolution Mar 22, 2023
@AsparagusEduardo
Copy link
Collaborator

AsparagusEduardo commented Mar 22, 2023

Looking at other uses of AnimTask_TransformMon, other stuff would also be affected by this change:

  • Primal Reversion
  • Illusion
  • Other form changes

I think the proper way to handle this would be to add an additional parameter to pass if the enemy personality should be tracked on that specific use.

@Ultimate-Bob
Copy link
Author

Ultimate-Bob commented Mar 23, 2023

After giving it a bit more of an investigation and testing a few scenarios, I feel as though trackEnemyPersonality should actually be false in every case - even including when using Transform (or Imposter) against an opponent. I.e. a shiny Pokemon should keep its own personality and thus transform into the shiny variant of the opponent regardless of whether the opponent is shiny or not (the default for gen3, but changed in gen4+).

I'm assuming the shiny appearance that is shown after refreshing the battle scene (e.g. opening and closing the bag) is the correct one - it is always the original shiny state, and not the opponent's.

Of course I could still add the extra parameter to AnimTask_TransformMon but perhaps the right solution is just to pass FALSE instead of TRUE? What do you think?

Btw, all uses of AnimTask_TransformMon in scripts (Mega Evo, Primal Reversion, Illusion, and form changes) use it the same way:

createvisualtask AnimTask_TransformMon, 2, 0, 1

They all currently behave identically and exhibit the same problem. Only Transform, Imposter and weather form changes for Castform (and Cherrim?) are treated differently.

@AsparagusEduardo
Copy link
Collaborator

The issue is that in Gen 4+ Transform uses the opponent's personality:

In Pokémon Stadium 2 and Generation III games (including Pokémon Colosseum and XD), whether a transformed Pokémon appears Shiny depends on whether the user was originally Shiny; since Generation IV, it depends on whether the target was Shiny.
https://bulbapedia.bulbagarden.net/wiki/Transform_(move)#Appearance_nuances

@AsparagusEduardo
Copy link
Collaborator

Btw, all uses of AnimTask_TransformMon in scripts (Mega Evo, Primal Reversion, Illusion, and form changes) use it the same way:

This is not true:
image

@Ultimate-Bob
Copy link
Author

The issue is that in Gen 4+ Transform uses the opponent's personality

I figured that's probably why this parameter was added in the first place, so that makes lots of sense.
Since we want to use Gen 4+ behavior, then we definitely shouldn't pass false all the time. I'll go and add the extra param to AnimTask_TransformMon and only set true for Transform/Imposter.

There is still an issue, where the oppenent's shinyness isn't reflected upon opening a menu and returning to the battle scene though:
ShinyTransformReverts

I'm not sure why this is yet, I'll have a look into it tomorrow and include fixes for it if I find out. (I imagine it could be checking its original personality or against wrong OT id)

This is not true:

Ahh, sorry you're right. I meant to say that all uses of it apart from the original ones are the same - Transform/Imposter (first one) and WeatherFormChange for Castform (second one) are both different. I was basically just mentioning that all of the in-battle form changes added in the expansion (Mega Evo, Primal Reversion, etc) end up routing through createvisualtask AnimTask_TransformMon, 2, 0, 1 one way or another, hence they are all affected by the bug of copying the oppenent's personality for their palette. As an example, a shiny Aegislash will stance change into a non-shiny if the opponent isn't shiny.
AegislashShinyChange

@Ultimate-Bob
Copy link
Author

I've updated the PR to include the new parameter for AnimTask_TransformMon.

I also found and fixed the bug where a transformed Pokemon would revert back to its original palette when reloading the battle scene.

Also for good measure, I've added a battle config option to toggle whether Transform copies the opponent's shiny state, since I personally quite like the Gen 3 behavior.

@AaghatIsLive
Copy link

I think this also happens the other way around, the Garchomp here wasn't shiny until it mega evolved, and was reverted back to normal when caught.

4521145125.png

*Garchomp is a static encounter with the flag that makes wild Pokemon smart and mega evolve if it's holding a mega stone

@Ultimate-Bob
Copy link
Author

I always forget how much better shiny Mega Garchomp looks over its non-mega shiny.

The way I actually noticed this was when I raised the Shiny Odds to 1/2 for some testing. A trainer opponent had a regular Gyarados that mega evolved into its shiny mega, even though I was not using any shinies. I checked the code and found it was taking the personality value of my Pokemon, and it happened to land on the 50% shiny chance for its own OT id.

@AsparagusEduardo AsparagusEduardo merged commit 32e63d8 into rh-hideout:upcoming May 1, 2023
@AsparagusEduardo AsparagusEduardo mentioned this pull request May 31, 2023
@Ultimate-Bob Ultimate-Bob deleted the transform-wrong-personality branch August 20, 2023 15:04
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

Successfully merging this pull request may close these issues.

3 participants