-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Roost suppresses the user's Flying-type rather than remove and re-add it. Added tests for EFFECT_ROOST. #3258
Conversation
WIP. This is my first PR, so let me know if anything needs to be changed. I do have some questions:
|
Very detailed first PR! |
…a battler's type. Added more tests.
This PR fix kinda grew in scope after realizing that there were still a lot of issues with how Roost is currently implemented. On cart, Roost acts more of a suppression rather than a type change, where it simply filters out the Flying-type whenever the game tries to read the user's typing. This allows for other type changing effects to remain after the end of the turn. It also means that if a Roosted Pokemon gains the Flying-type after using Roost, it will still be suppressed. There's still some other interactions that need to be tested. |
…nging effects, Grassy Terrain healing, Levitate, Air Balloon, Magnet Rise, and Telekinesis.
Co-authored-by: LOuroboros <[email protected]>
These are nice changes. could you solve conflicts? |
Resolved the conflicts. |
Now that I think about it, shouldn't this have been PR'd to Master and not Upcoming? It's kind of a big refactor 😅 ... |
It wasn't that big I feel, from what I could tell, most changes were related to changing uses to |
The change is simple in concept, but the function is called an awful lot of times in multiple places 👀 Well, whatever. |
Description
This PR initially just fixed a single issue with Roost clearing the user's
type3
, however looking into it further it became apparent that Roost's type changing effect needed to be handled differently than other forms of type changing. Roost acts more like a filter or suppression of the user's Flying type, where it doesn't actually remove the Flying type, and does not need to re-apply it at the end of the turn.This is important for Roost to work correctly with other type changing moves:
Tests have been added to cover a lot of other interactions and mechanics of Roost as well:
This change is implemented by introducing a new
GetBattlerType(u32 battler, u8 typeIndex)
function and using that to retrieve a battler's type instead of accessing it directly from the battler'sBattlePokemon
struct. The function will return the requested type, filtering out the Flying-type if the battler has theRESOURCE_FLAG_ROOST
flag set, and will return eitherTYPE_NORMAL
orTYPE_MYSTERY
depending on whether theB_ROOST_PURE_FLYING
config is set to <= Gen. 4 or >= Gen 5.Videos
Below are videos of my original fix for the user's
type3
. This issue is still resolved in my latest changes, but it's now handled properly.Before Fix
roost-bug.mp4
After Fix
roost-bug-fixed.mp4
Issue(s) that this PR fixes
Adds missing tests for
EFFECT_ROOST
listed in #2706Discord contact info
blourenco