mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-26 13:31:03 +01:00
add safeguard checks
This commit is contained in:
parent
9e29d303ec
commit
4a5a3ea6af
@ -5065,6 +5065,7 @@ bool32 CanSleep(u8 battlerId)
|
||||
if (ability == ABILITY_INSOMNIA
|
||||
|| ability == ABILITY_VITAL_SPIRIT
|
||||
|| ability == ABILITY_COMATOSE
|
||||
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|
||||
|| gBattleMons[battlerId].status1 & STATUS1_ANY
|
||||
|| IsAbilityOnSide(battlerId, ABILITY_SWEET_VEIL)
|
||||
|| IsAbilityStatusProtected(battlerId)
|
||||
@ -5078,6 +5079,7 @@ bool32 CanBePoisoned(u8 battlerId)
|
||||
u16 ability = GetBattlerAbility(battlerId);
|
||||
if (IS_BATTLER_OF_TYPE(battlerId, TYPE_POISON)
|
||||
|| IS_BATTLER_OF_TYPE(battlerId, TYPE_STEEL)
|
||||
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|
||||
|| gBattleMons[battlerId].status1 & STATUS1_ANY
|
||||
|| ability == ABILITY_IMMUNITY
|
||||
|| ability == ABILITY_COMATOSE
|
||||
@ -5092,6 +5094,7 @@ bool32 CanBeBurned(u8 battlerId)
|
||||
{
|
||||
u16 ability = GetBattlerAbility(battlerId);
|
||||
if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FIRE)
|
||||
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|
||||
|| gBattleMons[battlerId].status1 & STATUS1_ANY
|
||||
|| ability == ABILITY_WATER_VEIL
|
||||
|| ability == ABILITY_COMATOSE
|
||||
@ -5105,6 +5108,7 @@ bool32 CanBeParalyzed(u8 battlerId)
|
||||
{
|
||||
u16 ability = GetBattlerAbility(battlerId);
|
||||
if ((B_PARALYZE_ELECTRIC >= GEN_6 && IS_BATTLER_OF_TYPE(battlerId, TYPE_ELECTRIC))
|
||||
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|
||||
|| ability == ABILITY_LIMBER
|
||||
|| ability == ABILITY_COMATOSE
|
||||
|| gBattleMons[battlerId].status1 & STATUS1_ANY
|
||||
@ -5119,6 +5123,7 @@ bool32 CanBeFrozen(u8 battlerId)
|
||||
u16 ability = GetBattlerAbility(battlerId);
|
||||
if (IS_BATTLER_OF_TYPE(battlerId, TYPE_ICE)
|
||||
|| (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY)
|
||||
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|
||||
|| ability == ABILITY_MAGMA_ARMOR
|
||||
|| ability == ABILITY_COMATOSE
|
||||
|| gBattleMons[battlerId].status1 & STATUS1_ANY
|
||||
|
Loading…
x
Reference in New Issue
Block a user