forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Clear Amulet visual bug + Tests (#3074)
* Fix Clear Amulet visual bug + Tests TODO Tests, additional tests + Triple Kick pp bug * Wonder Guard message, switch instead of if, misalignments
- Loading branch information
1 parent
f3be4e1
commit 2009927
Showing
12 changed files
with
529 additions
and
16 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
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,38 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Clear Body prevents intimidate") | ||
{ | ||
s16 turnOneHit; | ||
s16 turnTwoHit; | ||
|
||
GIVEN { | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_SHED_SKIN); }; | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }; | ||
OPPONENT(SPECIES_BELDUM) { Ability(ABILITY_CLEAR_BODY); }; | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); } | ||
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TACKLE); } | ||
|
||
} SCENE { | ||
HP_BAR(player, captureDamage: &turnOneHit); | ||
ABILITY_POPUP(player, ABILITY_INTIMIDATE); | ||
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } | ||
ABILITY_POPUP(opponent, ABILITY_CLEAR_BODY); | ||
MESSAGE("Foe Beldum's Clear Body prevents stat loss!"); | ||
HP_BAR(player, captureDamage: &turnTwoHit); | ||
} THEN { | ||
EXPECT_EQ(turnOneHit, turnTwoHit); | ||
} | ||
} | ||
|
||
TO_DO_BATTLE_TEST("Clear Body prevents stat stage reduction from moves"); // Growl, Leer, Confide, Fake Tears, Scary Face, Sweet Scent, Sand Attack (Attack, Defense, Sp. Attack, Sp. Defense, Speed, Evasion, Accuracy | ||
TO_DO_BATTLE_TEST("Clear Body prevents Sticky Web"); | ||
TO_DO_BATTLE_TEST("Clear Body doesn't prevent stat stage reduction from moves used by the user"); // e.g. Superpower | ||
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Speed reduction from Iron Ball"); | ||
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Speed reduction from paralysis"); | ||
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Attack reduction from burn"); | ||
TO_DO_BATTLE_TEST("Clear Body doesn't prevent receiving negative stat changes from Baton Pass"); | ||
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Topsy-Turvy"); | ||
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Spectral Thief from resetting positive stat changes"); | ||
TO_DO_BATTLE_TEST("Clear Body is ignored by Mold Breaker"); |
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,38 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Full Metal Body prevents intimidate") | ||
{ | ||
s16 turnOneHit; | ||
s16 turnTwoHit; | ||
|
||
GIVEN { | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_SHED_SKIN); }; | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }; | ||
OPPONENT(SPECIES_SOLGALEO) { Ability(ABILITY_FULL_METAL_BODY); }; | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); } | ||
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TACKLE); } | ||
|
||
} SCENE { | ||
HP_BAR(player, captureDamage: &turnOneHit); | ||
ABILITY_POPUP(player, ABILITY_INTIMIDATE); | ||
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } | ||
ABILITY_POPUP(opponent, ABILITY_FULL_METAL_BODY); | ||
MESSAGE("Foe Solgaleo's Full Metal Body prevents stat loss!"); | ||
HP_BAR(player, captureDamage: &turnTwoHit); | ||
} THEN { | ||
EXPECT_EQ(turnOneHit, turnTwoHit); | ||
} | ||
} | ||
|
||
TO_DO_BATTLE_TEST("Full Metal Body prevents stat stage reduction from moves"); // Growl, Leer, Confide, Fake Tears, Scary Face, Sweet Scent, Sand Attack (Attack, Defense, Sp. Attack, Sp. Defense, Speed, Evasion, Accuracy | ||
TO_DO_BATTLE_TEST("Full Metal Body prevents Sticky Web"); | ||
TO_DO_BATTLE_TEST("Full Metal Body doesn't prevent stat stage reduction from moves used by the user"); // e.g. Superpower | ||
TO_DO_BATTLE_TEST("Full Metal Body doesn't prevent Speed reduction from Iron Ball"); | ||
TO_DO_BATTLE_TEST("Full Metal Body doesn't prevent Speed reduction from paralysis"); | ||
TO_DO_BATTLE_TEST("Full Metal Body doesn't prevent Attack reduction from burn"); | ||
TO_DO_BATTLE_TEST("Full Metal Body doesn't prevent receiving negative stat changes from Baton Pass"); | ||
TO_DO_BATTLE_TEST("Full Metal Body doesn't prevent Topsy-Turvy"); | ||
TO_DO_BATTLE_TEST("Full Metal Body doesn't prevent Spectral Thief from resetting positive stat changes"); | ||
TO_DO_BATTLE_TEST("Full Metal Body is ignored by Mold Breaker"); |
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,35 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Hyper Cutter prevents intimidate") | ||
{ | ||
s16 turnOneHit; | ||
s16 turnTwoHit; | ||
|
||
GIVEN { | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_SHED_SKIN); }; | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }; | ||
OPPONENT(SPECIES_KRABBY) { Ability(ABILITY_HYPER_CUTTER); }; | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); } | ||
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TACKLE); } | ||
|
||
} SCENE { | ||
HP_BAR(player, captureDamage: &turnOneHit); | ||
ABILITY_POPUP(player, ABILITY_INTIMIDATE); | ||
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } | ||
ABILITY_POPUP(opponent, ABILITY_HYPER_CUTTER); | ||
MESSAGE("Foe Krabby's Attack was not lowered!"); | ||
HP_BAR(player, captureDamage: &turnTwoHit); | ||
} THEN { | ||
EXPECT_EQ(turnOneHit, turnTwoHit); | ||
} | ||
} | ||
|
||
TO_DO_BATTLE_TEST("Hyper Cutter prevents Attack stage reduction from moves"); // Growl | ||
TO_DO_BATTLE_TEST("Hyper Cutter doesn't prevent Attack stage reduction from moves used by the user"); // e.g. Superpower | ||
TO_DO_BATTLE_TEST("Hyper Cutter doesn't prevent Attack reduction from burn"); | ||
TO_DO_BATTLE_TEST("Hyper Cutter doesn't prevent receiving negative Attack stage changes from Baton Pass"); | ||
TO_DO_BATTLE_TEST("Hyper Cutter doesn't prevent Topsy-Turvy"); | ||
TO_DO_BATTLE_TEST("Hyper Cutter doesn't prevent Spectral Thief from resetting positive Attack stage changes"); | ||
TO_DO_BATTLE_TEST("Hyper Cutter is ignored by Mold Breaker"); |
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,57 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Inner Focus prevents intimidate") | ||
{ | ||
s16 turnOneHit; | ||
s16 turnTwoHit; | ||
|
||
GIVEN { | ||
ASSUME(B_UPDATED_INTIMIDATE >= GEN_8); | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_SHED_SKIN); }; | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }; | ||
OPPONENT(SPECIES_ZUBAT) { Ability(ABILITY_INNER_FOCUS); }; | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); } | ||
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TACKLE); } | ||
|
||
} SCENE { | ||
HP_BAR(player, captureDamage: &turnOneHit); | ||
ABILITY_POPUP(player, ABILITY_INTIMIDATE); | ||
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } | ||
ABILITY_POPUP(opponent, ABILITY_INNER_FOCUS); | ||
MESSAGE("Foe Zubat's Attack was not lowered!"); | ||
HP_BAR(player, captureDamage: &turnTwoHit); | ||
} THEN { | ||
EXPECT_EQ(turnOneHit, turnTwoHit); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Inner Focus prevents flinching") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_ZUBAT) { Ability(ABILITY_INNER_FOCUS); }; | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_FAKE_OUT); | ||
MOVE(opponent, MOVE_TACKLE); | ||
} | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_FAKE_OUT, player); | ||
NONE_OF { MESSAGE("Foe Zubat flinched!"); } | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Inner Focus is ignored by Mold Breaker") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); }; | ||
OPPONENT(SPECIES_ZUBAT) { Ability(ABILITY_INNER_FOCUS); }; | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_FAKE_OUT); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_FAKE_OUT, player); | ||
MESSAGE("Foe Zubat flinched!"); | ||
} | ||
} |
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,119 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Own Tempo prevents intimidate") | ||
{ | ||
s16 turnOneHit; | ||
s16 turnTwoHit; | ||
|
||
GIVEN { | ||
ASSUME(B_UPDATED_INTIMIDATE >= GEN_8); | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_SHED_SKIN); }; | ||
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }; | ||
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); } | ||
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TACKLE); } | ||
|
||
} SCENE { | ||
HP_BAR(player, captureDamage: &turnOneHit); | ||
ABILITY_POPUP(player, ABILITY_INTIMIDATE); | ||
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } | ||
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO); | ||
MESSAGE("Foe Slowpoke's Attack was not lowered!"); | ||
HP_BAR(player, captureDamage: &turnTwoHit); | ||
} THEN { | ||
EXPECT_EQ(turnOneHit, turnTwoHit); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Own Tempo prevents confusion from moves by the opponent") | ||
{ | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_CONFUSE_RAY); } | ||
} SCENE { | ||
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO); | ||
MESSAGE("Foe Slowpoke's Own Tempo prevents confusion!"); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Own Tempo prevents confusion from moves by the user") | ||
{ | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_PETAL_DANCE].effect == EFFECT_RAMPAGE); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_PETAL_DANCE); } | ||
TURN { MOVE(opponent, MOVE_PETAL_DANCE); } | ||
TURN { MOVE(opponent, MOVE_PETAL_DANCE); } | ||
TURN { MOVE(opponent, MOVE_PETAL_DANCE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent); | ||
NONE_OF { MESSAGE("Foe Slowpoke became confused due to fatigue!"); } | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Own Tempo cures confusion obtained from an opponent with Mold Breaker") | ||
{ | ||
KNOWN_FAILING; | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); | ||
PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); }; | ||
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_CONFUSE_RAY); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFUSE_RAY, player); | ||
MESSAGE("Foe Slowpoke became confused!"); | ||
NONE_OF { | ||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponent); | ||
} | ||
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO); | ||
MESSAGE("Foe Slowpoke's Own Tempo cured its confusion problem!"); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Own Tempo cures confusion if it's obtained via Skill Swap") | ||
{ | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); | ||
ASSUME(gBattleMoves[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP); | ||
PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_CONFUSE_RAY); } | ||
TURN { MOVE(player, MOVE_SKILL_SWAP); | ||
MOVE(opponent, MOVE_TACKLE); | ||
} | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFUSE_RAY, player); | ||
MESSAGE("Foe Wobbuffet became confused!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, player); | ||
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO); | ||
MESSAGE("Foe Wobbuffet's Own Tempo cured its confusion problem!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Own Tempo prevents confusion from items") | ||
{ | ||
GIVEN { | ||
ASSUME(gItems[ITEM_BERSERK_GENE].holdEffect == HOLD_EFFECT_BERSERK_GENE); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); Item(ITEM_BERSERK_GENE); }; | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); | ||
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); | ||
} | ||
} |
Oops, something went wrong.