pagefaultgames / pokerogue

A browser based Pokémon fangame heavily inspired by the roguelite genre.
https://pokerogue.net
GNU Affero General Public License v3.0
3.93k stars 1.57k forks source link

[BUG] Sheer Force flyout shows up with improper timing #2439

Open DayKev opened 2 weeks ago

DayKev commented 2 weeks ago

Describe the bug If the opposing Pokémon has Sheer Force and uses a move that would activate it, the flyout shows up when you use your move and when the opposing Pokémon uses their move. The issue might (partially?) be with this line: https://github.com/pagefaultgames/pokerogue/blob/aba3e2abc1932ec359bb7fa317568b9f9397d8eb/src/data/ability.ts#L1058 (switching this to false fixes the bug).

To Reproduce To test, I started with Squirtle with Ice Beam and set the opposing Pokémon to be Magikarp with Ice Beam and Sheer Force via overrides.ts. When attacking with Ice Beam, Magikarp's ability flyout activates briefly before disappearing, and then once the opposing Magikarp attacks with Ice Beam it displays again. The bug only occurs if the opposing Pokémon uses a move that activates Sheer Force, thus requiring giving it a move with a secondary effect to display the bug.

Expected behavior The flyout should only show up when the opposing Pokémon uses their move.

Screenshots / Videos Current behavior (bugged):

https://github.com/pagefaultgames/pokerogue/assets/34855794/5db1f16d-d7d0-4eb8-9564-cca00e92e6b6

Behavior after switching line 1058 of ability.ts to false:

https://github.com/pagefaultgames/pokerogue/assets/34855794/1a32bb97-75d4-4779-9380-74ccccc72e10

Device Chrome

DayKev commented 2 weeks ago

The bug probably also happens with Serene Grace (given the shared codepaths), but I didn't test that.

okimin commented 2 weeks ago

Sheer Force flyout still shows is because it also has MovePowerBoostAbAttr which also defaults to true. After testing, Serene Grace won't show at all if it is defaulted to false. But thank you. Will work with this knowledge!!