[Move] Natural Gift Implementation #5166
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(#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
andNaturalGiftPowerAttr
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 inselectedBerry
and is static.Since it is static the variable only needs to be reset in one of the 2 NaturalGiftAttrs (Used
resetBerry()
inNaturalGiftPowerAttr
since itsapply()
is called after that ofNaturalGiftTypeAttr
.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:
Checklist
beta
as my base branchnpm run test
)npm run create-test
) or updated existing tests related to the PR's changes?