From f1eebc978d05697c6bae087dfb135e35b9c26c27 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:09:55 +0100 Subject: [PATCH] Fixes defrosting if frozon mon is not damaged by opponent (#6016) Co-authored-by: Bassoonian --- src/battle_script_commands.c | 1 + test/battle/status1/freeze.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ffb03a1d731d..32f2b1138b5f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5846,6 +5846,7 @@ static void Cmd_moveend(void) break; case MOVEEND_DEFROST: // defrosting check if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE + && TARGET_TURN_DAMAGED && IsBattlerAlive(gBattlerTarget) && gBattlerAttacker != gBattlerTarget && (moveType == TYPE_FIRE || CanBurnHitThaw(gCurrentMove)) diff --git a/test/battle/status1/freeze.c b/test/battle/status1/freeze.c index f218430909e1..d19e1776be88 100644 --- a/test/battle/status1/freeze.c +++ b/test/battle/status1/freeze.c @@ -43,3 +43,21 @@ SINGLE_BATTLE_TEST("Freeze is thawed by user's Flame Wheel") MESSAGE("Wobbuffet used Flame Wheel!"); } } + +SINGLE_BATTLE_TEST("Freeze isn't thawed if opponent is asleep during thawing attack") +{ + PASSES_RANDOMLY(80, 100, RNG_FROZEN); + GIVEN { + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } + OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }; + } WHEN { + TURN { MOVE(opponent, MOVE_EMBER); MOVE(player, MOVE_CELEBRATE); } + } SCENE { + NONE_OF { + MESSAGE("The opposing Wobbuffet used Ember!"); + MESSAGE("Wobbuffet thawed out!"); + STATUS_ICON(player, none: TRUE); + } + } +}