diff --git a/include/item.h b/include/item.h index f0c58c6ab..ceca83bd5 100644 --- a/include/item.h +++ b/include/item.h @@ -75,6 +75,5 @@ ItemUseFunc ItemId_GetFieldFunc(u16 itemId); u8 ItemId_GetBattleUsage(u16 itemId); ItemUseFunc ItemId_GetBattleFunc(u16 itemId); u8 ItemId_GetSecondaryId(u16 itemId); -bool32 IsPinchBerryItemEffect(u16 holdEffect); #endif // GUARD_ITEM_H diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index d5815ad70..f28cb4fe8 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -41,6 +41,7 @@ enum static u8 ChooseMoveOrAction_Singles(void); static u8 ChooseMoveOrAction_Doubles(void); static void BattleAI_DoAIProcessing(void); +static bool32 IsPinchBerryItemEffect(u16 holdEffect); // ewram EWRAM_DATA const u8 *gAIScriptPtr = NULL; // Still used in contests @@ -2928,6 +2929,29 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) return score; } +static bool32 IsPinchBerryItemEffect(u16 holdEffect) +{ + switch (holdEffect) + { + case HOLD_EFFECT_ATTACK_UP: + case HOLD_EFFECT_DEFENSE_UP: + case HOLD_EFFECT_SPEED_UP: + case HOLD_EFFECT_SP_ATTACK_UP: + case HOLD_EFFECT_SP_DEFENSE_UP: + case HOLD_EFFECT_CRITICAL_UP: + case HOLD_EFFECT_RANDOM_STAT_UP: + #ifdef HOLD_EFFECT_CUSTAP_BERRY + case HOLD_EFFECT_CUSTAP_BERRY: + #endif + #ifdef HOLD_EFFECT_MICLE_BERRY + case HOLD_EFFECT_MICLE_BERRY: + #endif + return TRUE; + } + + return FALSE; +} + // AI_FLAG_CHECK_VIABILITY - a weird mix of increasing and decreasing scores static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { diff --git a/src/item.c b/src/item.c index e9b94ae6f..156034262 100644 --- a/src/item.c +++ b/src/item.c @@ -947,26 +947,3 @@ u8 ItemId_GetSecondaryId(u16 itemId) { return gItems[SanitizeItemId(itemId)].secondaryId; } - -bool32 IsPinchBerryItemEffect(u16 holdEffect) -{ - switch (holdEffect) - { - case HOLD_EFFECT_ATTACK_UP: - case HOLD_EFFECT_DEFENSE_UP: - case HOLD_EFFECT_SPEED_UP: - case HOLD_EFFECT_SP_ATTACK_UP: - case HOLD_EFFECT_SP_DEFENSE_UP: - case HOLD_EFFECT_CRITICAL_UP: - case HOLD_EFFECT_RANDOM_STAT_UP: - #ifdef HOLD_EFFECT_CUSTAP_BERRY - case HOLD_EFFECT_CUSTAP_BERRY: - #endif - #ifdef HOLD_EFFECT_MICLE_BERRY - case HOLD_EFFECT_MICLE_BERRY: - #endif - return TRUE; - } - - return FALSE; -}