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.
Added missing tests + Fix Coaching/Crafty Shield interaction (#5796)
Co-authored-by: hedara90 <[email protected]>
- Loading branch information
1 parent
5477033
commit 7eee3b3
Showing
5 changed files
with
168 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,120 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
TO_DO_BATTLE_TEST("Coaching raises Attack and Defense of ally by 1 stage each"); | ||
TO_DO_BATTLE_TEST("Coaching doesn't raise stats of the user"); | ||
TO_DO_BATTLE_TEST("Coaching bypasses protection of allies"); | ||
TO_DO_BATTLE_TEST("Coaching fails in single battles"); | ||
TO_DO_BATTLE_TEST("Coaching fails if there's no ally"); | ||
ASSUMPTIONS | ||
{ | ||
ASSUME(gMovesInfo[MOVE_COACHING].effect == EFFECT_COACHING); | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Coaching raises Attack and Defense of ally by 1 stage each") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_WYNAUT); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerLeft, MOVE_COACHING, target: playerRight); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_COACHING, playerLeft); | ||
MESSAGE("Wynaut's Attack rose!"); | ||
MESSAGE("Wynaut's Defense rose!"); | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Coaching bypasses Protect") | ||
{ | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_PROTECT].effect == EFFECT_PROTECT); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_WYNAUT); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerRight, MOVE_PROTECT); MOVE(playerLeft, MOVE_COACHING, target: playerRight); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_COACHING, playerLeft); | ||
MESSAGE("Wynaut's Attack rose!"); | ||
MESSAGE("Wynaut's Defense rose!"); | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Coaching bypasses Crafty Shield") | ||
{ | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_CRAFTY_SHIELD].effect == EFFECT_PROTECT); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_WYNAUT); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerRight, MOVE_CRAFTY_SHIELD); MOVE(playerLeft, MOVE_COACHING, target: playerRight); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_COACHING, playerLeft); | ||
MESSAGE("Wynaut's Attack rose!"); | ||
MESSAGE("Wynaut's Defense rose!"); | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Coaching fails if all allies are is semi-invulnerable") | ||
{ | ||
KNOWN_FAILING; // Coaching succeeds | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_FLY].effect == EFFECT_SEMI_INVULNERABLE); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_HAWLUCHA); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerRight, MOVE_FLY, target: opponentLeft); MOVE(playerLeft, MOVE_COACHING, target: playerRight); } | ||
} SCENE { | ||
MESSAGE("Hawlucha used Fly!"); | ||
MESSAGE("Wobbuffet used Coaching!"); | ||
NONE_OF { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_COACHING, playerLeft); | ||
MESSAGE("Hawlucha's Attack rose!"); | ||
MESSAGE("Hawlucha's Defense rose!"); | ||
} | ||
MESSAGE("But it failed!"); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Coaching fails in single battles") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_COACHING); } | ||
} SCENE { | ||
MESSAGE("But it failed!"); | ||
NONE_OF { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_COACHING, player); | ||
MESSAGE("Wynaut's Attack rose!"); | ||
MESSAGE("Wynaut's Defense rose!"); | ||
} | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Coaching fails if there's no ally") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_WYNAUT) { HP(1); }; | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerLeft, MOVE_TACKLE, target: playerRight); } | ||
TURN { MOVE(playerLeft, MOVE_COACHING, target: playerRight); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerLeft); | ||
MESSAGE("Wynaut fainted!"); | ||
MESSAGE("Wobbuffet used Coaching!"); | ||
NONE_OF { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_COACHING, playerLeft); | ||
MESSAGE("Wynaut's Attack rose!"); | ||
MESSAGE("Wynaut's Defense rose!"); | ||
} | ||
MESSAGE("But it failed!"); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,21 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
TO_DO_BATTLE_TEST("Cosmic Power increases the user's Defense and Sp. Defense by 1 stage each"); | ||
ASSUMPTIONS | ||
{ | ||
ASSUME(gMovesInfo[MOVE_COSMIC_POWER].effect == EFFECT_COSMIC_POWER); | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Cosmic Power increases the user's Defense and Sp. Defense by 1 stage each") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_COSMIC_POWER); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_COSMIC_POWER, player); | ||
MESSAGE("Wobbuffet's Defense rose!"); | ||
MESSAGE("Wobbuffet's Sp. Def rose!"); | ||
} | ||
} |
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