Add missing CanGetFrostbite

This commit is contained in:
Bassoonian 2023-05-01 11:19:10 +02:00
parent 6a5947c3dd
commit 39b50d09dd
3 changed files with 16 additions and 1 deletions

View file

@ -228,6 +228,7 @@ bool32 CanBePoisoned(u8 battlerAttacker, u8 battlerTarget);
bool32 CanBeBurned(u8 battlerId);
bool32 CanBeParalyzed(u8 battlerId);
bool32 CanBeFrozen(u8 battlerId);
bool32 CanGetFrostbite(u8 battlerId);
bool32 CanBeConfused(u8 battlerId);
bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag);
u32 GetBattlerFriendshipScore(u8 battlerId);

View file

@ -3212,7 +3212,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
}
break;
case STATUS1_FROSTBITE:
if (!CanBeFrozen(gEffectBattler))
if (!CanGetFrostbite(gEffectBattler))
break;
statusChanged = TRUE;

View file

@ -6507,6 +6507,20 @@ bool32 CanBeFrozen(u8 battlerId)
return TRUE;
}
bool32 CanGetFrostbite(u8 battlerId)
{
u16 ability = GetBattlerAbility(battlerId);
if (IS_BATTLER_OF_TYPE(battlerId, TYPE_ICE)
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|| ability == ABILITY_MAGMA_ARMOR
|| ability == ABILITY_COMATOSE
|| gBattleMons[battlerId].status1 & STATUS1_ANY
|| IsAbilityStatusProtected(battlerId)
|| IsBattlerTerrainAffected(battlerId, STATUS_FIELD_MISTY_TERRAIN))
return FALSE;
return TRUE;
}
bool32 CanBeConfused(u8 battlerId)
{
if (GetBattlerAbility(battlerId) == ABILITY_OWN_TEMPO