diff --git a/src/battle_dynamax.c b/src/battle_dynamax.c index ffe933c850..184e07e4ed 100644 --- a/src/battle_dynamax.c +++ b/src/battle_dynamax.c @@ -89,6 +89,11 @@ u16 GetMaxMove(u16 battlerId, u16 baseMove) { move = MOVE_MAX_GUARD; } + else if (gBattleStruct->dynamicMoveType) // unsure of how to deal with Hidden Power + { + move = sMaxMoveTable[gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK]; + gBattleStruct->dynamax.splits[battlerId] = gBattleMoves[baseMove].split; + } else { move = sMaxMoveTable[gBattleMoves[baseMove].type]; diff --git a/src/battle_util.c b/src/battle_util.c index dc3ef260e8..999f7c2a9b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -304,14 +304,6 @@ void HandleAction_UseMove(void) gCurrentMove = gBattleStruct->zmove.toBeUsed[gBattlerAttacker]; } - // check max move used - if (gBattleStruct->dynamax.usingMaxMove[gBattlerAttacker]) - { - gCurrentMove = gChosenMove = GetMaxMove(gBattlerAttacker, gCurrentMove); - gBattleStruct->dynamax.activeSplit = gBattleStruct->dynamax.splits[gBattlerAttacker]; - gBattleStruct->moveTarget[gBattlerAttacker] = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - } - if (gBattleMons[gBattlerAttacker].hp != 0) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) @@ -324,6 +316,14 @@ void HandleAction_UseMove(void) SetTypeBeforeUsingMove(gChosenMove, gBattlerAttacker); GET_MOVE_TYPE(gChosenMove, moveType); + // check max move used + if (gBattleStruct->dynamax.usingMaxMove[gBattlerAttacker]) + { + gCurrentMove = gChosenMove = GetMaxMove(gBattlerAttacker, gCurrentMove); + gBattleStruct->dynamax.activeSplit = gBattleStruct->dynamax.splits[gBattlerAttacker]; + gBattleStruct->moveTarget[gBattlerAttacker] = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + } + // choose target side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove) @@ -7918,7 +7918,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) return FALSE; } - // Max Moves bypass any protection except Max Guard + // Max Moves bypass any protection except Max Guard. if (IsMaxMove(move)) { if (gProtectStructs[battlerId].maxGuarded)