Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Move] Natural Gift Implementation #5166

Open
wants to merge 9 commits into
base: beta
Choose a base branch
from

Conversation

geeilhan
Copy link
Contributor

@geeilhan geeilhan commented Jan 22, 2025

(#3503)

What are the changes the user will see?

Natural Gift is working as intended.

What are the changes from a developer perspective?

Added a map table for the berries and their power/type conversion to modifiers.ts. Also added functions to call the values in the table.

Also added NaturalGiftTypeAttr and NaturalGiftPowerAttr which control the Type/Power of the move.
In order for these 2 Classes to use the same berry I added the helper class NaturalGiftBerrySelector which chooses a berry held by the pokemon or null if it does not have any. The berry is saved in selectedBerry and is static.
Since it is static the variable only needs to be reset in one of the 2 NaturalGiftAttrs (Used resetBerry() in NaturalGiftPowerAttr since its apply() is called after that of NaturalGiftTypeAttr.

Added some conditions regarding Powdered Pokemon and its heavy rain/extreme harsh sun interaction. Unfortunately this cannot be tested since there are currently no berries in Pokerogue that would change the move type to fire/water. These 2 types are needed for this specific interaction.

Normalize does not change its type but electrify does.

Cannot test interaction with Magic Room/Klutz/Embargo since these abilities/moves do not fully function/exist yet.

Unnerve does not interact with Natural Gift which is the correct behavior.

Screenshots/Videos

Interaction of normal Natural Gift and Electrified Natural Gift:

natural-gift-electrify-interaction.webm

Interaction of Natural Gift and no Berries:

natural-gift-no-berry-interaction.webm

How to test the changes?

Automated tests are added.

For manual tests use:

const overrides = {
  OPP_LEVEL_OVERRIDE: 100,
  OPP_SPECIES_OVERRIDE: Species.MAGIKARP,
  OPP_MOVESET_OVERRIDE: [ Moves.ELECTRIFY, Moves.SPLASH ],
  STARTING_LEVEL_OVERRIDE: 1,
  MOVESET_OVERRIDE: [ Moves.NATURAL_GIFT, Moves.ELECTRIFY ],
  STARTING_HELD_ITEMS_OVERRIDE: [{ name: "BERRY", type: BerryType.SITRUS, count: 4 }]
} 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 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)?

@geeilhan geeilhan requested a review from a team as a code owner January 22, 2025 16:00
@damocleas damocleas added the Move Affects a move label Jan 23, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Move Affects a move
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants