-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Gimmick Refactor #4449
Gimmick Refactor #4449
Conversation
… updated test runner
…expansion into pr/gimmick_refactor
…expansion into pr/gimmick_refactor
…ed z-move category calc
…urst + Z-Move to test Light That Burns the Sky
…expansion into pr/gimmick_refactor
include/config.h
Outdated
@@ -6,7 +6,7 @@ | |||
// still has them in the ROM. This is because the developers forgot | |||
// to define NDEBUG before release, however this has been changed as | |||
// Ruby's actual debug build does not use the AGBPrint features. | |||
#define NDEBUG | |||
// #define NDEBUG |
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.
Reminder to redefine.
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.
Don't forget this :)
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.
// #define NDEBUG | |
#define NDEBUG |
There's a bunch of conflicts for you to solve before I can start reviewing :) |
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.
Preliminary code review. @AlexOn1ine will take care of trying to break things :)
include/config.h
Outdated
@@ -6,7 +6,7 @@ | |||
// still has them in the ROM. This is because the developers forgot | |||
// to define NDEBUG before release, however this has been changed as | |||
// Ruby's actual debug build does not use the AGBPrint features. | |||
#define NDEBUG | |||
// #define NDEBUG |
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.
Don't forget this :)
@@ -10247,7 +10245,7 @@ static inline uq4_12_t CalcTypeEffectivenessMultiplierInternal(u32 move, u32 mov | |||
|
|||
// Thousand Arrows ignores type modifiers for flying mons | |||
if (!IsBattlerGrounded(battlerDef) && (gMovesInfo[move].ignoreTypeIfFlyingAndUngrounded) | |||
&& (gBattleMons[battlerDef].type1 == TYPE_FLYING || gBattleMons[battlerDef].type2 == TYPE_FLYING || gBattleMons[battlerDef].type3 == TYPE_FLYING)) | |||
&& (GetBattlerType(battlerDef, 0, FALSE) == TYPE_FLYING || GetBattlerType(battlerDef, 1, FALSE) == TYPE_FLYING || GetBattlerType(battlerDef, 2, FALSE) == TYPE_FLYING)) |
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.
Out of scope, but this makes me wonder if a BattlerHasType
function would be useful for cases like these
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.
Yeah, would be useful for other stuff like type immunity to moves, such as Grass types being immune to powder moves. Let's write it down so we don't forget.
TURN { MOVE(opponent, MOVE_TACKLE); | ||
MOVE(player, MOVE_QUICK_ATTACK, gimmick: GIMMICK_Z_MOVE); } |
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.
TURN { MOVE(opponent, MOVE_TACKLE); | |
MOVE(player, MOVE_QUICK_ATTACK, gimmick: GIMMICK_Z_MOVE); } | |
TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_QUICK_ATTACK, gimmick: GIMMICK_Z_MOVE); } |
TURN { MOVE(opponent, MOVE_ION_DELUGE); MOVE(player, MOVE_TACKLE, gimmick: GIMMICK_Z_MOVE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ZMOVE_ACTIVATE, player); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BREAKNECK_BLITZ, player); |
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.
If Ion Deluge changes type, shouldn't it change the move animation to be Gigavolt Havoc?
We might need to test in USUM.
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.
Bulbapedia specifically says that Breakneck Blitz is transformed into an Electric-type move, so I want to say that it stays as Breakneck Blitz, but we may need to test to confirm.
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.
If that's the case that should be fine, we can check post-merge :)
…expansion into pr/gimmick_refactor
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.
Just some style changes left to do. After that, should be ready to merge :)
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.
Thanks for the change. Just maybe a minor optimization?
…expansion into pr/gimmick_refactor
…expansion into pr/gimmick_refactor
@AsparagusEduardo Can you merge? There are two minor things that need to be addressed but they aren't urgent. I will open an issue for it. |
The goal of this PR is to unify common features of generational mechanics in the codebase, provide an easy to use interface, and hopefully remove and simplify a lot of redundant code. The graphics behind a gimmick are now probably as simple as it would be to add an icon for an item, and I was able to remove a lot of redundant data in
gBattleStruct
.Ideally, gimmicks become nearly as easy to implement as abilities: potentially difficult depending on complexity, but very specific to the ability itself.
New Gimmick Interface
gBattleStruct->gimmick
for common variables belonging to each generational gimmick (allowing the complete removal ofMegaData
,BurstData
, andTeraData
):gGimmicksInfo
indata/gimmicks.h
) to quickly implement common features of generational gimmicks:RET_MEGA_EVO
,RET_ULTRA_BURST
, etc. intoRET_GIMMICK
(we were out of bits, lol)Other Changes
ZMoveData
.trainer_proc
to work with new interface.Issues Fixed
Z_EFFECT_ALL_STATS_UP
functionality, which had not been raised as an issue yet.which had not been raised as an issue yet.(some of these were caught recently!)Videos
These videos are a bit out-of-date (as of 5/20/24), but nothing other than graphics should have changed.
Here!
Ultra Burst
gimmick.refactor.1.mp4
Mega
gimmick.refactor.2.mp4
Dynamax and Terastallization
gimmick.refactor.3.mp4