Skip to content

Commit

Permalink
Fixes defrosting if frozon mon is not damaged by opponent (#6016)
Browse files Browse the repository at this point in the history
Co-authored-by: Bassoonian <[email protected]>
  • Loading branch information
AlexOn1ine and Bassoonian authored Jan 13, 2025
1 parent 536f386 commit f1eebc9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
18 changes: 18 additions & 0 deletions test/battle/status1/freeze.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit f1eebc9

Please sign in to comment.