forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Teleport ending trainer battles (#3166)
- Loading branch information
1 parent
1fb42e4
commit 42992ca
Showing
4 changed files
with
74 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#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!"); | ||
} | ||
} |