sovereignx/test/battle/ability/emergency_exit.c
Philipp AUER 73a1fa30e9
fix: emergency exit cutoff off by 1 on odd max hp (#4040)
* fix: emergency exit cutoff off by 1 on odd max hp

* squash!: newline at end of file

---------

Co-authored-by: sbird <sbird@no.tld>
2024-01-21 09:11:10 +01:00

20 lines
666 B
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Emergency Exit switches out when taking 50% max-hp damage")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Attack(1314); }; // will deal exactly 132 damage, putting GOLISOPOD just under half hp
OPPONENT(SPECIES_GOLISOPOD) { Ability(ABILITY_EMERGENCY_EXIT); MaxHP(263); HP(263); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_POUND);
SEND_OUT(opponent, 1);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_POUND, player);
HP_BAR(opponent);
ABILITY_POPUP(opponent, ABILITY_EMERGENCY_EXIT);
}
}