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][UI/UX] Fix bug in Pokédex for Mothim and other niche cases #5458

Merged
merged 4 commits into from
Mar 1, 2025

Conversation

Wlowscha
Copy link
Contributor

@Wlowscha Wlowscha commented Mar 1, 2025

Why am I making these changes?

Discord bug report is here

This is a bit convoluted. The game keeps track of caught forms for every caught species. For species that have no forms, it still marks the "default form" as caught. Now, it turns out that if you evolve a Sand Cloak or Trash Cloak Burmy into Mothim, the "default form" on Mothim is not marked as uncaught, probably because the game tries to unlock form 1 and 2, respectively, instead. A similar thing happens with Milcery when catching an Alcremie form with formIndex > 0, and there might be other niche cases as well.

This normally has no impact whatsoever, because these mons do not actually have a form to use anywhere in the code. The Pokédex, however, was checking DexAttr.DEFAULT_FORM, causing Mothim and Milcery to be shown as uncaught unless they had been obtained in a specific way. This can be easily fixed in the dex and is probably minor enough not to warrant other code changes and a save migration (although we can do that later on if it turns out to be necessary).

What are the changes from a developer perspective?

This PR is focused solely on ensuring consistent behavior in the dex. The isFormCaught() function now always returns true if the species is caught and it only has a single form or no forms at all.

Screenshots/Videos

Screenshots from a save where Mothim and Milcery both do not have DexAttr.DEFAULT_FORM (see that form 0 of Alcremie is not caught).
alcreamie
milcery
mothim

How to test the changes?

A bit tricky, but one way is to start the game from a blank save file and catch Sand CLoak Burmy -> evolve it, or catch a random form of Alcremie, and checking that Mothim or Milcery are displayed correctly.

Checklist

  • I'm using beta as my base branch
  • 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)
    • Have I created new automated tests (npm run create-test) or updated existing tests related to the PR's changes?
  • Have I provided screenshots/videos of the changes (if applicable)?
    • Have I made sure that any UI change works for both UI themes (default and legacy)?

@Wlowscha Wlowscha requested a review from a team as a code owner March 1, 2025 19:07
@Madmadness65 Madmadness65 added UI/UX User interface/-experience related P2 Bug Minor. Non crashing Incorrect move/ability/interaction labels Mar 1, 2025
@damocleas damocleas merged commit b50d2c0 into pagefaultgames:beta Mar 1, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Bug Minor. Non crashing Incorrect move/ability/interaction UI/UX User interface/-experience related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants