Fixed Hidden Power damage category for PSS < GEN_4 (#5053)
* Fixed Hidden Power damage category for PSS < GEN_4 * Fixed category display regression * Wrapped GET_MOVE_TYPE --------- Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
parent
b54226dde3
commit
a89820fa96
2 changed files with 8 additions and 7 deletions
|
@ -795,13 +795,12 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER
|
|||
#define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects.
|
||||
#define F_DYNAMIC_TYPE_SET (1 << 7) // Set for all dynamic types to distinguish a dynamic type of Normal (0) from no dynamic type.
|
||||
|
||||
#define GET_MOVE_TYPE(move, typeArg) \
|
||||
{ \
|
||||
#define GET_MOVE_TYPE(move, typeArg) do { \
|
||||
if (gBattleStruct->dynamicMoveType) \
|
||||
typeArg = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; \
|
||||
else \
|
||||
typeArg = gMovesInfo[move].type; \
|
||||
}
|
||||
typeArg = gMovesInfo[move].type; \
|
||||
} while(0)
|
||||
|
||||
#define IS_MOVE_PHYSICAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL)
|
||||
#define IS_MOVE_SPECIAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL)
|
||||
|
|
|
@ -10828,6 +10828,7 @@ bool32 ShouldGetStatBadgeBoost(u16 badgeFlag, u32 battler)
|
|||
|
||||
u8 GetBattleMoveCategory(u32 moveId)
|
||||
{
|
||||
u8 moveType;
|
||||
if (gBattleStruct != NULL && gBattleStruct->zmove.active && !IS_MOVE_STATUS(moveId))
|
||||
return gBattleStruct->zmove.activeCategory;
|
||||
if (gBattleStruct != NULL && IsMaxMove(moveId)) // TODO: Might be buggy depending on when this is called.
|
||||
|
@ -10839,10 +10840,11 @@ u8 GetBattleMoveCategory(u32 moveId)
|
|||
|
||||
if (IS_MOVE_STATUS(moveId))
|
||||
return DAMAGE_CATEGORY_STATUS;
|
||||
else if (gMovesInfo[moveId].type < TYPE_MYSTERY)
|
||||
return DAMAGE_CATEGORY_PHYSICAL;
|
||||
else if (gMain.inBattle)
|
||||
GET_MOVE_TYPE(moveId, moveType);
|
||||
else
|
||||
return DAMAGE_CATEGORY_SPECIAL;
|
||||
moveType = gMovesInfo[moveId].type;
|
||||
return moveType < TYPE_MYSTERY ? DAMAGE_CATEGORY_PHYSICAL : DAMAGE_CATEGORY_SPECIAL;
|
||||
}
|
||||
|
||||
static bool32 TryRemoveScreens(u32 battler)
|
||||
|
|
Loading…
Reference in a new issue