sovereignx/test/battle/ability/aftermath.c
kittenchilly db24128ee3
Update battle messages to Gen 5+ standards (#3240)
Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
2024-10-21 14:52:45 -03:00

22 lines
709 B
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Aftermath damages the attacker by 1/4th of its max HP if fainted by a contact move")
{
s16 aftermathDamage;
GIVEN {
PLAYER(SPECIES_VOLTORB) { HP(1); Ability(ABILITY_AFTERMATH); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {MOVE(opponent, MOVE_TACKLE);}
} SCENE {
MESSAGE("The opposing Wobbuffet used Tackle!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
MESSAGE("Voltorb fainted!");
ABILITY_POPUP(player, ABILITY_AFTERMATH);
HP_BAR(opponent, captureDamage: &aftermathDamage);
} THEN {
EXPECT_EQ(aftermathDamage, opponent->maxHP / 4);
}
}