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.
- Loading branch information
1 parent
88cdd8b
commit 0cd0e0b
Showing
2 changed files
with
74 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
ASSUMPTIONS | ||
{ | ||
ASSUME(gItemsInfo[ITEM_BLUNDER_POLICY].holdEffect == HOLD_EFFECT_BLUNDER_POLICY); | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Blunder Policy raises the users speed by 2 stages if the user misses") | ||
{ | ||
PASSES_RANDOMLY(3, 10, RNG_ACCURACY); | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); | ||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_FOCUS_BLAST); } | ||
} SCENE { | ||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_FOCUS_BLAST, player); | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); | ||
} THEN { | ||
EXPECT(player->item == ITEM_NONE); | ||
EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 2); | ||
} | ||
} | ||
|
||
|
||
SINGLE_BATTLE_TEST("Blunder Policy will never trigger if the move fails due to an immunity") | ||
{ | ||
PASSES_RANDOMLY(10, 10, RNG_ACCURACY); | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); | ||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } | ||
OPPONENT(SPECIES_GASTLY); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_FOCUS_BLAST); } | ||
} SCENE { | ||
NONE_OF { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_FOCUS_BLAST, player); | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); | ||
} | ||
} THEN { | ||
EXPECT(player->item == ITEM_BLUNDER_POLICY); | ||
EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Blunder Policy will never trigger if the move fails due to Protect") | ||
{ | ||
PASSES_RANDOMLY(10, 10, RNG_ACCURACY); | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); | ||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_PROTECT); MOVE(player, MOVE_FOCUS_BLAST); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, opponent); | ||
NONE_OF { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_FOCUS_BLAST, player); | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); | ||
} | ||
} THEN { | ||
EXPECT(player->item == ITEM_BLUNDER_POLICY); | ||
EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); | ||
} | ||
} |