-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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] Refactor moves that call a random move (Metronome, Assist, Sleep Talk, Copycat, Mirror Move) #3380
base: beta
Are you sure you want to change the base?
Conversation
…h invalid moves for assist/sleep talk
…de in callMove in RandomMoveAttr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be helpful to have tests for these moves?
The only thing I could think to test is that they are not choosing invalid moves. Do you think this is necessary/have any edge cases to test for? |
Hello, might be too late + disregard for the process, but could you consider adding this as part of your fix? |
I'll attempt a fix. |
@schmidtc1 please make sure to resolve your merge conflicts |
…updates unit tests for assist/copycat
… move to use this, writes unit tests
Rebranch of #3075
TODO
What are the changes?
Properly implements Assist.
Refactors RandomMovesetMoveAttr to extend RandomMoveAttr.
Creates arrays of invalid moves for each move: Assist, Sleep Talk, Metronome, since they each have different sets of uncallable moves.
Why am I doing these changes?
Assist did not call ally moves, had useless code, and was given no distinction in logic from Sleep Talk.
Metronome calls random moves in a similar manner to the two other moves, so it makes sense to have Assist/Sleep Talk reuse the code for calling moves.
None of Assist/Sleep Talk/Metronome had properly implemented lists of uncallable moves.
What did change?
RandomMoveAttr
and uses its callMoves function (which has been modified slightly to accommodate this) to call the moveNEAR_ENEMY
Note: Sleep Talk specifies that it targets the opposite opponent. Since there is no
MoveTarget
specifically for opposite opponents, I chose to make itNEAR_ENEMY
for now.Screenshots/Videos
Metronome
Metronome.mp4
Assist
Assist.mp4
Sleep Talk
Sleep.Talk.mp4
How to test the changes?
Use src/overrides.ts to give yourself one of the three moves. If using Metronome, observe it will never call certain moves. If using Assist, observe it calling your party pokemon's moves. If using Sleep Talk, observe it only calling its own moveset.
Note that each move will no longer call certain moves: attempt Assist/Sleep Talk with 2 turn moves to see them fail.
List of moves that won't be callable are given above by links to bulbapedia.
Checklist
beta
as my base branchnpm run test
)