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

[Bug] Prevent evolution causing a swap from the second ability to the HA #3138

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

DayKev
Copy link
Collaborator

@DayKev DayKev commented Jul 25, 2024

What are the changes?

If a Pokémon with their second ability evolves, it will swap to its first ability if the evolution has no second ability, instead of improperly "upgrading" to its hidden ability.

Why am I doing these changes?

I noticed a bug report about the issue
https://discord.com/channels/1125469663833370665/1254274565627187211

cf Bulbapedia

In technical terms, a species' Abilities may be thought of as having separate slots, with an individual Pokémon's non-Hidden slot determined by its personality value. For example, an Eevee — with two non-Hidden Abilities — has Run Away for its first non-Hidden slot, Adaptability for its second, and Anticipation for its Hidden Ability slot. Vaporeon — with only one non-Hidden Ability — can be considered to have Water Absorb for both non-Hidden slots. When a Pokémon evolves, its Ability slot remains the same.

What did change?

src/data/pokemon-species.ts: If a Pokémon doesn't have a second ability, its second ability is set to be the same as its first ability.
The PlayerPokemon.evolve() function is updated to account for Pokémon with 3 abilities evolving into a Pokémon with 2 abilities, including an added parameter preEvolution: PokemonSpeciesForm. Each instance of the function being called is updated accordingly.
Tests were added for the evolve() function.
The starter select UI was updated to account for the duplicated abilities.

Screenshots/Videos

ui.test.mp4

How to test the changes?

Start a run with an Eevee with Adaptability (its second ability) and evolve it with a Fire/Water/Thunder stone. It should now have its first ability (Flash Fire/Water Absorb/Volt Absorb) rather than its hidden ability (Guts/Hydration/Quick Feet).

Checklist

  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • Are the changes visual?
    • Have I provided screenshots/videos of the changes?

@f-fsantos f-fsantos merged commit 9f01b52 into pagefaultgames:beta Jul 25, 2024
4 checks passed
@DayKev DayKev deleted the fix-evo-ability-changing branch July 25, 2024 11:53
Vassiat pushed a commit to Vassiat/pokerogue that referenced this pull request Jul 26, 2024
… HA (pagefaultgames#3138)

* Prevent evolution causing a swap from the second ability to the HA

* Add tests

* Update `starter-select-ui-handler.ts`
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.

2 participants