2023-11-09 19:53:14 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "test/battle.h"
|
|
|
|
#include "battle_ai_util.h"
|
|
|
|
|
|
|
|
AI_SINGLE_BATTLE_TEST("AI prefers priority moves if it's slower and can kill target")
|
|
|
|
{
|
|
|
|
GIVEN {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1);
|
2023-11-09 19:53:14 +00:00
|
|
|
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); Speed(100); }
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Speed(100); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Speed(1); Moves(MOVE_QUICK_ATTACK, MOVE_STRENGTH); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { EXPECT_MOVE(opponent, MOVE_QUICK_ATTACK); SEND_OUT(player, 1); }
|
|
|
|
} SCENE {
|
|
|
|
MESSAGE("Wobbuffet fainted!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AI_SINGLE_BATTLE_TEST("AI will choose a random move if it's faster and can kill target")
|
|
|
|
{
|
|
|
|
GIVEN {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1);
|
2023-11-09 19:53:14 +00:00
|
|
|
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); Speed(1); }
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Speed(1); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Speed(100); Moves(MOVE_QUICK_ATTACK, MOVE_STRENGTH); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { EXPECT_MOVES(opponent, MOVE_QUICK_ATTACK, MOVE_STRENGTH); SEND_OUT(player, 1); }
|
|
|
|
} SCENE {
|
|
|
|
MESSAGE("Wobbuffet fainted!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AI_SINGLE_BATTLE_TEST("AI will choose a priority move if it is slower then the target and will be killed")
|
|
|
|
{
|
|
|
|
GIVEN {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1);
|
2023-11-09 19:53:14 +00:00
|
|
|
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Speed(100); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { HP(60); Speed(1); Moves(MOVE_QUICK_ATTACK, MOVE_STRENGTH); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_STRENGTH); EXPECT_MOVE(opponent, MOVE_STRENGTH); }
|
|
|
|
TURN { MOVE(player, MOVE_STRENGTH); EXPECT_MOVE(opponent, MOVE_QUICK_ATTACK); }
|
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet fainted!");
|
2023-11-09 19:53:14 +00:00
|
|
|
}
|
|
|
|
}
|
2024-05-26 21:19:45 +01:00
|
|
|
|
|
|
|
AI_SINGLE_BATTLE_TEST("AI sees Loaded Dice damage increase from multi hit moves")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(44); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); Moves(MOVE_SEED_BOMB, MOVE_BULLET_SEED); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { EXPECT_MOVE(opponent, MOVE_BULLET_SEED); }
|
|
|
|
} SCENE {
|
|
|
|
MESSAGE("Wobbuffet fainted!");
|
|
|
|
}
|
|
|
|
}
|