mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
62 lines
1.6 KiB
C
62 lines
1.6 KiB
C
#include "global.h"
|
|
#include "test/battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gBattleMoves[MOVE_TELEPORT].effect == EFFECT_TELEPORT);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Teleport fails when there is no pokemon to switch in")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TELEPORT); }
|
|
} SCENE {
|
|
MESSAGE("But it failed!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Teleport fails when there no alive pokemon left")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT) { HP(0); }
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TELEPORT); }
|
|
} SCENE {
|
|
MESSAGE("But it failed!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Teleport forces the pokemon to switch out")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TELEPORT); SEND_OUT(opponent, 1); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TELEPORT, opponent);
|
|
MESSAGE("2 sent out Wynaut!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Teleport does not fail if the user is trapped")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_FIRE_SPIN); MOVE(opponent, MOVE_TELEPORT); SEND_OUT(opponent, 1); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_SPIN, player);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TELEPORT, opponent);
|
|
MESSAGE("2 sent out Wynaut!");
|
|
}
|
|
}
|