summaryrefslogtreecommitdiff
path: root/src/contest_ai.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/contest_ai.c')
-rw-r--r--src/contest_ai.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/contest_ai.c b/src/contest_ai.c
index 1342ea102..97e8c8f29 100644
--- a/src/contest_ai.c
+++ b/src/contest_ai.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "battle.h"
#include "contest.h"
#include "random.h"
#include "contest_ai.h"
@@ -807,14 +808,14 @@ static void ContestAICmd_check_move_has_highest_appeal(void)
u16 move = gContestMons[eContestAI->contestantId].moves[eContestAI->unk4];
u8 appeal = gContestEffects[gContestMoves[move].effect].appeal;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
u16 newMove = gContestMons[eContestAI->contestantId].moves[i];
if (newMove != 0 && appeal < gContestEffects[gContestMoves[newMove].effect].appeal)
break;
}
- if (i == 4)
+ if (i == MAX_MON_MOVES)
eContestAI->scriptResult = TRUE;
else
eContestAI->scriptResult = FALSE;
@@ -838,14 +839,14 @@ static void ContestAICmd_unk_2F(void)
u16 move = gContestMons[eContestAI->contestantId].moves[eContestAI->unk4];
u8 jam = gContestEffects[gContestMoves[move].effect].jam;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
u16 newMove = gContestMons[eContestAI->contestantId].moves[i];
if (newMove != 0 && jam < gContestEffects[gContestMoves[newMove].effect].jam)
break;
}
- if (i == 4)
+ if (i == MAX_MON_MOVES)
eContestAI->scriptResult = TRUE;
else
eContestAI->scriptResult = FALSE;
@@ -1019,7 +1020,7 @@ static void ContestAICmd_check_combo_starter(void)
int i;
u16 move = gContestMons[eContestAI->contestantId].moves[eContestAI->unk4];
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
if (gContestMons[eContestAI->contestantId].moves[i])
{
@@ -1065,7 +1066,7 @@ static void ContestAICmd_check_combo_finisher(void)
int i;
u16 move = gContestMons[eContestAI->contestantId].moves[eContestAI->unk4];
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
if (gContestMons[eContestAI->contestantId].moves[i])
{
@@ -1677,7 +1678,7 @@ static void ContestAICmd_check_for_exciting_move(void)
int result = 0;
int i;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
if (gContestMons[eContestAI->contestantId].moves[i])
{
@@ -1719,7 +1720,7 @@ static void ContestAICmd_unk_85(void)
int i;
u16 arg = T1_READ_16(gAIScriptPtr + 1);
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
u16 move = gContestMons[eContestAI->contestantId].moves[i];
if (move == arg)