From a24353d184a3e2cc9a6d1133ec1d0a0fc34c3a4e Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Sun, 6 Jul 2025 09:11:04 -0400 Subject: [PATCH] Add Overcoat Tests (#7287) Co-authored-by: ghoulslash Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- test/battle/ability/overcoat.c | 60 ++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/test/battle/ability/overcoat.c b/test/battle/ability/overcoat.c index 96f3ffcb08..da067a8771 100644 --- a/test/battle/ability/overcoat.c +++ b/test/battle/ability/overcoat.c @@ -16,6 +16,60 @@ SINGLE_BATTLE_TEST("Overcoat blocks powder and spore moves") } } -TO_DO_BATTLE_TEST("Overcoat blocks damage from hail"); -TO_DO_BATTLE_TEST("Overcoat blocks damage from sandstorm"); -TO_DO_BATTLE_TEST("Overcoat blocks Effect Spore's effect"); +DOUBLE_BATTLE_TEST("Overcoat blocks damage from sandstorm") +{ + GIVEN { + PLAYER(SPECIES_WYNAUT) { Speed(50); } + PLAYER(SPECIES_HELIOLISK) { Speed(40); Ability(ABILITY_SAND_VEIL); } + OPPONENT(SPECIES_PINECO) { Speed(30); Ability(ABILITY_OVERCOAT); } + OPPONENT(SPECIES_STARLY) { Speed(20); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SANDSTORM); } + } SCENE { + MESSAGE("Wynaut used Sandstorm!"); + MESSAGE("The sandstorm is raging."); + HP_BAR(playerLeft); + NONE_OF { + HP_BAR(playerRight); + HP_BAR(opponentLeft); + } + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Overcoat blocks damage from hail") +{ + GIVEN { + PLAYER(SPECIES_WYNAUT) { Speed(50); Ability(ABILITY_SNOW_CLOAK); } + PLAYER(SPECIES_SOLOSIS) { Speed(40); Ability(ABILITY_RUN_AWAY); } + OPPONENT(SPECIES_PINECO) { Speed(30); Ability(ABILITY_OVERCOAT); } + OPPONENT(SPECIES_SNORUNT) { Speed(20); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_HAIL); MOVE(playerRight, MOVE_SKILL_SWAP, target: playerLeft); } + } SCENE { + MESSAGE("Wynaut used Hail!"); + MESSAGE("Solosis used Skill Swap!"); + HP_BAR(playerLeft); + NONE_OF { + HP_BAR(playerRight); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); // ice type + } + } +} + +SINGLE_BATTLE_TEST("Overcoat blocks Effect Spore's effect") +{ + GIVEN { + PLAYER(SPECIES_PINECO) {Ability(ABILITY_OVERCOAT);} + OPPONENT(SPECIES_SHROOMISH) {Ability(ABILITY_EFFECT_SPORE);} + } WHEN { + TURN { MOVE(player, MOVE_TACKLE, WITH_RNG(RNG_EFFECT_SPORE, 1)); } + } SCENE { + MESSAGE("Pineco used Tackle!"); + NOT ABILITY_POPUP(opponent, ABILITY_EFFECT_SPORE); + } THEN { + EXPECT_EQ(player->status1, 0); + } +} +