From a140e075cd8edbd7836154a06573c93eb6674c37 Mon Sep 17 00:00:00 2001 From: Bertie690 <136088738+Bertie690@users.noreply.github.com> Date: Sun, 6 Jul 2025 13:17:08 +0200 Subject: [PATCH] Revert move-phase.ts --- src/phases/move-phase.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 7049a49e6ee..092a8c65dd4 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -11,7 +11,7 @@ import { MoveFlags } from "#enums/MoveFlags"; import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect"; import { PokemonType } from "#enums/pokemon-type"; -import { getTerrainBlockMessage, getWeatherBlockMessage } from "#app/data/weather"; +import { getWeatherBlockMessage } from "#app/data/weather"; import { MoveUsedEvent } from "#app/events/battle-scene"; import type { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; @@ -26,6 +26,7 @@ import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { StatusEffect } from "#enums/status-effect"; import i18next from "i18next"; +import { getTerrainBlockMessage } from "#app/data/terrain"; import { isVirtual, isIgnorePP, isReflected, MoveUseMode, isIgnoreStatus } from "#enums/move-use-mode"; import { frenzyMissFunc } from "#app/data/moves/move-utils"; @@ -377,10 +378,12 @@ export class MovePhase extends BattlePhase { success = passesConditions && !failedDueToWeather && !failedDueToTerrain; } - // Update the battle's "last move" pointer, unless we're currently mimicking a move - // or the move failed. - if (!allMoves[this.move.moveId].hasAttr("CallMoveAttr") && success) { - globalScene.currentBattle.lastMove = this.move.moveId; + // Update the battle's "last move" pointer, unless we're currently mimicking a move. + if (!allMoves[this.move.moveId].hasAttr("CopyMoveAttr")) { + // The last move used is unaffected by moves that fail + if (success) { + globalScene.currentBattle.lastMove = this.move.moveId; + } } /** @@ -686,4 +689,4 @@ export class MovePhase extends BattlePhase { public showFailedText(failedText: string = i18next.t("battle:attackFailed")): void { globalScene.phaseManager.queueMessage(failedText); } -} +} \ No newline at end of file