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
Battle tests for Poison Heal, Sap Sipper and Defeatist #3181
Closed
Closed
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
ASSUMPTIONS | ||
{ | ||
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); | ||
ASSUME(gBattleMoves[MOVE_ECHOED_VOICE].split == SPLIT_SPECIAL); | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Defeatist halves Attack when HP <= 50%", s16 damage) | ||
{ | ||
u32 hp; | ||
PARAMETRIZE { hp = 400; } | ||
PARAMETRIZE { hp = 200; } | ||
GIVEN { | ||
PLAYER(SPECIES_ARCHEN) { Ability(ABILITY_DEFEATIST); HP(hp), MaxHP(400);} | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_CELEBRATE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); | ||
HP_BAR(opponent, captureDamage: &results[i].damage); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); | ||
} FINALLY { | ||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Defeatist halves Special Attack when HP <= 50%", s16 damage) | ||
{ | ||
u32 hp; | ||
PARAMETRIZE { hp = 400; } | ||
PARAMETRIZE { hp = 200; } | ||
GIVEN { | ||
PLAYER(SPECIES_ARCHEN) { Ability(ABILITY_DEFEATIST); HP(hp), MaxHP(400);} | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_ECHOED_VOICE); MOVE(opponent, MOVE_CELEBRATE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ECHOED_VOICE, player); | ||
HP_BAR(opponent, captureDamage: &results[i].damage); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); | ||
} FINALLY { | ||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage); | ||
} | ||
} |
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,62 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Poison Heal heals from Poison damage") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Status1(STATUS1_POISON); HP(1), MaxHP(400); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_CELEBRATE); } | ||
} SCENE { | ||
ABILITY_POPUP(player, ABILITY_POISON_HEAL); | ||
MESSAGE("The poisoning healed Shroomish a little bit!"); | ||
HP_BAR(player, damage: -50); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Poison Heal heals from Toxic Poison damage") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Status1(STATUS1_TOXIC_POISON); HP(1), MaxHP(400); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_CELEBRATE); } | ||
} SCENE { | ||
ABILITY_POPUP(player, ABILITY_POISON_HEAL); | ||
MESSAGE("The poisoning healed Shroomish a little bit!"); | ||
HP_BAR(player, damage: -50); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Poison Heal does not heal or cause damage when under Heal Block") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Status1(STATUS1_POISON); HP(1), MaxHP(400); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_HEAL_BLOCK); } | ||
} SCENE { | ||
NONE_OF { | ||
ABILITY_POPUP(player, ABILITY_POISON_HEAL); | ||
MESSAGE("The poisoning healed Shroomish a little bit!"); | ||
HP_BAR(player, damage: -50); | ||
} | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Poison Heal activates before Toxic Orb") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Item(ITEM_TOXIC_ORB); HP(1), MaxHP(400); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_CELEBRATE); } | ||
} SCENE { | ||
NONE_OF { | ||
ABILITY_POPUP(player, ABILITY_POISON_HEAL); | ||
MESSAGE("The poisoning healed Shroomish a little bit!"); | ||
HP_BAR(player, damage: -50); | ||
} | ||
} | ||
} |
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,55 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Sap Sipper negates damage from Grass-type moves") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_MARILL) { Ability(ABILITY_SAP_SIPPER); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_VINE_WHIP); } | ||
} SCENE { | ||
NONE_OF { HP_BAR(player); } | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Sap Sipper negates effects from Grass-type moves") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_MARILL) { Ability(ABILITY_SAP_SIPPER); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_SPORE); } | ||
} SCENE { | ||
NONE_OF { ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, player); } | ||
NONE_OF { STATUS_ICON(player, sleep: TRUE); } | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Sap Sipper increases Attack by one stage when hit by a Grass-type move") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_MARILL) { Ability(ABILITY_SAP_SIPPER); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_VINE_WHIP); } | ||
} SCENE { | ||
ABILITY_POPUP(player, ABILITY_SAP_SIPPER); | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); | ||
MESSAGE("Marill's Attack rose!"); | ||
AsparagusEduardo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Sap Sipper does not increase Attack if already maxed") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_MARILL) { Ability(ABILITY_SAP_SIPPER); } | ||
OPPONENT(SPECIES_WOBBUFFET) { Speed(1); } | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_BELLY_DRUM); MOVE(opponent, MOVE_VINE_WHIP); } | ||
} SCENE { | ||
ABILITY_POPUP(player, ABILITY_SAP_SIPPER); | ||
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } | ||
Bassoonian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
NONE_OF { MESSAGE("Marill's Attack rose!"); } | ||
} | ||
} |
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.
Let's add the canceling move messages at least.
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.
There is no explicit canceling message, since it flows into the "increases Attack" tests
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 let's add the regular messages to make it explicit how the messaging shows up. I had to look up a video to make sure.