sovereignx/test/battle/ability/electromorphosis.c
Bassoonian 5cc0b35d81
Replace power checks with IS_MOVE_STATUS (#5820)
Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
2024-12-20 08:20:46 -03:00

56 lines
2 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Electromorphosis sets up Charge when hit by any move")
{
s16 dmgBefore, dmgAfter;
u16 move;
PARAMETRIZE {move = MOVE_TACKLE; }
PARAMETRIZE {move = MOVE_GUST; }
GIVEN {
ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE));
ASSUME(!IS_MOVE_STATUS(MOVE_GUST));
ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL);
ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL);
ASSUME(!IS_MOVE_STATUS(MOVE_THUNDER_SHOCK));
ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC);
PLAYER(SPECIES_BELLIBOLT) { Ability(ABILITY_ELECTROMORPHOSIS); Speed(10); }
OPPONENT(SPECIES_WOBBUFFET) {Ability(ABILITY_LIMBER); Speed(5) ;} // Limber, so it doesn't get paralyzed.
}
WHEN {
TURN { MOVE(player, MOVE_THUNDER_SHOCK), MOVE(opponent, move); }
TURN { MOVE(player, MOVE_THUNDER_SHOCK), MOVE(opponent, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDER_SHOCK, player);
HP_BAR(opponent, captureDamage: &dmgBefore);
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
HP_BAR(player);
ABILITY_POPUP(player, ABILITY_ELECTROMORPHOSIS);
if (move == MOVE_TACKLE) {
MESSAGE("Being hit by Tackle charged Bellibolt with power!");
}
else {
MESSAGE("Being hit by Gust charged Bellibolt with power!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDER_SHOCK, player);
HP_BAR(opponent, captureDamage: &dmgAfter);
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
HP_BAR(player);
ABILITY_POPUP(player, ABILITY_ELECTROMORPHOSIS);
if (move == MOVE_TACKLE) {
MESSAGE("Being hit by Tackle charged Bellibolt with power!");
}
else {
MESSAGE("Being hit by Gust charged Bellibolt with power!");
}
}
THEN {
EXPECT_MUL_EQ(dmgBefore, Q_4_12(2.0), dmgAfter);
}
}