Skip to content

Commit

Permalink
Fixes Dynamax dynamic move type (#5739)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Nov 30, 2024
1 parent 51fbc80 commit 3343a16
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/battle_dynamax.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ static u16 GetTypeBasedMaxMove(u32 battler, u32 type)
// Returns the appropriate Max Move or G-Max Move for a battler to use.
u16 GetMaxMove(u32 battler, u32 baseMove)
{
u32 move = baseMove;
u32 moveType;
SetTypeBeforeUsingMove(baseMove, battler);
GET_MOVE_TYPE(baseMove, moveType);

if (baseMove == MOVE_NONE) // for move display
{
return MOVE_NONE;
Expand All @@ -291,18 +294,12 @@ u16 GetMaxMove(u32 battler, u32 baseMove)
}
else if (gMovesInfo[baseMove].category == DAMAGE_CATEGORY_STATUS)
{
move = MOVE_MAX_GUARD;
}
else if (gBattleStruct->dynamicMoveType)
{
move = GetTypeBasedMaxMove(battler, gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK);
return MOVE_MAX_GUARD;
}
else
{
move = GetTypeBasedMaxMove(battler, gMovesInfo[baseMove].type);
return GetTypeBasedMaxMove(battler, moveType);
}

return move;
}

// First value is for Fighting, Poison and Multi-Attack. The second is for everything else.
Expand Down

0 comments on commit 3343a16

Please sign in to comment.