[Enhancement] Preserve move PP when fusing #1556
Closed
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.
What are the changes?
Move PP is now preserved when learning any moves that come from fusion. This is reflected on the move summary UI. Additionally, for the edge case when both members of the fusion have the same move known, the higher PP is used.
Why am I doing these changes?
Issue: #1284
I thought this issue was a good idea -- fusion order and what is retained is already confusing, I think it's best to limit that confusion where possible. It's also just nice for the player not to lose PP for "no reason".
What did change?
Added a PPUp override value that can be passed through into
LearnMovePhase
as well asPokemon.setMove()
that allows for moves to begin with non-zero values forppUp
. Provided this override value to the fusion move learning phase inpokemon.ts
. I also moved PP calculation into a static method so PP could be calculated with PP Ups taken into account when a move hasn't been learned yet.Screenshots/Videos
SplicePpTransfer.mp4
Note: to clarify the video above, Sand Attack has had a PP Max used on it, and that carries over during fusion.
How to test the changes?
Increase the drop rate of PP Up, PP Max, and DNA Splicer. Try different combinations -- there's a particular edge case when both know the same move with different PP.
Checklist
npm run test
)