forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Metronome's/Mirror Move's called move to take powder moves / mult…
…i hit moves into account (#3135)
- Loading branch information
Showing
8 changed files
with
180 additions
and
20 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
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,69 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
ASSUMPTIONS | ||
{ | ||
ASSUME(gBattleMoves[MOVE_METRONOME].effect == EFFECT_METRONOME); | ||
} | ||
|
||
// To do: Turn the seeds to work with WITH_RNG for Metronome. | ||
#define RNG_METRONOME_SCRATCH 0x118 | ||
#define RNG_METRONOME_PSN_POWDER 0x119 | ||
#define RNG_METRONOME_ROCK_BLAST 0x1F5 | ||
|
||
SINGLE_BATTLE_TEST("Metronome picks a random move") | ||
{ | ||
GIVEN { | ||
RNGSeed(RNG_METRONOME_SCRATCH); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_METRONOME); } | ||
} SCENE { | ||
MESSAGE("Wobbuffet used Metronome!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_METRONOME, player); | ||
MESSAGE("Wobbuffet used Scratch!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCRATCH, player); | ||
HP_BAR(opponent); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Metronome's called powder move fails against Grass Types") | ||
{ | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_POISON_POWDER].flags & FLAG_POWDER); | ||
ASSUME(gSpeciesInfo[SPECIES_TANGELA].types[0] == TYPE_GRASS); | ||
ASSUME(gBattleMoves[MOVE_POISON_POWDER].effect == EFFECT_POISON); | ||
RNGSeed(RNG_METRONOME_PSN_POWDER); | ||
PLAYER(SPECIES_WOBBUFFET) {Speed(5);} | ||
OPPONENT(SPECIES_TANGELA) {Speed(2);} | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_METRONOME); } | ||
} SCENE { | ||
MESSAGE("Wobbuffet used Metronome!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_METRONOME, player); | ||
MESSAGE("Wobbuffet used PoisonPowder!"); | ||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POISON_POWDER, player); | ||
MESSAGE("It doesn't affect Foe Tangela…"); | ||
NOT STATUS_ICON(opponent, poison: TRUE); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Metronome's called multi-hit move hits multiple times") | ||
{ | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_ROCK_BLAST].effect == EFFECT_MULTI_HIT); | ||
RNGSeed(RNG_METRONOME_ROCK_BLAST); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_METRONOME); } | ||
} SCENE { | ||
MESSAGE("Wobbuffet used Metronome!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_METRONOME, player); | ||
MESSAGE("Wobbuffet used Rock Blast!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_BLAST, player); | ||
HP_BAR(opponent); | ||
MESSAGE("Hit 4 time(s)!"); | ||
} | ||
} |
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,81 @@ | ||
#include "global.h" | ||
#include "test_battle.h" | ||
|
||
ASSUMPTIONS | ||
{ | ||
ASSUME(gBattleMoves[MOVE_MIRROR_MOVE].effect == EFFECT_MIRROR_MOVE); | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Mirror Move copies the last used move by the target") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET) {Speed(2);} | ||
OPPONENT(SPECIES_WOBBUFFET) {Speed(5);} | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_MIRROR_MOVE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); | ||
HP_BAR(player); | ||
MESSAGE("Wobbuffet used Mirror Move!"); | ||
MESSAGE("Wobbuffet used Tackle!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); | ||
HP_BAR(opponent); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Mirror Move fails if no move was used before") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET) {Speed(5);} | ||
OPPONENT(SPECIES_WOBBUFFET) {Speed(2);} | ||
} WHEN { | ||
TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_MIRROR_MOVE); } | ||
} SCENE { | ||
MESSAGE("Wobbuffet used Mirror Move!"); | ||
MESSAGE("The Mirror Move failed!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); | ||
HP_BAR(player); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Mirror Move's called powder move fails against Grass Types") | ||
{ | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER); | ||
ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); | ||
ASSUME(gBattleMoves[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE); | ||
PLAYER(SPECIES_ODDISH) {Speed(5);} | ||
OPPONENT(SPECIES_WOBBUFFET) {Speed(2);} | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_STUN_SPORE); MOVE(opponent, MOVE_MIRROR_MOVE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); | ||
STATUS_ICON(opponent, paralysis: TRUE); | ||
MESSAGE("Foe Wobbuffet used Mirror Move!"); | ||
MESSAGE("Foe Wobbuffet used Stun Spore!"); | ||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, opponent); | ||
MESSAGE("It doesn't affect Oddish…"); | ||
NOT STATUS_ICON(player, paralysis: TRUE); | ||
} | ||
} | ||
|
||
// It hits first 2 times, then 5 times with the default rng seed. | ||
SINGLE_BATTLE_TEST("Mirror Move's called multi-hit move hits multiple times") | ||
{ | ||
GIVEN { | ||
ASSUME(gBattleMoves[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT); | ||
PLAYER(SPECIES_WOBBUFFET) {Speed(5);} | ||
OPPONENT(SPECIES_WOBBUFFET) {Speed(2);} | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_BULLET_SEED); MOVE(opponent, MOVE_MIRROR_MOVE); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); | ||
HP_BAR(opponent); | ||
MESSAGE("Hit 2 time(s)!"); | ||
MESSAGE("Foe Wobbuffet used Mirror Move!"); | ||
MESSAGE("Foe Wobbuffet used Bullet Seed!"); | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); | ||
HP_BAR(player); | ||
MESSAGE("Hit 5 time(s)!"); | ||
} | ||
} |