-
-
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] Fix enemy faint causing Frenzy moves to mishandle paralysis #4680
base: beta
Are you sure you want to change the base?
Conversation
This is my first contribution ever so if something is missing or is wrong in my PR please give me some feedback. I was wondering if anyone has experience creating test cases for RNG outcomes such as "Does Pokemon attack during paralysis". I was thinking of |
A decent amount of the RNG is controlled for automatically in tests, and for the stuff that isn't usually it's possible to force certain RNG outcomes by using |
Thanks for the feedback. |
I'll put up a PR for the status activation override stuff in a few minutes (nearly finished). |
Alright, to use the new function in your test once it's added you can put // first part of test
game.move.select(Moves.THRASH); // <-- this line is probably optional on the forced turn of a Frenzy move
await game.move.forceStatusActivation(true);
await game.toNextTurn();
// rest of test |
Thank you that is very helpful :) |
Welcome to the PokeRogue project! Could you please give some more info on how the |
I did not look deeply into it but from my test result I could see that the BattlerTag got reset but the MoveQueue did not. Thinking back I put the frenzyMissFunc in the apply() function of FrenzyAttr (apply()). I will test again using the frenzyMissFunc in src/phases/move-phase.ts.
Update: @PigeonBar thank you for the insight you are completely right. I thought it wouldn't work because I didn't think about exporting the function |
[P2 BUG] Fixed Frenzy Counter Reset Method Should Move Fail (#4277)
What are the changes the user will see?
Example situation (How it used to be):
My fix corrects the incorrect behaviour of Step 7 in the example situation. Step 8 does also differ since step 7 cancels the move (Thrash).
After the fix:
[...]
7. During the start of the next battle the Player is able to switch Pokemon and able to select a move
8. Player Pokemon does not get confused after the attack
Why am I making these changes?
I have a uni course where my goal is to contribute to and interact with an open source project of our choosing.
In addition, this bug affects gameplay and should therefore be fixed.
I found this bug from an existing issue.
What are the changes from a developer perspective?
handlePreMoveFailures()
Link did not consider a move being cancelled during a frenzy move and therefore does not remove theBattlerTagType.FRENZY
on the pokemon (pokemon.summonData.tags
) Link as well as the frenzy moves queued on the pokemon (pokemon.getMoveQueue()
) Link.My implementation removes the
BattlerTagType.FRENZY
as well as empties themoveQueue
of the frenzy moves should the attack be cancelled due to a status effect such as Paralysis, Sleep and Freeze Link .The last commit Merge branch 'pagefaultgames:beta' into beta happend because I synced my fork before the PR and has no influence on my code.
Screenshots/Videos
At the 3rd turn the Pokemon doesn't attack due to paralysis but during my manual tests the Pokemon automatically attacks and gets confused after. (I just wasn't recording)
Before_Changes_Paralyzed_Thrash.webm
After_Changes_Paralyzed_Thrash.webm
How to test the changes?
I used
src/overrides.ts
in order to test my code. I was necessary since the test rely on RNG with Paralysis and the amount of hits for Thrash. Manually testing this might take some time but in order to reduce the testing time I changed some RNG values of the game.This is the override I used is:
const overrides = { STARTER_SPECIES_OVERRIDE: Species.PONYTA, STARTING_LEVEL_OVERRIDE: 100, STATUS_OVERRIDE: StatusEffect.PARALYSIS, MOVESET_OVERRIDE: [ Moves.THRASH ], OPP_MOVESET_OVERRIDE: [ Moves.MEMENTO ], OPP_LEVEL_OVERRIDE: 1, OPP_IVS_OVERRIDE: [ 1, 1, 1, 1, 1, 1 ], BATTLE_TYPE_OVERRIDE: "single", } satisfies Partial<InstanceType<typeof DefaultOverrides>>;
I also changed the
turnCount
Link to 2 instead of a random number between 1 and 2.As well as the paralysis chance to 2 Link.
Currently there are no automated test cases but I am working on it. Manual tests and
npm run test
have passed the tests.Checklist
beta
as my base branchnpm run test
)