db24128ee3
Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
22 lines
709 B
C
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);
|
|
}
|
|
}
|