From 55f0d3aad5a420d2903b51ffc3655bc30bb0d7e8 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 1 Jan 2025 12:06:20 -0300 Subject: [PATCH] Added missing Move Effect TODO tests - Volume E (#5915) Co-authored-by: Bassoonian --- test/battle/ability/electric_surge.c | 4 + test/battle/ability/grassy_surge.c | 4 + test/battle/ability/mimicry.c | 72 +++++++++ test/battle/ability/misty_surge.c | 4 + test/battle/ability/psychic_surge.c | 4 + test/battle/gimmick/dynamax.c | 35 ---- test/battle/hold_effect/seeds.c | 62 +++++++ test/battle/move_effect/beak_blast.c | 1 + test/battle/move_effect/echoed_voice.c | 7 + .../electric_terrain.c} | 19 --- test/battle/move_effect/electrify.c | 5 + test/battle/move_effect/electro_ball.c | 5 + test/battle/move_effect/encore.c | 152 +++++++++--------- test/battle/move_effect/endeavor.c | 6 + test/battle/move_effect/endure.c | 35 ++++ test/battle/move_effect/entrainment.c | 6 + test/battle/move_effect/evasion_down.c | 4 + test/battle/move_effect/evasion_down_2.c | 4 + test/battle/move_effect/evasion_up.c | 2 +- test/battle/move_effect/evasion_up_2.c | 28 ++++ test/battle/move_effect/expanding_force.c | 4 + test/battle/move_effect/extreme_evoboost.c | 4 + .../grassy.c => move_effect/grassy_terrain.c} | 19 --- .../move_effect/hit_set_remove_terrain.c | 36 +---- .../misty.c => move_effect/misty_terrain.c} | 19 --- test/battle/move_effect/multi_hit.c | 24 --- .../psychic_terrain.c} | 19 --- .../terrain.c} | 0 28 files changed, 341 insertions(+), 243 deletions(-) create mode 100644 test/battle/ability/electric_surge.c create mode 100644 test/battle/ability/grassy_surge.c create mode 100644 test/battle/ability/mimicry.c create mode 100644 test/battle/ability/misty_surge.c create mode 100644 test/battle/ability/psychic_surge.c create mode 100644 test/battle/hold_effect/seeds.c create mode 100644 test/battle/move_effect/echoed_voice.c rename test/battle/{terrain/electric.c => move_effect/electric_terrain.c} (74%) create mode 100644 test/battle/move_effect/electrify.c create mode 100644 test/battle/move_effect/electro_ball.c create mode 100644 test/battle/move_effect/endeavor.c create mode 100644 test/battle/move_effect/endure.c create mode 100644 test/battle/move_effect/entrainment.c create mode 100644 test/battle/move_effect/evasion_down.c create mode 100644 test/battle/move_effect/evasion_down_2.c create mode 100644 test/battle/move_effect/evasion_up_2.c create mode 100644 test/battle/move_effect/expanding_force.c create mode 100644 test/battle/move_effect/extreme_evoboost.c rename test/battle/{terrain/grassy.c => move_effect/grassy_terrain.c} (80%) rename test/battle/{terrain/misty.c => move_effect/misty_terrain.c} (78%) rename test/battle/{terrain/psychic.c => move_effect/psychic_terrain.c} (84%) rename test/battle/{terrain/starting_terrain.c => starting_status/terrain.c} (100%) diff --git a/test/battle/ability/electric_surge.c b/test/battle/ability/electric_surge.c new file mode 100644 index 0000000000..3509f1c687 --- /dev/null +++ b/test/battle/ability/electric_surge.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Electric Surge creates Electric Terrain when entering the battle"); diff --git a/test/battle/ability/grassy_surge.c b/test/battle/ability/grassy_surge.c new file mode 100644 index 0000000000..ccdb471d9f --- /dev/null +++ b/test/battle/ability/grassy_surge.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Grassy Surge creates Grassy Terrain when entering the battle"); diff --git a/test/battle/ability/mimicry.c b/test/battle/ability/mimicry.c new file mode 100644 index 0000000000..fbdb5cf98a --- /dev/null +++ b/test/battle/ability/mimicry.c @@ -0,0 +1,72 @@ +#include "global.h" +#include "test/battle.h" + +static const u16 terrainData[][2] = +{ + { MOVE_ELECTRIC_TERRAIN, TYPE_ELECTRIC, }, + { MOVE_PSYCHIC_TERRAIN, TYPE_PSYCHIC, }, + { MOVE_GRASSY_TERRAIN, TYPE_GRASS, }, + { MOVE_MISTY_TERRAIN, TYPE_FAIRY, }, +}; + +SINGLE_BATTLE_TEST("Mimicry changes the battler's type based on Terrain") +{ + u32 j; + u32 terrainMove = MOVE_NONE; + u32 terrainType = TYPE_NONE; + + for (j = 0; j < ARRAY_COUNT(terrainData); j++) + PARAMETRIZE { terrainMove = terrainData[j][0]; terrainType = terrainData[j][1]; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_STUNFISK_GALAR) { Ability(ABILITY_MIMICRY); } + } WHEN { + TURN { MOVE(player, terrainMove); } + } SCENE { + ABILITY_POPUP(opponent); + switch (terrainMove) + { + case MOVE_ELECTRIC_TERRAIN: MESSAGE("The opposing Stunfisk's type changed to Electric!"); break; + case MOVE_PSYCHIC_TERRAIN: MESSAGE("The opposing Stunfisk's type changed to Psychic!"); break; + case MOVE_GRASSY_TERRAIN: MESSAGE("The opposing Stunfisk's type changed to Grass!"); break; + case MOVE_MISTY_TERRAIN: MESSAGE("The opposing Stunfisk's type changed to Fairy!"); break; + } + } THEN { + EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[0], terrainType); + EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[1], terrainType); + } +} + +SINGLE_BATTLE_TEST("Mimicry restores the battler's types when terrain is removed by Steel Roller and Ice Spinner") +{ + u32 j; + u32 terrainMove = MOVE_NONE; + u32 removeTerrainMove = MOVE_NONE; + + for (j = 0; j < ARRAY_COUNT(terrainData); j++) + { + PARAMETRIZE { removeTerrainMove = MOVE_STEEL_ROLLER; terrainMove = terrainData[j][0]; } + PARAMETRIZE { removeTerrainMove = MOVE_ICE_SPINNER; terrainMove = terrainData[j][0]; } + } + + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_STUNFISK_GALAR].types[0] == TYPE_GROUND); + ASSUME(gSpeciesInfo[SPECIES_STUNFISK_GALAR].types[1] == TYPE_STEEL); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_STUNFISK_GALAR) { Ability(ABILITY_MIMICRY); } + } WHEN { + TURN { MOVE(opponent, terrainMove); MOVE(player, removeTerrainMove); } + } SCENE { + switch (terrainMove) + { + case MOVE_ELECTRIC_TERRAIN: MESSAGE("The electricity disappeared from the battlefield."); break; + case MOVE_PSYCHIC_TERRAIN: MESSAGE("The weirdness disappeared from the battlefield!"); break; + case MOVE_GRASSY_TERRAIN: MESSAGE("The grass disappeared from the battlefield."); break; + case MOVE_MISTY_TERRAIN: MESSAGE("The mist disappeared from the battlefield."); break; + } + } THEN { + EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[0], TYPE_GROUND); + EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[1], TYPE_STEEL); + } +} diff --git a/test/battle/ability/misty_surge.c b/test/battle/ability/misty_surge.c new file mode 100644 index 0000000000..229d26c3ba --- /dev/null +++ b/test/battle/ability/misty_surge.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Misty Surge creates Misty Terrain when entering the battle"); diff --git a/test/battle/ability/psychic_surge.c b/test/battle/ability/psychic_surge.c new file mode 100644 index 0000000000..d840e8d440 --- /dev/null +++ b/test/battle/ability/psychic_surge.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Psychic Surge creates Psychic Terrain when entering the battle"); diff --git a/test/battle/gimmick/dynamax.c b/test/battle/gimmick/dynamax.c index 33199a77fe..f910f551a4 100644 --- a/test/battle/gimmick/dynamax.c +++ b/test/battle/gimmick/dynamax.c @@ -227,41 +227,6 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon can have their ability changed o } } -SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon are immune to Encore") -{ - GIVEN { - PLAYER(SPECIES_WOBBUFFET); - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(player, MOVE_TACKLE, gimmick: GIMMICK_DYNAMAX); MOVE(opponent, MOVE_ENCORE); } - TURN { MOVE(player, MOVE_EMBER); } - } SCENE { - MESSAGE("Wobbuffet used Max Strike!"); - MESSAGE("The opposing Wobbuffet used Encore!"); - MESSAGE("But it failed!"); - MESSAGE("Wobbuffet used Max Flare!"); - } -} - -SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon can be encored immediately after reverting") -{ - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Speed(50); }; // yes, this speed is necessary - OPPONENT(SPECIES_WOBBUFFET) { Speed(100); }; - } WHEN { - TURN { MOVE(player, MOVE_ARM_THRUST, gimmick: GIMMICK_DYNAMAX); } - TURN { MOVE(player, MOVE_ARM_THRUST); } - TURN { MOVE(player, MOVE_ARM_THRUST); } - TURN { MOVE(opponent, MOVE_ENCORE); MOVE(player, MOVE_TACKLE); } - } SCENE { - MESSAGE("Wobbuffet used Max Knuckle!"); - MESSAGE("Wobbuffet used Max Knuckle!"); - MESSAGE("Wobbuffet used Max Knuckle!"); - MESSAGE("The opposing Wobbuffet used Encore!"); - MESSAGE("Wobbuffet used Arm Thrust!"); - } -} - // Max Moves don't make contact, so Cursed Body doesn't need to be tested, but it is coded for. SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon's Max Moves cannot be disabled") { diff --git a/test/battle/hold_effect/seeds.c b/test/battle/hold_effect/seeds.c new file mode 100644 index 0000000000..10a415bd63 --- /dev/null +++ b/test/battle/hold_effect/seeds.c @@ -0,0 +1,62 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Electric Seed raises the holder's Defense on Electric Terrain") +{ + GIVEN { + ASSUME(gItemsInfo[ITEM_ELECTRIC_SEED].holdEffect == HOLD_EFFECT_SEEDS); + ASSUME(gItemsInfo[ITEM_ELECTRIC_SEED].holdEffectParam == HOLD_EFFECT_PARAM_ELECTRIC_TERRAIN); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_ELECTRIC_SEED); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Using Electric Seed, the Defense of Wobbuffet rose!"); + } +} + +SINGLE_BATTLE_TEST("Grassy Seed raises the holder's Defense on Grassy Terrain") +{ + GIVEN { + ASSUME(gItemsInfo[ITEM_GRASSY_SEED].holdEffect == HOLD_EFFECT_SEEDS); + ASSUME(gItemsInfo[ITEM_GRASSY_SEED].holdEffectParam == HOLD_EFFECT_PARAM_GRASSY_TERRAIN); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_GRASSY_SEED); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_GRASSY_TERRAIN); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Using Grassy Seed, the Defense of Wobbuffet rose!"); + } +} + +SINGLE_BATTLE_TEST("Misty Seed raises the holder's Sp. Defense on Misty Terrain") +{ + GIVEN { + ASSUME(gItemsInfo[ITEM_MISTY_SEED].holdEffect == HOLD_EFFECT_SEEDS); + ASSUME(gItemsInfo[ITEM_MISTY_SEED].holdEffectParam == HOLD_EFFECT_PARAM_MISTY_TERRAIN); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_MISTY_SEED); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_MISTY_TERRAIN); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Using Misty Seed, the Sp. Def of Wobbuffet rose!"); + } +} + +SINGLE_BATTLE_TEST("Psychic Seed raises the holder's Sp. Defense on Psychic Terrain") +{ + GIVEN { + ASSUME(gItemsInfo[ITEM_PSYCHIC_SEED].holdEffect == HOLD_EFFECT_SEEDS); + ASSUME(gItemsInfo[ITEM_PSYCHIC_SEED].holdEffectParam == HOLD_EFFECT_PARAM_PSYCHIC_TERRAIN); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_PSYCHIC_SEED); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Using Psychic Seed, the Sp. Def of Wobbuffet rose!"); + } +} diff --git a/test/battle/move_effect/beak_blast.c b/test/battle/move_effect/beak_blast.c index e716b7717f..a07b28f992 100644 --- a/test/battle/move_effect/beak_blast.c +++ b/test/battle/move_effect/beak_blast.c @@ -113,4 +113,5 @@ SINGLE_BATTLE_TEST("Beak Blast burns only when contact moves are used") } TO_DO_BATTLE_TEST("Beak Blast's charging message is shown regardless if it would've missed"); +TO_DO_BATTLE_TEST("Beak Blast fails if it's forced by Encore after choosing a different move"); TO_DO_BATTLE_TEST("Bulletproof is immune to Beak Blast but not to the burn it causes"); diff --git a/test/battle/move_effect/echoed_voice.c b/test/battle/move_effect/echoed_voice.c new file mode 100644 index 0000000000..3c36270454 --- /dev/null +++ b/test/battle/move_effect/echoed_voice.c @@ -0,0 +1,7 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Echoed Voice's power is multiplied for every consecutive turn used, capped at 5"); +TO_DO_BATTLE_TEST("Echoed Voice's power is reset when using a different move"); +TO_DO_BATTLE_TEST("Echoed Voice's power is increased even if it misses"); +TO_DO_BATTLE_TEST("Echoed Voice's power is increased even if it's blocked by Protect"); diff --git a/test/battle/terrain/electric.c b/test/battle/move_effect/electric_terrain.c similarity index 74% rename from test/battle/terrain/electric.c rename to test/battle/move_effect/electric_terrain.c index b3811d056c..bf6d2536e6 100644 --- a/test/battle/terrain/electric.c +++ b/test/battle/move_effect/electric_terrain.c @@ -19,25 +19,6 @@ SINGLE_BATTLE_TEST("Electric Terrain protects grounded battlers from falling asl } } -SINGLE_BATTLE_TEST("Electric Terrain activates Electric Seed and Mimicry") -{ - GIVEN { - ASSUME(gItemsInfo[ITEM_ELECTRIC_SEED].holdEffect == HOLD_EFFECT_SEEDS); - ASSUME(gItemsInfo[ITEM_ELECTRIC_SEED].holdEffectParam == HOLD_EFFECT_PARAM_ELECTRIC_TERRAIN); - PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_ELECTRIC_SEED); } - OPPONENT(SPECIES_STUNFISK_GALAR) { Ability(ABILITY_MIMICRY); } - } WHEN { - TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); } - } SCENE { - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); - MESSAGE("Using Electric Seed, the Defense of Wobbuffet rose!"); - ABILITY_POPUP(opponent); - MESSAGE("The opposing Stunfisk's type changed to Electric!"); - } THEN { - EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[0], TYPE_ELECTRIC); - } -} - SINGLE_BATTLE_TEST("Electric Terrain increases power of Electric-type moves by 30/50 percent", s16 damage) { bool32 terrain; diff --git a/test/battle/move_effect/electrify.c b/test/battle/move_effect/electrify.c new file mode 100644 index 0000000000..71373cdd58 --- /dev/null +++ b/test/battle/move_effect/electrify.c @@ -0,0 +1,5 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Electrify makes the target's move Electric-type for the remainder of the turn"); +TO_DO_BATTLE_TEST("Electrify can change status moves to Electric-type"); // Test type immunity diff --git a/test/battle/move_effect/electro_ball.c b/test/battle/move_effect/electro_ball.c new file mode 100644 index 0000000000..a74445c00c --- /dev/null +++ b/test/battle/move_effect/electro_ball.c @@ -0,0 +1,5 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Electro Ball inflicts more damage the faster the user is compared to the target"); +TO_DO_BATTLE_TEST("Electro Ball considers speed modifiers"); // Stat modifiers, paralysis, Iron Ball, Abilities diff --git a/test/battle/move_effect/encore.c b/test/battle/move_effect/encore.c index ec68297ca0..dc7968b2a5 100644 --- a/test/battle/move_effect/encore.c +++ b/test/battle/move_effect/encore.c @@ -6,91 +6,56 @@ ASSUMPTIONS ASSUME(gMovesInfo[MOVE_ENCORE].effect == EFFECT_ENCORE); } -SINGLE_BATTLE_TEST("Encore forces consecutive move uses for 3 turns for player: Encore used before move") +SINGLE_BATTLE_TEST("Encore forces consecutive move uses for 3 turns: Encore used before move") { + struct BattlePokemon *encoreUser = NULL; + struct BattlePokemon *encoreTarget = NULL; + u32 speedPlayer, speedOpponent; + PARAMETRIZE { encoreUser = opponent; encoreTarget = player; speedPlayer = 10; speedOpponent = 20; } + PARAMETRIZE { encoreUser = player; encoreTarget = opponent; speedPlayer = 20; speedOpponent = 10; } GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Speed(10); } - OPPONENT(SPECIES_WOBBUFFET) { Speed(20); } + PLAYER(SPECIES_WOBBUFFET) { Speed(speedPlayer); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(speedOpponent); } } WHEN { - TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_CELEBRATE); } - TURN { MOVE(opponent, MOVE_ENCORE); MOVE(player, MOVE_CELEBRATE); } - // TURN { FORCED_MOVE(player); } - TURN { FORCED_MOVE(player); } - TURN { FORCED_MOVE(player); } - TURN { MOVE(player, MOVE_SPLASH); } + TURN { MOVE(encoreUser, MOVE_CELEBRATE); MOVE(encoreTarget, MOVE_CELEBRATE); } + TURN { MOVE(encoreUser, MOVE_ENCORE); MOVE(encoreTarget, MOVE_CELEBRATE); } + TURN { FORCED_MOVE(encoreTarget); } + TURN { FORCED_MOVE(encoreTarget); } + TURN { MOVE(encoreTarget, MOVE_SPLASH); } } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_ENCORE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SPLASH, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreUser); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ENCORE, encoreUser); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPLASH, encoreTarget); } } SINGLE_BATTLE_TEST("Encore forces consecutive move uses for 3 turns for player: Encore used after move") { + struct BattlePokemon *encoreUser = NULL; + struct BattlePokemon *encoreTarget = NULL; + u32 speedPlayer, speedOpponent; + PARAMETRIZE { encoreUser = opponent; encoreTarget = player; speedPlayer = 20; speedOpponent = 10; } + PARAMETRIZE { encoreUser = player; encoreTarget = opponent; speedPlayer = 10; speedOpponent = 20; } GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Speed(20); } - OPPONENT(SPECIES_WOBBUFFET) { Speed(10); } + PLAYER(SPECIES_WOBBUFFET) { Speed(speedPlayer); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(speedOpponent); } } WHEN { - TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_ENCORE); } - TURN { FORCED_MOVE(player); } - TURN { FORCED_MOVE(player); } - TURN { FORCED_MOVE(player); } - TURN { MOVE(player, MOVE_SPLASH); } + TURN { MOVE(encoreTarget, MOVE_CELEBRATE); MOVE(encoreUser, MOVE_ENCORE); } + TURN { FORCED_MOVE(encoreTarget); } + TURN { FORCED_MOVE(encoreTarget); } + TURN { FORCED_MOVE(encoreTarget); } + TURN { MOVE(encoreTarget, MOVE_SPLASH); } } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_ENCORE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SPLASH, player); - } -} - -SINGLE_BATTLE_TEST("Encore forces consecutive move uses for 3 turns for opponent: Encore used before move") -{ - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Speed(20); } - OPPONENT(SPECIES_WOBBUFFET) { Speed(10); } - } WHEN { - TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); } - TURN { MOVE(player, MOVE_ENCORE); MOVE(opponent, MOVE_CELEBRATE); } - // TURN { FORCED_MOVE(opponent); } - TURN { FORCED_MOVE(opponent); } - TURN { FORCED_MOVE(opponent); } - TURN { MOVE(opponent, MOVE_SPLASH); } - } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_ENCORE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SPLASH, opponent); - } -} - -SINGLE_BATTLE_TEST("Encore forces consecutive move uses for 3 turns for opponent: Encore used after move") -{ - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Speed(10); } - OPPONENT(SPECIES_WOBBUFFET) { Speed(20); } - } WHEN { - TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_ENCORE); } - TURN { FORCED_MOVE(opponent); } - TURN { FORCED_MOVE(opponent); } - TURN { FORCED_MOVE(opponent); } - TURN { MOVE(opponent, MOVE_SPLASH); } - } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_ENCORE, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SPLASH, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ENCORE, encoreUser); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, encoreTarget); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPLASH, encoreTarget); } } @@ -121,3 +86,44 @@ SINGLE_BATTLE_TEST("Encore overrides the chosen move if it occurs first") ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player); } } + +SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon are immune to Encore") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE, gimmick: GIMMICK_DYNAMAX); MOVE(opponent, MOVE_ENCORE); } + TURN { MOVE(player, MOVE_EMBER); } + } SCENE { + MESSAGE("Wobbuffet used Max Strike!"); + MESSAGE("The opposing Wobbuffet used Encore!"); + MESSAGE("But it failed!"); + MESSAGE("Wobbuffet used Max Flare!"); + } +} + +SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon can be encored immediately after reverting") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Speed(50); }; // yes, this speed is necessary + OPPONENT(SPECIES_WOBBUFFET) { Speed(100); }; + } WHEN { + TURN { MOVE(player, MOVE_ARM_THRUST, gimmick: GIMMICK_DYNAMAX); } + TURN { MOVE(player, MOVE_ARM_THRUST); } + TURN { MOVE(player, MOVE_ARM_THRUST); } + TURN { MOVE(opponent, MOVE_ENCORE); MOVE(player, MOVE_TACKLE); } + } SCENE { + MESSAGE("Wobbuffet used Max Knuckle!"); + MESSAGE("Wobbuffet used Max Knuckle!"); + MESSAGE("Wobbuffet used Max Knuckle!"); + MESSAGE("The opposing Wobbuffet used Encore!"); + MESSAGE("Wobbuffet used Arm Thrust!"); + } +} + +TO_DO_BATTLE_TEST("Encore's effect ends if the encored move runs out of PP"); +TO_DO_BATTLE_TEST("Encore lasts for 2-6 turns (Gen 2-3)"); +TO_DO_BATTLE_TEST("Encore lasts for 4-8 turns (Gen 4)"); +TO_DO_BATTLE_TEST("Encore lasts for 3 turns (Gen 5+)"); +TO_DO_BATTLE_TEST("Encore randomly chooses an opponent target"); diff --git a/test/battle/move_effect/endeavor.c b/test/battle/move_effect/endeavor.c new file mode 100644 index 0000000000..72eeaccdaf --- /dev/null +++ b/test/battle/move_effect/endeavor.c @@ -0,0 +1,6 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Endeavor sets the the target's HP to the user's current HP"); +TO_DO_BATTLE_TEST("Endeavor doesn't fail if the user's HP is greater or equal than the target, but it doesn't heal the target"); +TO_DO_BATTLE_TEST("Endeavor fails on Ghost-type Pokémon"); diff --git a/test/battle/move_effect/endure.c b/test/battle/move_effect/endure.c new file mode 100644 index 0000000000..04f150d3ce --- /dev/null +++ b/test/battle/move_effect/endure.c @@ -0,0 +1,35 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Endure allows the user to survive any attack with 1 HP left"); + +SINGLE_BATTLE_TEST("Endure does not prevent multiple hits and stat changes occur at the end of the turn") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + ASSUME(gMovesInfo[MOVE_ENDURE].effect == EFFECT_ENDURE); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + } WHEN { + TURN { MOVE(opponent, MOVE_ENDURE); MOVE(player, MOVE_SCALE_SHOT); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ENDURE, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); + MESSAGE("The Pokémon was hit 5 time(s)!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's Defense fell!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's Speed rose!"); + } +} + +TO_DO_BATTLE_TEST("Endure's success rate decreases for every consecutively used turn"); +TO_DO_BATTLE_TEST("Endure uses the same counter as Protect"); +TO_DO_BATTLE_TEST("Endure doesn't trigger effects that require damage to be done to the Pokémon (Gen 2-4)"); // Eg. Rough Skin +TO_DO_BATTLE_TEST("Endure triggers effects that require damage to be done to the Pokémon (Gen 5+)"); // Eg. Rough Skin +TO_DO_BATTLE_TEST("Endure doesn't protect against Future Sight (Gen 2-4)"); +TO_DO_BATTLE_TEST("Endure protects against Future Sight (Gen 5+)"); diff --git a/test/battle/move_effect/entrainment.c b/test/battle/move_effect/entrainment.c new file mode 100644 index 0000000000..b43f6dcbc1 --- /dev/null +++ b/test/battle/move_effect/entrainment.c @@ -0,0 +1,6 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Entrainment changes the target's Ability to match the user's"); +TO_DO_BATTLE_TEST("Entrainment fails if the user's ability has cantBeCopied flag"); +TO_DO_BATTLE_TEST("Entrainment fails if the targets's ability has cantBeOverwritten flag"); diff --git a/test/battle/move_effect/evasion_down.c b/test/battle/move_effect/evasion_down.c new file mode 100644 index 0000000000..ecc0db135b --- /dev/null +++ b/test/battle/move_effect/evasion_down.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Sweet Scent lowers evasion by 1 stage (Gen 2-5)"); diff --git a/test/battle/move_effect/evasion_down_2.c b/test/battle/move_effect/evasion_down_2.c new file mode 100644 index 0000000000..7584406e4c --- /dev/null +++ b/test/battle/move_effect/evasion_down_2.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Sweet Scent lowers evasion by 1 stage (Gen 6+)"); diff --git a/test/battle/move_effect/evasion_up.c b/test/battle/move_effect/evasion_up.c index 7058694e9d..48722a7596 100644 --- a/test/battle/move_effect/evasion_up.c +++ b/test/battle/move_effect/evasion_up.c @@ -6,7 +6,7 @@ ASSUMPTIONS ASSUME(gMovesInfo[MOVE_DOUBLE_TEAM].effect == EFFECT_EVASION_UP); } -SINGLE_BATTLE_TEST("Double Team raises Evasion") +SINGLE_BATTLE_TEST("Double Team raises Evasion by 1 stage") { PASSES_RANDOMLY(gMovesInfo[MOVE_SCRATCH].accuracy * 3 / 4, 100, RNG_ACCURACY); GIVEN { diff --git a/test/battle/move_effect/evasion_up_2.c b/test/battle/move_effect/evasion_up_2.c new file mode 100644 index 0000000000..cd5cb543a9 --- /dev/null +++ b/test/battle/move_effect/evasion_up_2.c @@ -0,0 +1,28 @@ +#include "global.h" +#include "test/battle.h" + +// There's no move with EFFECT_EVASION_UP_2 effect. Below is a theoretical test. + +/* +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_X].effect == EFFECT_EVASION_UP_2); +} + +SINGLE_BATTLE_TEST("Double Team raises Evasion by 1 stage") +{ + PASSES_RANDOMLY(gMovesInfo[MOVE_SCRATCH].accuracy * 3 / 5, 100, RNG_ACCURACY); + GIVEN { + ASSUME(gMovesInfo[MOVE_SCRATCH].accuracy == 100); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_X); MOVE(opponent, MOVE_SCRATCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_X, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's evasiveness sharply rose!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCRATCH, opponent); + } +} +*/ diff --git a/test/battle/move_effect/expanding_force.c b/test/battle/move_effect/expanding_force.c new file mode 100644 index 0000000000..74b78fdd86 --- /dev/null +++ b/test/battle/move_effect/expanding_force.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Expanding Force's power increases by 50% if the user is affected by Psychic Terrain"); diff --git a/test/battle/move_effect/extreme_evoboost.c b/test/battle/move_effect/extreme_evoboost.c new file mode 100644 index 0000000000..c43a6f7374 --- /dev/null +++ b/test/battle/move_effect/extreme_evoboost.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Extreme Evoboost increases the user's Attack, Defense, Special Attack, Special Defense, and Speed stats by 2 stages each"); diff --git a/test/battle/terrain/grassy.c b/test/battle/move_effect/grassy_terrain.c similarity index 80% rename from test/battle/terrain/grassy.c rename to test/battle/move_effect/grassy_terrain.c index b247933dd2..90e878b6dd 100644 --- a/test/battle/terrain/grassy.c +++ b/test/battle/move_effect/grassy_terrain.c @@ -18,25 +18,6 @@ SINGLE_BATTLE_TEST("Grassy Terrain recovers 1/16th HP at end of turn") } } -SINGLE_BATTLE_TEST("Grassy Terrain activates Grassy Seed and Mimicry") -{ - GIVEN { - ASSUME(gItemsInfo[ITEM_GRASSY_SEED].holdEffect == HOLD_EFFECT_SEEDS); - ASSUME(gItemsInfo[ITEM_GRASSY_SEED].holdEffectParam == HOLD_EFFECT_PARAM_GRASSY_TERRAIN); - PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_GRASSY_SEED); } - OPPONENT(SPECIES_STUNFISK_GALAR) { Ability(ABILITY_MIMICRY); } - } WHEN { - TURN { MOVE(player, MOVE_GRASSY_TERRAIN); } - } SCENE { - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); - MESSAGE("Using Grassy Seed, the Defense of Wobbuffet rose!"); - ABILITY_POPUP(opponent); - MESSAGE("The opposing Stunfisk's type changed to Grass!"); - } THEN { - EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[0], TYPE_GRASS); - } -} - SINGLE_BATTLE_TEST("Grassy Terrain increases power of Grass-type moves by 30/50 percent", s16 damage) { bool32 terrain; diff --git a/test/battle/move_effect/hit_set_remove_terrain.c b/test/battle/move_effect/hit_set_remove_terrain.c index a48d316d3f..feeca62560 100644 --- a/test/battle/move_effect/hit_set_remove_terrain.c +++ b/test/battle/move_effect/hit_set_remove_terrain.c @@ -83,7 +83,7 @@ SINGLE_BATTLE_TEST("Ice Spinner doesn't fail if there is no terrain on the field } } -AI_SINGLE_BATTLE_TEST("Steel Roller will not be chosen by the AI if it might fail") +AI_SINGLE_BATTLE_TEST("AI will not choose Steel Roller if it might fail") { u32 move; @@ -104,7 +104,7 @@ AI_SINGLE_BATTLE_TEST("Steel Roller will not be chosen by the AI if it might fai } } -AI_SINGLE_BATTLE_TEST("Ice Spinner can be chosen by the AI regardless if there is a terrain or not") +AI_SINGLE_BATTLE_TEST("AI will can choose Ice Spinner regardless if there is a terrain or not") { u32 move; @@ -124,35 +124,3 @@ AI_SINGLE_BATTLE_TEST("Ice Spinner can be chosen by the AI regardless if there i } } } - -SINGLE_BATTLE_TEST("Steel Roller and Ice Spinner reverts typing on Mimicry users") -{ - u32 j; - static const u16 terrainMoves[] = - { - MOVE_ELECTRIC_TERRAIN, - MOVE_PSYCHIC_TERRAIN, - MOVE_GRASSY_TERRAIN, - MOVE_MISTY_TERRAIN, - }; - - u16 terrainMove = MOVE_NONE; - u16 removeTerrainMove = MOVE_NONE; - - for (j = 0; j < ARRAY_COUNT(terrainMoves); j++) - { - PARAMETRIZE { removeTerrainMove = MOVE_STEEL_ROLLER; terrainMove = terrainMoves[j]; } - PARAMETRIZE { removeTerrainMove = MOVE_ICE_SPINNER; terrainMove = terrainMoves[j]; } - } - - GIVEN { - ASSUME(gSpeciesInfo[SPECIES_STUNFISK_GALAR].types[1] == TYPE_STEEL); - PLAYER(SPECIES_WOBBUFFET); - OPPONENT(SPECIES_STUNFISK_GALAR) { Ability(ABILITY_MIMICRY); } - } WHEN { - TURN { MOVE(opponent, terrainMove); MOVE(player, removeTerrainMove); } - TURN { MOVE(player, MOVE_TOXIC); } - } SCENE { - MESSAGE("It doesn't affect the opposing Stunfisk…"); - } -} diff --git a/test/battle/terrain/misty.c b/test/battle/move_effect/misty_terrain.c similarity index 78% rename from test/battle/terrain/misty.c rename to test/battle/move_effect/misty_terrain.c index e43cf4a253..b96f0c650d 100644 --- a/test/battle/terrain/misty.c +++ b/test/battle/move_effect/misty_terrain.c @@ -19,25 +19,6 @@ SINGLE_BATTLE_TEST("Misty Terrain protects grounded battlers from non-volatile s } } -SINGLE_BATTLE_TEST("Misty Terrain activates Misty Seed and Mimicry") -{ - GIVEN { - ASSUME(gItemsInfo[ITEM_MISTY_SEED].holdEffect == HOLD_EFFECT_SEEDS); - ASSUME(gItemsInfo[ITEM_MISTY_SEED].holdEffectParam == HOLD_EFFECT_PARAM_MISTY_TERRAIN); - PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_MISTY_SEED); } - OPPONENT(SPECIES_STUNFISK_GALAR) { Ability(ABILITY_MIMICRY); } - } WHEN { - TURN { MOVE(player, MOVE_MISTY_TERRAIN); } - } SCENE { - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); - MESSAGE("Using Misty Seed, the Sp. Def of Wobbuffet rose!"); - ABILITY_POPUP(opponent); - MESSAGE("The opposing Stunfisk's type changed to Fairy!"); - } THEN { - EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[0], TYPE_FAIRY); - } -} - SINGLE_BATTLE_TEST("Misty Terrain does not increase the power of Fairy-type moves", s16 damage) { bool32 terrain; diff --git a/test/battle/move_effect/multi_hit.c b/test/battle/move_effect/multi_hit.c index e2331efbf7..802c4f455e 100644 --- a/test/battle/move_effect/multi_hit.c +++ b/test/battle/move_effect/multi_hit.c @@ -200,30 +200,6 @@ DOUBLE_BATTLE_TEST("Scale Shot does not corrupt the next turn move used") } } -SINGLE_BATTLE_TEST("Endure does not prevent multiple hits and stat changes occur at the end of the turn") -{ - GIVEN { - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); - ASSUME(gMovesInfo[MOVE_ENDURE].effect == EFFECT_ENDURE); - PLAYER(SPECIES_WOBBUFFET); - OPPONENT(SPECIES_WOBBUFFET) { HP(1); } - } WHEN { - TURN { MOVE(opponent, MOVE_ENDURE); MOVE(player, MOVE_SCALE_SHOT); } - } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_ENDURE, opponent); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); - ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); - MESSAGE("The Pokémon was hit 5 time(s)!"); - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); - MESSAGE("Wobbuffet's Defense fell!"); - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); - MESSAGE("Wobbuffet's Speed rose!"); - } -} - SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after the 4th hit of Loaded Dice") { PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE); diff --git a/test/battle/terrain/psychic.c b/test/battle/move_effect/psychic_terrain.c similarity index 84% rename from test/battle/terrain/psychic.c rename to test/battle/move_effect/psychic_terrain.c index 9ac88f29da..b85653a0be 100644 --- a/test/battle/terrain/psychic.c +++ b/test/battle/move_effect/psychic_terrain.c @@ -18,25 +18,6 @@ SINGLE_BATTLE_TEST("Psychic Terrain protects grounded battlers from priority mov } } -SINGLE_BATTLE_TEST("Psychic Terrain activates Psychic Seed and Mimicry") -{ - GIVEN { - ASSUME(gItemsInfo[ITEM_PSYCHIC_SEED].holdEffect == HOLD_EFFECT_SEEDS); - ASSUME(gItemsInfo[ITEM_PSYCHIC_SEED].holdEffectParam == HOLD_EFFECT_PARAM_PSYCHIC_TERRAIN); - PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_PSYCHIC_SEED); } - OPPONENT(SPECIES_STUNFISK_GALAR) { Ability(ABILITY_MIMICRY); } - } WHEN { - TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); } - } SCENE { - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); - MESSAGE("Using Psychic Seed, the Sp. Def of Wobbuffet rose!"); - ABILITY_POPUP(opponent); - MESSAGE("The opposing Stunfisk's type changed to Psychic!"); - } THEN { - EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].types[0], TYPE_PSYCHIC); - } -} - SINGLE_BATTLE_TEST("Psychic Terrain increases power of Psychic-type moves by 30/50 percent", s16 damage) { bool32 terrain; diff --git a/test/battle/terrain/starting_terrain.c b/test/battle/starting_status/terrain.c similarity index 100% rename from test/battle/terrain/starting_terrain.c rename to test/battle/starting_status/terrain.c