diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index e94841feea2..6e5e09839c1 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -6374,7 +6374,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr { } getCondition(): MoveConditionFunc { - return (user, target, move) => (move.category !== MoveCategory.STATUS || this.getSwitchOutCondition(true)(user, target, move)); + return (user, target, move) => (move.category !== MoveCategory.STATUS || this.getSwitchOutCondition()(user, target, move)); } getFailedText(_user: Pokemon, target: Pokemon, _move: Move): string | undefined { @@ -6386,12 +6386,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr { } - /** - * Check if the switch out conditions are met. - * - * @param preliminary - Whether to check for failure conditions that occur before the hit check (defaults to false) - */ - getSwitchOutCondition(preliminary = false): MoveConditionFunc { + getSwitchOutCondition(): MoveConditionFunc { return (user, target, move) => { const switchOutTarget = (this.selfSwitch ? user : target); const player = switchOutTarget instanceof PlayerPokemon; @@ -6419,9 +6414,6 @@ export class ForceSwitchOutAttr extends MoveEffectAttr { } } - if (preliminary) { - return true; - } if (!player && globalScene.currentBattle.battleType === BattleType.WILD) { // wild pokemon cannot switch out with baton pass. diff --git a/src/overrides.ts b/src/overrides.ts index d36cfbfac98..ee81693e2fc 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -43,7 +43,20 @@ import { BattleType } from "#enums/battle-type"; * } * ``` */ -const overrides = {} satisfies Partial>; +const overrides = { + HAS_PASSIVE_ABILITY_OVERRIDE: false, + OPP_HAS_PASSIVE_ABILITY_OVERRIDE: false, + RANDOM_TRAINER_OVERRIDE: { + trainerType: TrainerType.BREEDER, + alwaysDouble: true + }, + BATTLE_TYPE_OVERRIDE: BattleType.TRAINER, + ABILITY_OVERRIDE: Abilities.BALL_FETCH, + OPP_ABILITY_OVERRIDE: Abilities.BALL_FETCH, + STARTING_LEVEL_OVERRIDE: 100, + MOVESET_OVERRIDE: [ Moves.WHIRLWIND, Moves.SPLASH], + OPP_MOVESET_OVERRIDE: [ Moves.SPLASH] +} satisfies Partial>; /** * If you need to add Overrides values for local testing do that inside {@linkcode overrides} diff --git a/test/moves/whirlwind.test.ts b/test/moves/whirlwind.test.ts index 839c3d1e980..b0ca1783f2f 100644 --- a/test/moves/whirlwind.test.ts +++ b/test/moves/whirlwind.test.ts @@ -44,7 +44,8 @@ describe("Moves - Whirlwind", () => { { move: Moves.SKY_DROP, name: "Sky Drop" }, ])("should not hit a flying target: $name (=$move)", async ({ move }) => { game.override.moveset([move]); - await game.classicMode.startBattle([Species.STARAPTOR]); + // Must have a pokemon in the back so that the move misses instead of fails. + await game.classicMode.startBattle([Species.STARAPTOR, Species.MAGIKARP]); const staraptor = game.scene.getPlayerPokemon()!; @@ -160,7 +161,7 @@ describe("Moves - Whirlwind", () => { expect(eevee.isOnField()).toBe(false); }); - it("cannot pull in the other trainer's pokemon in a partner trainer battle", async () => { + it("should not pull in the other trainer's pokemon in a partner trainer battle", async () => { game.override .battleType(BattleType.TRAINER) .randomTrainer({