mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-29 13:50:42 +01:00
666e59b37f
The original implementation of forcerandomswitch was biased towards certain party members.
71 lines
1.8 KiB
C
71 lines
1.8 KiB
C
#include "global.h"
|
|
#include "test_battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gBattleMoves[MOVE_ROAR].effect == EFFECT_ROAR);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Roar switches the target with a random non-fainted replacement")
|
|
{
|
|
PASSES_RANDOMLY(1, 2);
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_BULBASAUR);
|
|
OPPONENT(SPECIES_CHARMANDER);
|
|
OPPONENT(SPECIES_SQUIRTLE) { HP(0); }
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_ROAR); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROAR, player);
|
|
MESSAGE("Foe Bulbasaur was dragged out!");
|
|
}
|
|
}
|
|
|
|
DOUBLE_BATTLE_TEST("Roar switches the target with a random non-battler, non-fainted replacement")
|
|
{
|
|
PASSES_RANDOMLY(1, 2);
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
PLAYER(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_BULBASAUR);
|
|
OPPONENT(SPECIES_CHARMANDER);
|
|
OPPONENT(SPECIES_SQUIRTLE) { HP(0); }
|
|
} WHEN {
|
|
TURN { MOVE(playerLeft, MOVE_ROAR, target: opponentRight); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROAR, playerLeft);
|
|
MESSAGE("Foe Bulbasaur was dragged out!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Roar fails if no replacements")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_ROAR); }
|
|
} SCENE {
|
|
MESSAGE("Wobbuffet used Roar!");
|
|
MESSAGE("But it failed!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Roar fails if replacements fainted")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT) { HP(0); }
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_ROAR); }
|
|
} SCENE {
|
|
MESSAGE("Wobbuffet used Roar!");
|
|
MESSAGE("But it failed!");
|
|
}
|
|
}
|