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

[P1][Beta] Fix phazing moves forcing switches into fainted/ineligible Pokemon #4951

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

PigeonBar
Copy link
Collaborator

What are the changes the user will see?

Phazing moves can no longer randomly choose to force a switch into a fainted/ineligible Pokemon.
Also, phazing moves properly use seeded RNG instead of unseeded RNG.

Why am I making these changes?

Bug report: Discord

What are the changes from a developer perspective?

  1. Phazing moves now generate a list of indices of eligible Pokemon to switch into, and then randomly pick an eligible index using seeded RNG.
  2. Added tests for Whirlwind and Dragon Tail.

Screenshots/Videos

Before the changes: Phazing moves can force a switch into a fainted Pokemon
20241129.Before.Fix.Phazing.mp4
After the changes: Phazing moves no longer force a switch into a fainted Pokemon
20241129.After.Fix.Phazing.mp4

How to test the changes?

  1. Reach the floor 195 rival.
  2. Defeat 4 of the rival's 6 Pokemon.
  3. Use a phazing move.
  4. The phazing move should always force the rival to switch to their only other unfainted Pokemon.

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)?

Are there any localization additions or changes? If so:

  • [ ] Has a locales PR been created on the locales repo?
    • [ ] If so, please leave a link to it here:
  • [ ] Has the translation team been contacted for proofreading/translation?

@PigeonBar PigeonBar requested a review from a team as a code owner November 29, 2024 22:22
@MokaStitcher MokaStitcher added Blocker This PR blocks other PRs and should be prioritized P1 Bug Major. Game crashing move/ability/interaction Beta Only present on Beta (didn't make it into production [yet]) labels Nov 29, 2024
Copy link
Collaborator

@DayKev DayKev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor style nit but otherwise seems good.

src/data/move.ts Outdated Show resolved Hide resolved
src/data/move.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@torranx torranx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🚀

@DayKev DayKev merged commit 75af359 into pagefaultgames:beta Nov 30, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beta Only present on Beta (didn't make it into production [yet]) Blocker This PR blocks other PRs and should be prioritized P1 Bug Major. Game crashing move/ability/interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants