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.
Small Ability Effect Move Block refactor (#4635)
* Small Ability Effect Move Block refactor * combine tests
- Loading branch information
1 parent
e0499f8
commit 0570609
Showing
4 changed files
with
174 additions
and
22 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
|
||
ASSUMPTIONS | ||
{ | ||
ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority > 0); | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Dazzling, Queenly Majesty and Armor Tail protect the user from priority moves") | ||
{ | ||
u32 species, ability; | ||
|
||
PARAMETRIZE { species = SPECIES_BRUXISH; ability = ABILITY_DAZZLING; } | ||
PARAMETRIZE { species = SPECIES_FARIGIRAF; ability = ABILITY_ARMOR_TAIL; } | ||
PARAMETRIZE { species = SPECIES_TSAREENA; ability = ABILITY_QUEENLY_MAJESTY; } | ||
|
||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(species) { Ability(ability); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerLeft, MOVE_QUICK_ATTACK, target: opponentLeft); } | ||
} SCENE { | ||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_ATTACK, opponentRight); | ||
ABILITY_POPUP(opponentLeft, ability); | ||
MESSAGE("Wobbuffet cannot use Quick Attack!"); | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Dazzling, Queenly Majesty and Armor Tail protect users partner from priority moves") | ||
{ | ||
u32 species, ability; | ||
|
||
PARAMETRIZE { species = SPECIES_BRUXISH; ability = ABILITY_DAZZLING; } | ||
PARAMETRIZE { species = SPECIES_FARIGIRAF; ability = ABILITY_ARMOR_TAIL; } | ||
PARAMETRIZE { species = SPECIES_TSAREENA; ability = ABILITY_QUEENLY_MAJESTY; } | ||
|
||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(species) { Ability(ability); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerLeft, MOVE_QUICK_ATTACK, target: opponentRight); } | ||
} SCENE { | ||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_ATTACK, opponentRight); | ||
ABILITY_POPUP(opponentLeft, ability); | ||
MESSAGE("Wobbuffet cannot use Quick Attack!"); | ||
} | ||
} |
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,70 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
|
||
SINGLE_BATTLE_TEST("Good as Gold protects from status moves") | ||
{ | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_TOXIC].category == DAMAGE_CATEGORY_STATUS); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_TOXIC); } | ||
} SCENE { | ||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player); | ||
ABILITY_POPUP(opponent, ABILITY_GOOD_AS_GOLD); | ||
MESSAGE("It doesn't affect Foe Gholdengo…"); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Good as Gold doesn't protect the user from it's own moves") | ||
{ | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_NASTY_PLOT].category == DAMAGE_CATEGORY_STATUS); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_NASTY_PLOT); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_NASTY_PLOT, opponent); | ||
NONE_OF { | ||
ABILITY_POPUP(opponent, ABILITY_GOOD_AS_GOLD); | ||
MESSAGE("It doesn't affect Foe Gholdengo…"); | ||
} | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Good as Gold doesn't protect from moves that target the field") | ||
{ | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].category == DAMAGE_CATEGORY_STATUS); | ||
ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].target == MOVE_TARGET_OPPONENTS_FIELD); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_STEALTH_ROCK); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STEALTH_ROCK, player); | ||
NONE_OF { | ||
ABILITY_POPUP(opponent, ABILITY_GOOD_AS_GOLD); | ||
MESSAGE("It doesn't affect Foe Gholdengo…"); | ||
} | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Good as Gold protects from partner's status moves") | ||
{ | ||
GIVEN { | ||
ASSUME(gMovesInfo[MOVE_HELPING_HAND].category == DAMAGE_CATEGORY_STATUS); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponentRight, MOVE_HELPING_HAND); } | ||
} SCENE { | ||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HELPING_HAND, opponentRight); | ||
ABILITY_POPUP(opponentLeft, ABILITY_GOOD_AS_GOLD); | ||
MESSAGE("It doesn't affect Foe Gholdengo…"); | ||
} | ||
} |