forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small Ability Effect Move Block refactor #4635
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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…"); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should/can we get an enum to describe what precisely these effect numbers stand for? It's not very intuitive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not feasible. They are used all across
AbilityBattleEffects
and can mean anything.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I think we should streamline it. Out of scope for this PR of course, but it just makes it unnecessarily opaque to see what actually happens