From 6725164918da57f8ed0bf86bd5efe2688d419bcc Mon Sep 17 00:00:00 2001 From: muscode Date: Fri, 29 Nov 2024 15:23:55 -0600 Subject: [PATCH] [Bug] Fixed First Turn Move + Wimp Out interaction (#4928) * fix first turn move + wimpoout * Add comment about edge case issue --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/ability.ts | 4 ++-- src/phases/switch-summon-phase.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 7ffe016106e..39a9adde366 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -5930,10 +5930,10 @@ export function initAbilities() { .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, Stat.DEF, 1), new Ability(Abilities.WIMP_OUT, 7) .attr(PostDamageForceSwitchAbAttr) - .edgeCase(), // Should not trigger when hurting itself in confusion + .edgeCase(), // Should not trigger when hurting itself in confusion, causes Fake Out to fail turn 1 and succeed turn 2 if pokemon is switched out before battle start via playing in Switch Mode new Ability(Abilities.EMERGENCY_EXIT, 7) .attr(PostDamageForceSwitchAbAttr) - .edgeCase(), // Should not trigger when hurting itself in confusion + .edgeCase(), // Should not trigger when hurting itself in confusion, causes Fake Out to fail turn 1 and succeed turn 2 if pokemon is switched out before battle start via playing in Switch Mode new Ability(Abilities.WATER_COMPACTION, 7) .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => user.getMoveType(move) === Type.WATER && move.category !== MoveCategory.STATUS, Stat.DEF, 2), new Ability(Abilities.MERCILESS, 7) diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index a667e17edf1..a1925768d83 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -1,5 +1,5 @@ import BattleScene from "#app/battle-scene"; -import { applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr } from "#app/data/ability"; +import { applyPreSwitchOutAbAttrs, PostDamageForceSwitchAbAttr, PreSwitchOutAbAttr } from "#app/data/ability"; import { allMoves, ForceSwitchOutAttr } from "#app/data/move"; import { getPokeballTintColor } from "#app/data/pokeball"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; @@ -166,10 +166,11 @@ export class SwitchSummonPhase extends SummonPhase { const currentCommand = pokemon.scene.currentBattle.turnCommands[this.fieldIndex]?.command; const lastPokemonIsForceSwitchedAndNotFainted = lastUsedMove?.hasAttr(ForceSwitchOutAttr) && !this.lastPokemon.isFainted(); + const lastPokemonHasForceSwitchAbAttr = this.lastPokemon.hasAbilityWithAttr(PostDamageForceSwitchAbAttr) && !this.lastPokemon.isFainted(); // Compensate for turn spent summoning // Or compensate for force switch move if switched out pokemon is not fainted - if (currentCommand === Command.POKEMON || lastPokemonIsForceSwitchedAndNotFainted) { + if (currentCommand === Command.POKEMON || lastPokemonIsForceSwitchedAndNotFainted || lastPokemonHasForceSwitchAbAttr) { pokemon.battleSummonData.turnCount--; pokemon.battleSummonData.waveTurnCount--; }