mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-02 09:19:59 +01:00
fix AI_WeatherHasEffect to handle unknown abilities
This commit is contained in:
parent
e748db8ef4
commit
bb540b6236
@ -1128,10 +1128,18 @@ bool32 DoesBattlerIgnoreAbilityChecks(u16 atkAbility, u16 move)
|
|||||||
|
|
||||||
bool32 AI_WeatherHasEffect(void)
|
bool32 AI_WeatherHasEffect(void)
|
||||||
{
|
{
|
||||||
|
u32 i;
|
||||||
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE)
|
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE)
|
||||||
return FALSE; // AI doesn't understand ability suppression concept
|
return FALSE; // AI doesn't understand weather supression (handicap)
|
||||||
|
|
||||||
return WEATHER_HAS_EFFECT;
|
// need to manually check since we don't necessarily know opponent ability
|
||||||
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
|
{
|
||||||
|
if (IsBattlerAlive(i)
|
||||||
|
&& (AI_GetAbility(i) == ABILITY_AIR_LOCK || AI_GetAbility(i) == ABILITY_CLOUD_NINE)
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 IsAromaVeilProtectedMove(u16 move)
|
bool32 IsAromaVeilProtectedMove(u16 move)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user