fixed Dynamax bypassing selection prevention
This commit is contained in:
parent
886bee2b90
commit
9f306c65ed
@ -1745,6 +1745,9 @@ static bool32 IsBelchPreventingMove(u32 battler, u32 move)
|
||||
return !(gBattleStruct->ateBerry[battler & BIT_SIDE] & gBitTable[gBattlerPartyIndexes[battler]]);
|
||||
}
|
||||
|
||||
// Dynamax bypasses all selection prevention except Taunt and Assault Vest.
|
||||
#define DYNAMAX_BYPASS_CHECK !gBattleStruct->dynamax.playerSelect && !IsDynamaxed(gBattlerAttacker)
|
||||
|
||||
u8 TrySetCantSelectMoveBattleScript(void)
|
||||
{
|
||||
u32 limitations = 0;
|
||||
@ -1753,7 +1756,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
u32 holdEffect = GetBattlerHoldEffect(gActiveBattler, TRUE);
|
||||
u16 *choicedMove = &gBattleStruct->choicedMove[gActiveBattler];
|
||||
|
||||
if (!gBattleStruct->dynamax.playerSelect && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gActiveBattler].disabledMove == move && move != MOVE_NONE)
|
||||
if (DYNAMAX_BYPASS_CHECK && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gActiveBattler].disabledMove == move && move != MOVE_NONE)
|
||||
{
|
||||
gBattleScripting.battler = gActiveBattler;
|
||||
gCurrentMove = move;
|
||||
@ -1769,7 +1772,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!gBattleStruct->dynamax.playerSelect && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && move == gLastMoves[gActiveBattler] && move != MOVE_STRUGGLE && (gBattleMons[gActiveBattler].status2 & STATUS2_TORMENT))
|
||||
if (DYNAMAX_BYPASS_CHECK && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && move == gLastMoves[gActiveBattler] && move != MOVE_STRUGGLE && (gBattleMons[gActiveBattler].status2 & STATUS2_TORMENT))
|
||||
{
|
||||
CancelMultiTurnMoves(gActiveBattler);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1786,7 +1789,10 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
|
||||
if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gActiveBattler].tauntTimer != 0 && IS_MOVE_STATUS(move))
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (IsDynamaxed(gBattlerAttacker))
|
||||
gCurrentMove = MOVE_MAX_GUARD;
|
||||
else
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace;
|
||||
@ -1799,7 +1805,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!gBattleStruct->dynamax.playerSelect && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].flags & FLAG_SOUND)
|
||||
if (DYNAMAX_BYPASS_CHECK && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].flags & FLAG_SOUND)
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1814,7 +1820,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!gBattleStruct->dynamax.playerSelect && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && GetImprisonedMovesCount(gActiveBattler, move))
|
||||
if (DYNAMAX_BYPASS_CHECK && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && GetImprisonedMovesCount(gActiveBattler, move))
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1829,7 +1835,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!gBattleStruct->dynamax.playerSelect && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && IsGravityPreventingMove(move))
|
||||
if (DYNAMAX_BYPASS_CHECK && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && IsGravityPreventingMove(move))
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1844,7 +1850,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!gBattleStruct->dynamax.playerSelect && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && IsHealBlockPreventingMove(gActiveBattler, move))
|
||||
if (DYNAMAX_BYPASS_CHECK && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && IsHealBlockPreventingMove(gActiveBattler, move))
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1859,7 +1865,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && IsBelchPreventingMove(gActiveBattler, move))
|
||||
if (DYNAMAX_BYPASS_CHECK && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && IsBelchPreventingMove(gActiveBattler, move))
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1874,7 +1880,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (move == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
|
||||
if (DYNAMAX_BYPASS_CHECK && move == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1890,7 +1896,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
|
||||
gPotentialItemEffectBattler = gActiveBattler;
|
||||
if (!gBattleStruct->dynamax.playerSelect && (holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)
|
||||
if (DYNAMAX_BYPASS_CHECK && (holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)
|
||||
{
|
||||
gCurrentMove = *choicedMove;
|
||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||
@ -1907,7 +1913,10 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
else if (holdEffect == HOLD_EFFECT_ASSAULT_VEST && IS_MOVE_STATUS(move) && move != MOVE_ME_FIRST)
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (IsDynamaxed(gBattlerAttacker))
|
||||
gCurrentMove = MOVE_MAX_GUARD;
|
||||
else
|
||||
gCurrentMove = move;
|
||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
@ -1920,7 +1929,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
limitations++;
|
||||
}
|
||||
}
|
||||
if (!gBattleStruct->dynamax.playerSelect && (GetBattlerAbility(gActiveBattler) == ABILITY_GORILLA_TACTICS) && *choicedMove != MOVE_NONE
|
||||
if (DYNAMAX_BYPASS_CHECK && (GetBattlerAbility(gActiveBattler) == ABILITY_GORILLA_TACTICS) && *choicedMove != MOVE_NONE
|
||||
&& *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)
|
||||
{
|
||||
gCurrentMove = *choicedMove;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user