diff --git a/test/abilities/mold_breaker.test.ts b/test/abilities/mold_breaker.test.ts index 28a077e8908..3fac3448f4d 100644 --- a/test/abilities/mold_breaker.test.ts +++ b/test/abilities/mold_breaker.test.ts @@ -1,8 +1,6 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { globalScene } from "#app/global-scene"; -import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { AbilityId } from "#enums/ability-id"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -24,29 +22,28 @@ describe("Abilities - Mold Breaker", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset([MoveId.SPLASH]) .ability(AbilityId.MOLD_BREAKER) .battleStyle("single") .criticalHits(false) .enemySpecies(SpeciesId.MAGIKARP) - .enemyAbility(AbilityId.BALL_FETCH) + .enemyAbility(AbilityId.STURDY) .enemyMoveset(MoveId.SPLASH); }); it("should turn off the ignore abilities arena variable after the user's move", async () => { - game.override - .enemyMoveset(MoveId.SPLASH) - .ability(AbilityId.MOLD_BREAKER) - .moveset([MoveId.ERUPTION]) - .startingLevel(100) - .enemyLevel(2); - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - const enemy = game.scene.getEnemyPokemon()!; + await game.classicMode.startBattle([SpeciesId.PINSIR]); - expect(enemy.isFainted()).toBe(false); - game.move.select(MoveId.SPLASH); - await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); - await game.phaseInterceptor.to("MoveEndPhase", true); - expect(globalScene.arena.ignoreAbilities).toBe(false); + const player = game.field.getPlayerPokemon(); + const enemy = game.field.getEnemyPokemon(); + + game.move.use(MoveId.X_SCISSOR); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(game.scene.arena.ignoreAbilities).toBe(true); + expect(game.scene.arena.ignoringEffectSource).toBe(player.getBattlerIndex()); + + await game.toEndOfTurn(); + expect(game.scene.arena.ignoreAbilities).toBe(false); + expect(enemy.isFainted()).toBe(true); }); }); diff --git a/test/items/dire_hit.test.ts b/test/items/dire_hit.test.ts index 25fe9c8b876..a484a0ad302 100644 --- a/test/items/dire_hit.test.ts +++ b/test/items/dire_hit.test.ts @@ -58,8 +58,7 @@ describe("Items - Dire Hit", () => { await game.classicMode.startBattle([SpeciesId.PIKACHU]); - game.move.select(MoveId.SPLASH); - + game.move.use(MoveId.SPLASH); await game.doKillOpponents(); await game.phaseInterceptor.to(BattleEndPhase); diff --git a/test/testUtils/helpers/moveHelper.ts b/test/testUtils/helpers/moveHelper.ts index dcef00a9a46..b7b0fefa4db 100644 --- a/test/testUtils/helpers/moveHelper.ts +++ b/test/testUtils/helpers/moveHelper.ts @@ -64,13 +64,13 @@ export class MoveHelper extends GameManagerHelper { const movePosition = this.getMovePosition(pkmIndex, move); if (movePosition === -1) { expect.fail( - `MoveHelper.select called with move ${toReadableString(MoveId[move])} not in moveset! - Battler Index: ${toReadableString(BattlerIndex[pkmIndex])}; - Moveset: ${this.game.scene - .getField() + `MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset! +Battler Index: ${toReadableString(BattlerIndex[pkmIndex])}; +Moveset: [${this.game.scene + .getPlayerParty() [pkmIndex].getMoveset() .map(pm => toReadableString(MoveId[pm.moveId])) - .join(", ")}`, + .join(", ")}]`, ); } @@ -108,13 +108,13 @@ export class MoveHelper extends GameManagerHelper { const movePosition = this.getMovePosition(pkmIndex, move); if (movePosition === -1) { expect.fail( - `MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}'not in moveset! - Battler Index: ${toReadableString(BattlerIndex[pkmIndex])}; - Moveset: ${this.game.scene - .getField() + `MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset! +Battler Index: ${toReadableString(BattlerIndex[pkmIndex])}; +Moveset: [${this.game.scene + .getPlayerParty() [pkmIndex].getMoveset() .map(pm => toReadableString(MoveId[pm.moveId])) - .join(", ")}`, + .join(", ")}]`, ); }