diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 4b77ec44601..1ec076f187f 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -917,7 +917,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag { public moveId: Moves; constructor(sourceId: number) { - super(BattlerTagType.ENCORE, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.AFTER_MOVE ], 3, Moves.ENCORE, sourceId); + super(BattlerTagType.ENCORE, [ BattlerTagLapseType.CUSTOM, BattlerTagLapseType.AFTER_MOVE ], 3, Moves.ENCORE, sourceId); } /** @@ -980,7 +980,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag { * @returns `true` to persist | `false` to end and be removed */ override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { - if (lapseType === BattlerTagLapseType.PRE_MOVE) { + if (lapseType === BattlerTagLapseType.CUSTOM) { const encoredMove = pokemon.getMoveset().find(m => m?.moveId === this.moveId); if (encoredMove && encoredMove?.getPpRatio() > 0) { return true; diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index 737a56ba48f..72cfd63c3bc 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -1,6 +1,6 @@ import BattleScene from "#app/battle-scene"; import { TurnCommand, BattleType } from "#app/battle"; -import { TrappedTag } from "#app/data/battler-tags"; +import { BattlerTagLapseType, TrappedTag, EncoreTag } from "#app/data/battler-tags"; import { MoveTargetSet, getMoveTargets } from "#app/data/move"; import { speciesStarterCosts } from "#app/data/balance/starters"; import { Abilities } from "#app/enums/abilities"; @@ -61,6 +61,12 @@ export class CommandPhase extends FieldPhase { this.scene.currentBattle.turnCommands[this.fieldIndex] = { command: Command.FIGHT, move: { move: Moves.NONE, targets: []}, skip: true }; } + // Checks if the Pokemon is under the effects of Encore. If so, Encore can end early if the encored move has no more PP. + const encoreTag = this.getPokemon().getTag(BattlerTagType.ENCORE) as EncoreTag; + if (encoreTag && !encoreTag.lapse(this.getPokemon(), BattlerTagLapseType.CUSTOM)) { + this.getPokemon().removeTag(BattlerTagType.ENCORE); + } + if (this.scene.currentBattle.turnCommands[this.fieldIndex]?.skip) { return this.end(); }