2023-08-07 17:23:12 +02:00
|
|
|
#include "global.h"
|
2023-08-12 21:00:15 +02:00
|
|
|
#include "test/battle.h"
|
2023-08-07 17:23:12 +02:00
|
|
|
|
|
|
|
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!");
|
|
|
|
}
|
|
|
|
}
|