pokeemerald/test/move_effect_double_shock.c
2023-04-30 10:46:21 -04:00

54 lines
1.7 KiB
C

#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_DOUBLE_SHOCK].effect == EFFECT_DOUBLE_SHOCK);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC);
ASSUME(gSpeciesInfo[SPECIES_PIKACHU].types[0] == TYPE_ELECTRIC || gSpeciesInfo[SPECIES_PIKACHU].types[1] == TYPE_ELECTRIC);
}
SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type")
{
GIVEN {
PLAYER(SPECIES_PIKACHU);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player);
MESSAGE("Pikachu used up all of its electricity!");
MESSAGE("Pikachu used Double Shock!");
MESSAGE("But it failed!");
}
}
SINGLE_BATTLE_TEST("Double Shock fails if the user isn't an Electric-type")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player); }
MESSAGE("Wobbuffet used Double Shock!");
MESSAGE("But it failed!");
}
}
SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type if enemy faints")
{
GIVEN {
PLAYER(SPECIES_PIKACHU);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player);
HP_BAR(opponent, hp: 0);
MESSAGE("Pikachu used up all of its electricity!");
}
}