diff --git a/src/data/ability.ts b/src/data/ability.ts index 3103c08cee6..0384f05e9d1 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -4959,7 +4959,7 @@ class ForceSwitchOutHelper { } if (switchOutTarget.hp > 0) { - switchOutTarget.leaveField(false); + switchOutTarget.leaveField(false, true, true); pokemon.scene.queueMessage(i18next.t("moveTriggers:fled", { pokemonName: getPokemonNameWithAffix(switchOutTarget) }), null, true, 500); if (switchOutTarget.scene.currentBattle.double) { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 217d5fa699b..17bc526a2aa 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2954,7 +2954,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * @returns integer representing damage */ damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false, ignoreFaintPhase: boolean = false): integer { - if (this.isFainted()) { + if (this.isFainted() || this.turnData?.flee) { return 0; } const surviveDamage = new Utils.BooleanHolder(false); @@ -4075,7 +4075,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * @param hideInfo Indicates if this should also play the animation to hide the Pokemon's * info container. */ - leaveField(clearEffects: boolean = true, hideInfo: boolean = true) { + leaveField(clearEffects: boolean = true, hideInfo: boolean = true, flee?: boolean) { this.resetSprite(); this.resetTurnData(); if (clearEffects) { @@ -4085,6 +4085,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (hideInfo) { this.hideInfo(); } + if (flee) { + this.turnData.flee = true; + console.log("FLEE SET TO", this.turnData.flee); + } this.scene.field.remove(this); this.setSwitchOutStatus(true); this.scene.triggerPokemonFormChange(this, SpeciesFormChangeActiveTrigger, true); @@ -5279,6 +5283,7 @@ export class PokemonTurnData { public switchedInThisTurn: boolean = false; public failedRunAway: boolean = false; public joinedRound: boolean = false; + public flee: boolean = false; } export enum AiType { diff --git a/src/overrides.ts b/src/overrides.ts index 7b73cd47b03..f7ac436864e 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -31,7 +31,12 @@ import { WeatherType } from "#enums/weather-type"; * } * ``` */ -const overrides = {} satisfies Partial>; +const overrides = { + BATTLE_TYPE_OVERRIDE: "odd-doubles", + OPP_SPECIES_OVERRIDE: Species.WIMPOD, + OPP_MOVESET_OVERRIDE: Moves.SPLASH, + MOVESET_OVERRIDE: [ Moves.MATCHA_GOTCHA, Moves.QUICK_ATTACK ] +} satisfies Partial>; /** * If you need to add Overrides values for local testing do that inside {@linkcode overrides} diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index f7a9b22c396..b091ae31efe 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -228,9 +228,11 @@ export class MoveEffectPhase extends PokemonPhase { * If the move missed a target, stop all future hits against that target * and move on to the next target (if there is one). */ - if (isCommanding || (!isImmune && !isProtected && !targetHitChecks[target.getBattlerIndex()])) { + if (target.turnData.flee || isCommanding || (!isImmune && !isProtected && !targetHitChecks[target.getBattlerIndex()])) { this.stopMultiHit(target); - this.scene.queueMessage(i18next.t("battle:attackMissed", { pokemonNameWithAffix: getPokemonNameWithAffix(target) })); + if (!target.turnData.flee) { + this.scene.queueMessage(i18next.t("battle:attackMissed", { pokemonNameWithAffix: getPokemonNameWithAffix(target) })); + } if (moveHistoryEntry.result === MoveResult.PENDING) { moveHistoryEntry.result = MoveResult.MISS; } diff --git a/src/phases/post-turn-status-effect-phase.ts b/src/phases/post-turn-status-effect-phase.ts index 08e4d7cb952..49a30777141 100644 --- a/src/phases/post-turn-status-effect-phase.ts +++ b/src/phases/post-turn-status-effect-phase.ts @@ -16,7 +16,7 @@ export class PostTurnStatusEffectPhase extends PokemonPhase { start() { const pokemon = this.getPokemon(); - if (pokemon?.isActive(true) && pokemon.status && pokemon.status.isPostTurn()) { + if (pokemon?.isActive(true) && pokemon.status && pokemon.status.isPostTurn() && !pokemon.turnData.flee) { pokemon.status.incrementTurn(); const cancelled = new Utils.BooleanHolder(false); applyAbAttrs(BlockNonDirectDamageAbAttr, pokemon, cancelled);