diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 7ac8d1412..c4fb18cb4 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -17,6 +17,7 @@ import { BattleStat } from "./battle-stat"; export enum BattlerTagLapseType { FAINT, MOVE, + PRE_MOVE, AFTER_MOVE, MOVE_EFFECT, TURN_END, @@ -77,7 +78,7 @@ export interface TerrainBattlerTag { export class RechargingTag extends BattlerTag { constructor(sourceMove: Moves) { - super(BattlerTagType.RECHARGING, BattlerTagLapseType.MOVE, 1, sourceMove); + super(BattlerTagType.RECHARGING, BattlerTagLapseType.PRE_MOVE, 1, sourceMove); } onAdd(pokemon: Pokemon): void { @@ -90,7 +91,9 @@ export class RechargingTag extends BattlerTag { super.lapse(pokemon, lapseType); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' must\nrecharge!')); - + (pokemon.scene.getCurrentPhase() as MovePhase).cancel(); + pokemon.getMoveQueue().shift(); + return true; } } @@ -1042,4 +1045,4 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); } -} \ No newline at end of file +} diff --git a/src/phases.ts b/src/phases.ts index 08721c1e2..24f13c875 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2023,12 +2023,14 @@ export class MovePhase extends BattlePhase { }); const doMove = () => { - if (!this.followUp && this.canMove()) { + this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE); + + if (!this.followUp && this.canMove() && !this.cancelled) { this.pokemon.lapseTags(BattlerTagLapseType.MOVE); - if (this.cancelled) { - this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL }); - return this.end(); - } + } + if (this.cancelled) { + this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL }); + return this.end(); } const moveQueue = this.pokemon.getMoveQueue(); @@ -4242,4 +4244,4 @@ export class TestMessagePhase extends MessagePhase { constructor(scene: BattleScene, message: string) { super(scene, message, null, true); } -} \ No newline at end of file +}