mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
Moving isBattlerProtected
This commit is contained in:
parent
f808710932
commit
89e9b989c9
@ -1313,47 +1313,6 @@ static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] =
|
||||
[NATURE_QUIRKY] = B_MSG_EAGER_FOR_MORE,
|
||||
};
|
||||
|
||||
bool32 IsBattlerProtected(u8 battlerId, u16 move)
|
||||
{
|
||||
// Decorate bypasses protect and detect, but not crafty shield
|
||||
if (move == MOVE_DECORATE)
|
||||
{
|
||||
if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD)
|
||||
return TRUE;
|
||||
else if (gProtectStructs[battlerId].protected)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED))
|
||||
return FALSE;
|
||||
else if (gBattleMoves[move].effect == MOVE_EFFECT_FEINT)
|
||||
return FALSE;
|
||||
else if (gProtectStructs[battlerId].protected)
|
||||
return TRUE;
|
||||
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD
|
||||
&& gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))
|
||||
return TRUE;
|
||||
else if (gProtectStructs[battlerId].banefulBunkered)
|
||||
return TRUE;
|
||||
else if (gProtectStructs[battlerId].obstructed && !IS_MOVE_STATUS(move))
|
||||
return TRUE;
|
||||
else if (gProtectStructs[battlerId].spikyShielded)
|
||||
return TRUE;
|
||||
else if (gProtectStructs[battlerId].kingsShielded && gBattleMoves[move].power != 0)
|
||||
return TRUE;
|
||||
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_QUICK_GUARD
|
||||
&& GetChosenMovePriority(gBattlerAttacker) > 0)
|
||||
return TRUE;
|
||||
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD
|
||||
&& IS_MOVE_STATUS(move))
|
||||
return TRUE;
|
||||
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_MAT_BLOCK
|
||||
&& !IS_MOVE_STATUS(move))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 NoTargetPresent(u32 move)
|
||||
{
|
||||
if (!IsBattlerAlive(gBattlerTarget))
|
||||
|
Loading…
Reference in New Issue
Block a user