diff --git a/package.json b/package.json index 341bca80c2e..938d362f263 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "vite build", "build:beta": "vite build --mode beta", "preview": "vite preview", - "test": "vitest run", + "test": "vitest run --no-isolate", "test:cov": "vitest run --coverage --no-isolate", "test:watch": "vitest watch --coverage --no-isolate", "test:silent": "vitest run --silent --no-isolate", diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index bc047762fb6..6f854a3bbd8 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -2463,7 +2463,7 @@ export class StatusEffectAttr extends MoveEffectAttr { return false; } if (((!pokemon.status || this.overrideStatus) || (pokemon.status.effect === this.effect && moveChance < 0)) - && pokemon.trySetStatus(this.effect, true, user, this.turnsRemaining, null, this.overrideStatus)) { + && pokemon.trySetStatus(this.effect, true, user, this.turnsRemaining, null, this.overrideStatus, false)) { applyPostAttackAbAttrs(ConfusionOnStatusEffectAbAttr, user, target, move, null, false, this.effect); return true; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f6810ad38e1..492856b4b52 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -5529,9 +5529,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { sourcePokemon: Pokemon | null = null, turnsRemaining = 0, sourceText: string | null = null, - overrideStatus?: boolean + overrideStatus?: boolean, + quiet = true, ): boolean { - if (!this.canSetStatus(effect, false, overrideStatus, sourcePokemon)) { + if (!this.canSetStatus(effect, quiet, overrideStatus, sourcePokemon)) { return false; } if (this.isFainted() && effect !== StatusEffect.FAINT) { diff --git a/test/abilities/illusion.test.ts b/test/abilities/illusion.test.ts index c743a59ef00..1d8ce58ab38 100644 --- a/test/abilities/illusion.test.ts +++ b/test/abilities/illusion.test.ts @@ -23,18 +23,18 @@ describe("Abilities - Illusion", () => { beforeEach(() => { game = new GameManager(phaserGame); - game.override.battleStyle("single"); - game.override.enemySpecies(Species.ZORUA); - game.override.enemyAbility(Abilities.ILLUSION); - game.override.enemyMoveset(Moves.TACKLE); - game.override.enemyHeldItems([{ name: "WIDE_LENS", count: 3 }]); - - game.override.moveset([Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE]); - game.override.startingHeldItems([{ name: "WIDE_LENS", count: 3 }]); + game.override + .battleStyle("single") + .enemySpecies(Species.ZORUA) + .enemyAbility(Abilities.ILLUSION) + .enemyMoveset(Moves.TACKLE) + .enemyHeldItems([{ name: "WIDE_LENS", count: 3 }]) + .moveset([Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE]) + .startingHeldItems([{ name: "WIDE_LENS", count: 3 }]); }); it("creates illusion at the start", async () => { - await game.classicMode.startBattle([Species.ZOROARK, Species.AXEW]); + await game.classicMode.startBattle([Species.ZOROARK, Species.FEEBAS]); const zoroark = game.scene.getPlayerPokemon()!; const zorua = game.scene.getEnemyPokemon()!; @@ -43,7 +43,7 @@ describe("Abilities - Illusion", () => { }); it("break after receiving damaging move", async () => { - await game.classicMode.startBattle([Species.AXEW]); + await game.classicMode.startBattle([Species.FEEBAS]); game.move.select(Moves.TACKLE); await game.phaseInterceptor.to("TurnEndPhase"); @@ -55,7 +55,7 @@ describe("Abilities - Illusion", () => { }); it("break after getting ability changed", async () => { - await game.classicMode.startBattle([Species.AXEW]); + await game.classicMode.startBattle([Species.FEEBAS]); game.move.select(Moves.WORRY_SEED); await game.phaseInterceptor.to("TurnEndPhase"); @@ -76,7 +76,7 @@ describe("Abilities - Illusion", () => { it("causes enemy AI to consider the illusion's type instead of the actual type when considering move effectiveness", async () => { game.override.enemyMoveset([Moves.FLAMETHROWER, Moves.PSYCHIC, Moves.TACKLE]); - await game.classicMode.startBattle([Species.ZOROARK, Species.AXEW]); + await game.classicMode.startBattle([Species.ZOROARK, Species.FEEBAS]); const enemy = game.scene.getEnemyPokemon()!; const zoroark = game.scene.getPlayerPokemon()!;