-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from lhearachel/trainer_ai
Start Documenting Trainer AI Routines
- Loading branch information
Showing
8 changed files
with
730 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef POKEPLATINUM_BATTLE_TRAINER_AI_H | ||
#define POKEPLATINUM_BATTLE_TRAINER_AI_H | ||
|
||
#include "struct_decls/battle_system.h" | ||
#include "battle/battle_context.h" | ||
|
||
/** | ||
* @brief Initialize the trainer AI for a given battler. | ||
* | ||
* @param battleSys | ||
* @param battleCtx | ||
* @param battler The battler to be initialized | ||
* @param initScore Bitmask of moves to have their scores initialized; moves | ||
* flagged as such will be initially scored at 100 instead of 0. | ||
*/ | ||
void TrainerAI_Init(BattleSystem *battleSys, BattleContext *battleCtx, u8 battler, u8 initScore); | ||
|
||
/** | ||
* @brief Execute the trainer AI routine for a given battler. | ||
* | ||
* @param battleSys | ||
* @param battler The battler to be executed | ||
* @return AI execution routine result | ||
*/ | ||
u8 TrainerAI_Main(BattleSystem *battleSys, u8 battler); | ||
|
||
/** | ||
* @brief Pick the command for a battler to execute. | ||
* | ||
* @param battleSys | ||
* @param battler The battler who is waiting to choose their turn's action | ||
* @return The action to be executed for this battler | ||
*/ | ||
int TrainerAI_PickCommand(BattleSystem *battleSys, int battler); | ||
|
||
#endif // POKEPLATINUM_BATTLE_TRAINER_AI_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef POKEPLATINUM_CONSTANTS_BATTLE_TRAINER_AI_H | ||
#define POKEPLATINUM_CONSTANTS_BATTLE_TRAINER_AI_H | ||
|
||
#define AI_FLAG_BASIC (1 << 0) | ||
#define AI_FLAG_EVAL_ATTACK (1 << 1) | ||
#define AI_FLAG_EXPERT (1 << 2) | ||
#define AI_FLAG_SETUP_FIRST_TURN (1 << 3) | ||
#define AI_FLAG_RISKY (1 << 4) | ||
#define AI_FLAG_DAMAGE_PRIORITY (1 << 5) | ||
#define AI_FLAG_BATON_PASS (1 << 6) | ||
#define AI_FLAG_TAG_STRATEGY (1 << 7) | ||
#define AI_FLAG_CHECK_HP (1 << 8) | ||
#define AI_FLAG_WEATHER (1 << 9) | ||
#define AI_FLAG_HARRASSMENT (1 << 10) | ||
#define AI_FLAG_ROAMING_POKEMON (1 << 29) | ||
|
||
#define AI_INIT_SCORE_MOVE_1 (1 << 0) | ||
#define AI_INIT_SCORE_MOVE_2 (1 << 1) | ||
#define AI_INIT_SCORE_MOVE_3 (1 << 2) | ||
#define AI_INIT_SCORE_MOVE_4 (1 << 3) | ||
|
||
#define AI_INIT_SCORE_ALL_MOVES (AI_INIT_SCORE_MOVE_1 | AI_INIT_SCORE_MOVE_2 | AI_INIT_SCORE_MOVE_3 | AI_INIT_SCORE_MOVE_4) | ||
|
||
#define AI_STATUS_FLAG_DONE (1 << 0) | ||
#define AI_STATUS_FLAG_ESCAPE (1 << 1) | ||
#define AI_STATUS_FLAG_SAFARI (1 << 2) | ||
#define AI_STATUS_FLAG_BREAK (1 << 3) | ||
#define AI_STATUS_FLAG_CONTINUE (1 << 4) | ||
|
||
#define AI_STATUS_FLAG_DONE_OFF (AI_STATUS_FLAG_DONE ^ 0xFF) | ||
#define AI_STATUS_FLAG_ESCAPE_OFF (AI_STATUS_FLAG_ESCAPE ^ 0xFF) | ||
#define AI_STATUS_FLAG_SAFARI_OFF (AI_STATUS_FLAG_SAFARI ^ 0xFF) | ||
#define AI_STATUS_FLAG_BREAK_OFF (AI_STATUS_FLAG_BREAK ^ 0xFF) | ||
#define AI_STATUS_FLAG_CONTINUE_OFF (AI_STATUS_FLAG_CONTINUE ^ 0xFF) | ||
|
||
enum { | ||
AI_ENEMY_ATTACK_1 = 0, | ||
AI_ENEMY_ATTACK_2, | ||
AI_ENEMY_ATTACK_3, | ||
AI_ENEMY_ATTACK_4, | ||
AI_ENEMY_ESCAPE, | ||
AI_ENEMY_SAFARI, | ||
AI_ENEMY_SWITCH, | ||
}; | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.