2020-12-20 21:47:20 +00:00
|
|
|
#ifndef GUARD_BATTLE_AI_MAIN_H
|
|
|
|
#define GUARD_BATTLE_AI_MAIN_H
|
2017-09-05 08:41:48 +01:00
|
|
|
|
2024-01-26 16:48:51 +00:00
|
|
|
#define UNKNOWN_NO_OF_HITS UINT32_MAX
|
|
|
|
|
2023-10-04 18:53:29 +01:00
|
|
|
// return vals for BattleAI_ChooseMoveOrAction
|
2018-06-17 15:48:58 +01:00
|
|
|
// 0 - 3 are move idx
|
2021-11-28 18:12:56 +00:00
|
|
|
#define AI_CHOICE_FLEE 4
|
|
|
|
#define AI_CHOICE_WATCH 5
|
|
|
|
#define AI_CHOICE_SWITCH 7
|
2018-06-17 15:48:58 +01:00
|
|
|
|
2024-01-26 16:48:51 +00:00
|
|
|
// for AI_WhoStrikesFirst
|
|
|
|
#define AI_IS_FASTER 1
|
|
|
|
#define AI_IS_SLOWER -1
|
|
|
|
|
|
|
|
// for stat increasing / decreasing scores
|
|
|
|
#define STAT_CHANGE_ATK 0
|
|
|
|
#define STAT_CHANGE_DEF 1
|
|
|
|
#define STAT_CHANGE_SPEED 2
|
|
|
|
#define STAT_CHANGE_SPATK 3
|
|
|
|
#define STAT_CHANGE_SPDEF 4
|
|
|
|
|
|
|
|
#define STAT_CHANGE_ATK_2 5
|
|
|
|
#define STAT_CHANGE_DEF_2 6
|
|
|
|
#define STAT_CHANGE_SPEED_2 7
|
|
|
|
#define STAT_CHANGE_SPATK_2 8
|
|
|
|
#define STAT_CHANGE_SPDEF_2 9
|
|
|
|
|
|
|
|
#define STAT_CHANGE_ACC 10
|
|
|
|
#define STAT_CHANGE_EVASION 11
|
|
|
|
|
2023-10-04 18:53:29 +01:00
|
|
|
#include "test_runner.h"
|
|
|
|
|
|
|
|
// Logs for debugging AI tests.
|
|
|
|
#define SET_SCORE(battler, movesetIndex, val) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
TestRunner_Battle_AISetScore(__FILE__, __LINE__, battler, movesetIndex, val); \
|
|
|
|
AI_THINKING_STRUCT->score[movesetIndex] = val; \
|
|
|
|
} while (0) \
|
|
|
|
|
|
|
|
#define ADJUST_SCORE(val) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
TestRunner_Battle_AIAdjustScore(__FILE__, __LINE__, sBattler_AI, AI_THINKING_STRUCT->movesetIndex, val); \
|
|
|
|
score += val; \
|
|
|
|
} while (0) \
|
|
|
|
|
2023-10-13 17:39:35 +01:00
|
|
|
#define ADJUST_SCORE_PTR(val) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
TestRunner_Battle_AIAdjustScore(__FILE__, __LINE__, sBattler_AI, AI_THINKING_STRUCT->movesetIndex, val); \
|
|
|
|
(*score) += val; \
|
|
|
|
} while (0) \
|
|
|
|
|
2021-01-04 22:30:02 +00:00
|
|
|
#define RETURN_SCORE_PLUS(val) \
|
|
|
|
{ \
|
2023-10-04 18:53:29 +01:00
|
|
|
ADJUST_SCORE(val); \
|
2021-01-04 22:30:02 +00:00
|
|
|
return score; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define RETURN_SCORE_MINUS(val) \
|
|
|
|
{ \
|
2023-10-04 18:53:29 +01:00
|
|
|
ADJUST_SCORE(-val); \
|
2021-01-04 22:30:02 +00:00
|
|
|
return score; \
|
|
|
|
}
|
|
|
|
|
2023-09-13 23:07:41 +01:00
|
|
|
u32 ComputeBattleAiScores(u32 battler);
|
2018-12-22 19:57:12 +00:00
|
|
|
void BattleAI_SetupItems(void);
|
|
|
|
void BattleAI_SetupFlags(void);
|
2023-08-30 09:18:31 +01:00
|
|
|
void BattleAI_SetupAIData(u8 defaultScoreMoves, u32 battler);
|
2023-09-13 23:07:41 +01:00
|
|
|
u32 BattleAI_ChooseMoveOrAction(void);
|
2022-08-23 00:07:25 +01:00
|
|
|
void Ai_InitPartyStruct(void);
|
|
|
|
void Ai_UpdateSwitchInData(u32 battler);
|
2022-08-23 10:58:17 +01:00
|
|
|
void Ai_UpdateFaintData(u32 battler);
|
2023-09-13 16:28:26 +01:00
|
|
|
void SetAiLogicDataForTurn(struct AiLogicData *aiData);
|
2017-09-05 08:41:48 +01:00
|
|
|
|
2020-12-11 15:05:00 +00:00
|
|
|
extern u8 sBattler_AI;
|
|
|
|
|
2020-12-20 21:47:20 +00:00
|
|
|
#endif // GUARD_BATTLE_AI_MAIN_H
|