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] Fix some trapping moves' interactions with Ghost-type Pokemon #3936

Merged
merged 6 commits into from
Sep 2, 2024

Conversation

innerthunder
Copy link
Collaborator

What are the changes the user will see?

This fixes two issues related to how certain trapping moves interact with Ghost-type Pokemon:

  1. If a Ghost-type Pokemon is hit with a binding move (e.g. Infestation), it is now correctly afflicted with the damaging effect (while still able to switch or run), rather than cancelling the move's secondary effects altogether.
  2. Ghost-type Pokemon are no longer able to use No Retreat multiple times in succession.

Why am I making these changes?

closes #1915

What are the changes from a developer perspective?

  • data/battler-tags: New NoRetreatTag that extends TrappedTag but removes the non-Ghost-type condition for adding. This condition is also removed from DamagingTrapTag, as this condition can instead be found in Pokemon#isTrapped
  • data/move: Changed No Retreat to make use of its new tag type.
  • field/pokemon: Added an isTrapped helper function to Pokemon which returns true when the Pokemon is under the effects of a trapping move or ability. This supports simulated calls to Shadow Tag, etc. and can forward ability trigger messages to UI elements via the trappedAbMessages argument.
  • phases/command-phase and phases/enemy-command-phase: Rewrote checks for trapping using Pokemon#isTrapped

Screenshots/Videos

Showing Infestation's effects on a Ghost-type vs. on a non-Ghost-type:

PokeRogue.-.Google.Chrome.2024-08-31.00-54-05.mp4

Showing No Retreat fails after the first use by a Ghost-type (but the Ghost-type can still switch):

PokeRogue.-.Google.Chrome.2024-08-31.00-54-47.mp4

How to test the changes?

To reproduce the video tests, add the following overrides to src/overrides.ts:

const overrides = {
  STARTER_SPECIES_OVERRIDE: Species.GENGAR,
  MOVESET_OVERRIDE: [Moves.SPLASH, Moves.NO_RETREAT],
  OPP_MOVESET_OVERRIDE: Array(4).fill(Moves.INFESTATION)
} satisfies Partial<InstanceType<typeof DefaultOverrides>>;

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 considered writing automated tests for the issue?
  • If I have text, did I make it translatable and add a key in the English locale file(s)?
  • 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?

@innerthunder innerthunder added Move Affects a move Ability Affects an ability P2 Bug Minor. Non crashing Incorrect move/ability/interaction labels Aug 31, 2024
@innerthunder innerthunder requested a review from a team as a code owner August 31, 2024 08:25
@innerthunder innerthunder linked an issue Aug 31, 2024 that may be closed by this pull request
Tempo-anon
Tempo-anon previously approved these changes Aug 31, 2024
src/phases/command-phase.ts Outdated Show resolved Hide resolved
src/phases/enemy-command-phase.ts Outdated Show resolved Hide resolved
src/phases/enemy-command-phase.ts Outdated Show resolved Hide resolved
@Tempo-anon Tempo-anon merged commit e29f1fe into pagefaultgames:beta Sep 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ability Affects an ability Move Affects a move P2 Bug Minor. Non crashing Incorrect move/ability/interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Infestation incorrectly interacts with Ghost-type Pokémon
3 participants