2024-01-21 08:11:10 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "test/battle.h"
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Emergency Exit switches out when taking 50% max-hp damage")
|
|
|
|
{
|
|
|
|
GIVEN {
|
2024-01-21 10:08:25 +00:00
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_GOLISOPOD) { Ability(ABILITY_EMERGENCY_EXIT); MaxHP(263); HP(262); };
|
2024-01-21 08:11:10 +00:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
2024-01-31 12:33:04 +00:00
|
|
|
TURN { MOVE(player, MOVE_SUPER_FANG); SEND_OUT(opponent, 1); }
|
2024-01-21 08:11:10 +00:00
|
|
|
} SCENE {
|
2024-01-21 10:08:25 +00:00
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUPER_FANG, player);
|
2024-01-21 08:11:10 +00:00
|
|
|
HP_BAR(opponent);
|
|
|
|
ABILITY_POPUP(opponent, ABILITY_EMERGENCY_EXIT);
|
|
|
|
}
|
|
|
|
}
|
2024-01-21 10:08:25 +00:00
|
|
|
|
2024-01-31 12:33:04 +00:00
|
|
|
SINGLE_BATTLE_TEST("Emergency Exit does not switch out when going below 50% max-HP but healed via held item back above the threshold")
|
2024-01-21 10:08:25 +00:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET)
|
|
|
|
OPPONENT(SPECIES_GOLISOPOD) { Ability(ABILITY_EMERGENCY_EXIT); MaxHP(263); HP(262); Item(ITEM_SITRUS_BERRY); };
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
2024-01-31 12:33:04 +00:00
|
|
|
TURN { MOVE(player, MOVE_SUPER_FANG); }
|
2024-01-21 10:08:25 +00:00
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUPER_FANG, player);
|
|
|
|
HP_BAR(opponent);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
|
|
NOT ABILITY_POPUP(opponent, ABILITY_EMERGENCY_EXIT);
|
|
|
|
}
|
|
|
|
}
|
2024-01-31 12:33:04 +00:00
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Emergency Exit switches out when going below 50% max-HP but healing via held item is not enough to go back above the threshold")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET)
|
|
|
|
OPPONENT(SPECIES_GOLISOPOD) { Ability(ABILITY_EMERGENCY_EXIT); MaxHP(263); HP(133); Item(ITEM_ORAN_BERRY); };
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_SUPER_FANG); SEND_OUT(opponent, 1); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUPER_FANG, player);
|
|
|
|
HP_BAR(opponent);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
|
|
ABILITY_POPUP(opponent, ABILITY_EMERGENCY_EXIT);
|
|
|
|
}
|
|
|
|
}
|