forked from rh-hideout/pokeemerald-expansion
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (rh-hideout#3166)
- Loading branch information
1 parent
dd733d0
commit c0ce56b
Showing
4 changed files
with
72 additions
and
70 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!"); | ||
} | ||
} |