From 207fe28147f0e5eda39a81e70ddf7b66fa02598b Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Sun, 4 May 2025 11:10:23 -0400 Subject: [PATCH] Removed unneeded duplicate entries from movesets --- test/abilities/contrary.test.ts | 5 +- test/abilities/ice_face.test.ts | 8 +-- test/abilities/libero.test.ts | 4 +- test/abilities/magic_guard.test.ts | 93 +++++++++++++------------- test/abilities/mycelium_might.test.ts | 4 +- test/abilities/power_construct.test.ts | 2 +- test/abilities/protean.test.ts | 4 +- test/abilities/sand_veil.test.ts | 2 +- test/abilities/schooling.test.ts | 6 +- test/abilities/screen_cleaner.test.ts | 8 +-- test/abilities/stall.test.ts | 2 +- test/abilities/sweet_veil.test.ts | 4 +- test/abilities/unseen_fist.test.ts | 4 +- test/battle/battle.test.ts | 18 ++--- test/battle/inverse_battle.test.ts | 4 +- test/battle/special_battle.test.ts | 2 +- test/items/leek.test.ts | 2 +- test/items/leftovers.test.ts | 2 +- test/moves/astonish.test.ts | 2 +- test/moves/aurora_veil.test.ts | 2 +- test/moves/double_team.test.ts | 2 +- test/moves/dynamax_cannon.test.ts | 2 +- test/moves/flower_shield.test.ts | 2 +- test/moves/freezy_frost.test.ts | 4 +- test/moves/fusion_bolt.test.ts | 2 +- test/moves/fusion_flare.test.ts | 2 +- test/moves/fusion_flare_bolt.test.ts | 8 +-- test/moves/light_screen.test.ts | 2 +- test/moves/magnet_rise.test.ts | 2 +- test/moves/reflect.test.ts | 2 +- test/moves/retaliate.test.ts | 2 +- test/moves/swallow.test.ts | 2 +- test/moves/tackle.test.ts | 2 +- test/moves/tidy_up.test.ts | 20 ++---- 34 files changed, 107 insertions(+), 125 deletions(-) diff --git a/test/abilities/contrary.test.ts b/test/abilities/contrary.test.ts index 028423089be..9fbb1da4c2b 100644 --- a/test/abilities/contrary.test.ts +++ b/test/abilities/contrary.test.ts @@ -54,10 +54,7 @@ describe("Abilities - Contrary", () => { }); it("should block negative effects", async () => { - game.override - .enemyPassiveAbility(Abilities.CLEAR_BODY) - .enemyMoveset([Moves.HOWL, Moves.HOWL, Moves.HOWL, Moves.HOWL]) - .moveset([Moves.SPLASH]); + game.override.enemyPassiveAbility(Abilities.CLEAR_BODY).enemyMoveset(Moves.HOWL).moveset([Moves.SPLASH]); await game.classicMode.startBattle([Species.SLOWBRO]); const enemyPokemon = game.scene.getEnemyPokemon()!; diff --git a/test/abilities/ice_face.test.ts b/test/abilities/ice_face.test.ts index 3ca7f7ac57e..c87d0f9a2b0 100644 --- a/test/abilities/ice_face.test.ts +++ b/test/abilities/ice_face.test.ts @@ -106,7 +106,7 @@ describe("Abilities - Ice Face", () => { }); it("transforms to Ice Face when Hail or Snow starts", async () => { - game.override.moveset([Moves.QUICK_ATTACK]).enemyMoveset([Moves.HAIL, Moves.HAIL, Moves.HAIL, Moves.HAIL]); + game.override.moveset([Moves.QUICK_ATTACK]).enemyMoveset(Moves.HAIL); await game.classicMode.startBattle([Species.MAGIKARP]); @@ -127,7 +127,7 @@ describe("Abilities - Ice Face", () => { }); it("transforms to Ice Face when summoned on arena with active Snow or Hail", async () => { - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]).moveset([Moves.SNOWSCAPE]); + game.override.enemyMoveset(Moves.TACKLE).moveset([Moves.SNOWSCAPE]); await game.classicMode.startBattle([Species.EISCUE, Species.NINJASK]); @@ -153,7 +153,7 @@ describe("Abilities - Ice Face", () => { }); it("will not revert to its Ice Face if there is already Hail when it changes into Noice", async () => { - game.override.enemySpecies(Species.SHUCKLE).enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.enemySpecies(Species.SHUCKLE).enemyMoveset(Moves.TACKLE); await game.classicMode.startBattle([Species.EISCUE]); @@ -172,7 +172,7 @@ describe("Abilities - Ice Face", () => { }); it("persists form change when switched out", async () => { - game.override.enemyMoveset([Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK]); + game.override.enemyMoveset(Moves.QUICK_ATTACK); await game.classicMode.startBattle([Species.EISCUE, Species.MAGIKARP]); diff --git a/test/abilities/libero.test.ts b/test/abilities/libero.test.ts index 9ab9c4cc582..6639b1a2e62 100644 --- a/test/abilities/libero.test.ts +++ b/test/abilities/libero.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Libero", () => { .ability(Abilities.LIBERO) .startingLevel(100) .enemySpecies(Species.RATTATA) - .enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]); + .enemyMoveset(Moves.ENDURE); }); test("ability applies and changes a pokemon's type", async () => { @@ -172,7 +172,7 @@ describe("Abilities - Libero", () => { }); test("ability applies correctly even if the pokemon's move is protected against", async () => { - game.override.moveset([Moves.TACKLE]).enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]); + game.override.moveset([Moves.TACKLE]).enemyMoveset(Moves.PROTECT); await game.classicMode.startBattle([Species.MAGIKARP]); diff --git a/test/abilities/magic_guard.test.ts b/test/abilities/magic_guard.test.ts index 548757ec87e..ecadda17562 100644 --- a/test/abilities/magic_guard.test.ts +++ b/test/abilities/magic_guard.test.ts @@ -1,11 +1,12 @@ +import { BattlerIndex } from "#app/battle"; import { ArenaTagSide, getArenaTag } from "#app/data/arena-tag"; import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; import GameManager from "#test/testUtils/gameManager"; @@ -55,7 +56,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -66,31 +67,36 @@ describe("Abilities - Magic Guard", () => { expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp()); }); - it("ability should prevent damage caused by status effects but other non-damage effects still apply", async () => { - //Toxic keeps track of the turn counters -> important that Magic Guard keeps track of post-Toxic turns - game.override.statusEffect(StatusEffect.POISON); - + it("should retain catch boost, toxic turn count and burn attack drops", async () => { + game.override.statusEffect(StatusEffect.TOXIC); await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.SPLASH); + await game.phaseInterceptor.to("TurnEndPhase"); - await game.phaseInterceptor.to(TurnEndPhase); - - /** - * Expect: - * - The player Pokemon (with Magic Guard) has not taken damage from poison - * - The Pokemon's CatchRateMultiplier should be 1.5 - */ expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); + expect(leadPokemon.status).toBeTruthy(); + expect(leadPokemon.status!.toxicTurnCount).toBeGreaterThan(0); expect(getStatusEffectCatchRateMultiplier(leadPokemon.status!.effect)).toBe(1.5); + + await game.toNextTurn(); + + // give ourselves burn and ensure our attack indeed dropped + + const prevAtk = leadPokemon.getEffectiveStat(Stat.ATK); + leadPokemon.resetStatus(); + expect(leadPokemon.status).toBeFalsy(); + + leadPokemon.trySetStatus(StatusEffect.BURN); + expect(leadPokemon.status).toBeTruthy(); + const burntAtk = leadPokemon.getEffectiveStat(Stat.ATK); + expect(burntAtk).toBeCloseTo(prevAtk / 2, 1); }); it("ability effect should not persist when the ability is replaced", async () => { - game.override - .enemyMoveset([Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED]) - .statusEffect(StatusEffect.POISON); + game.override.enemyMoveset(Moves.WORRY_SEED).statusEffect(StatusEffect.POISON); await game.classicMode.startBattle([Species.MAGIKARP]); @@ -98,7 +104,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -116,7 +122,7 @@ describe("Abilities - Magic Guard", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -140,7 +146,7 @@ describe("Abilities - Magic Guard", () => { const toxicStartCounter = enemyPokemon.status!.toxicTurnCount; //should be 0 - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -165,7 +171,7 @@ describe("Abilities - Magic Guard", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -190,7 +196,7 @@ describe("Abilities - Magic Guard", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -214,7 +220,7 @@ describe("Abilities - Magic Guard", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -236,7 +242,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.HIGH_JUMP_KICK); await game.move.forceMiss(); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -253,7 +259,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.TAKE_DOWN); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -270,7 +276,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.STRUGGLE); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -279,8 +285,7 @@ describe("Abilities - Magic Guard", () => { expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp()); }); - //This tests different move attributes than the recoil tests above - it("Magic Guard prevents self-damage from attacking moves", async () => { + it("should prevent self-damage from attacking moves", async () => { game.override.moveset([Moves.STEEL_BEAM]); await game.classicMode.startBattle([Species.MAGIKARP]); @@ -288,7 +293,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.STEEL_BEAM); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -297,17 +302,19 @@ describe("Abilities - Magic Guard", () => { expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); }); - /* - it("Magic Guard does not prevent self-damage from confusion", async () => { + it("should not prevent self-damage from confusion", async () => { + game.override.enemyMoveset(Moves.CONFUSE_RAY).confusionActivation(true); await game.classicMode.startBattle([Species.MAGIKARP]); game.move.select(Moves.CHARM); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); + + expect(game.scene.getPlayerPokemon()!.isFullHp()).toBe(false); }); -*/ - it("Magic Guard does not prevent self-damage from non-attacking moves", async () => { + it("should not prevent self-damage from non-attacking moves", async () => { game.override.moveset([Moves.BELLY_DRUM]); await game.classicMode.startBattle([Species.MAGIKARP]); @@ -315,7 +322,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.BELLY_DRUM); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -325,10 +332,7 @@ describe("Abilities - Magic Guard", () => { }); it("Magic Guard prevents damage from abilities with PostTurnHurtIfSleepingAbAttr", async () => { - //Tests the ability Bad Dreams - game.override.statusEffect(StatusEffect.SLEEP); - //enemy pokemon is given Spore just in case player pokemon somehow awakens during test - game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]).enemyAbility(Abilities.BAD_DREAMS); + game.override.statusEffect(StatusEffect.SLEEP).enemyMoveset(Moves.SPORE).enemyAbility(Abilities.BAD_DREAMS); await game.classicMode.startBattle([Species.MAGIKARP]); @@ -336,7 +340,7 @@ describe("Abilities - Magic Guard", () => { game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -347,8 +351,7 @@ describe("Abilities - Magic Guard", () => { expect(leadPokemon.status!.effect).toBe(StatusEffect.SLEEP); }); - it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async () => { - //Tests the abilities Innards Out/Aftermath + it("should prevent damage from abilities with PostFaintContactDamageAbAttr", async () => { game.override.moveset([Moves.TACKLE]).enemyAbility(Abilities.AFTERMATH); await game.classicMode.startBattle([Species.MAGIKARP]); @@ -359,7 +362,7 @@ describe("Abilities - Magic Guard", () => { enemyPokemon.hp = 1; game.move.select(Moves.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -381,7 +384,7 @@ describe("Abilities - Magic Guard", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -403,7 +406,7 @@ describe("Abilities - Magic Guard", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.ABSORB); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: @@ -420,7 +423,7 @@ describe("Abilities - Magic Guard", () => { await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); /** * Expect: diff --git a/test/abilities/mycelium_might.test.ts b/test/abilities/mycelium_might.test.ts index c744b6528a2..032e01ebd51 100644 --- a/test/abilities/mycelium_might.test.ts +++ b/test/abilities/mycelium_might.test.ts @@ -30,7 +30,7 @@ describe("Abilities - Mycelium Might", () => { .enemySpecies(Species.SHUCKLE) .enemyAbility(Abilities.CLEAR_BODY) - .enemyMoveset([Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK]) + .enemyMoveset(Moves.QUICK_ATTACK) .ability(Abilities.MYCELIUM_MIGHT) .moveset([Moves.QUICK_ATTACK, Moves.BABY_DOLL_EYES]); }); @@ -66,7 +66,7 @@ describe("Abilities - Mycelium Might", () => { }); it("will still go first if a status move that is in a higher priority bracket than the opponent's move is used", async () => { - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.enemyMoveset(Moves.TACKLE); await game.classicMode.startBattle([Species.REGIELEKI]); const enemyPokemon = game.scene.getEnemyPokemon(); diff --git a/test/abilities/power_construct.test.ts b/test/abilities/power_construct.test.ts index 645adb94711..487a8c86de2 100644 --- a/test/abilities/power_construct.test.ts +++ b/test/abilities/power_construct.test.ts @@ -29,7 +29,7 @@ describe("Abilities - POWER CONSTRUCT", () => { .battleStyle("single") .ability(Abilities.POWER_CONSTRUCT) .moveset([moveToUse]) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + .enemyMoveset(Moves.TACKLE); }); test("check if fainted 50% Power Construct Pokemon switches to base form on arena reset", async () => { diff --git a/test/abilities/protean.test.ts b/test/abilities/protean.test.ts index 694f48e8b59..44979f81490 100644 --- a/test/abilities/protean.test.ts +++ b/test/abilities/protean.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Protean", () => { .ability(Abilities.PROTEAN) .startingLevel(100) .enemySpecies(Species.RATTATA) - .enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]); + .enemyMoveset(Moves.ENDURE); }); test("ability applies and changes a pokemon's type", async () => { @@ -172,7 +172,7 @@ describe("Abilities - Protean", () => { }); test("ability applies correctly even if the pokemon's move is protected against", async () => { - game.override.moveset([Moves.TACKLE]).enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]); + game.override.moveset([Moves.TACKLE]).enemyMoveset(Moves.PROTECT); await game.classicMode.startBattle([Species.MAGIKARP]); diff --git a/test/abilities/sand_veil.test.ts b/test/abilities/sand_veil.test.ts index 160bb208220..a74538fef16 100644 --- a/test/abilities/sand_veil.test.ts +++ b/test/abilities/sand_veil.test.ts @@ -32,7 +32,7 @@ describe("Abilities - Sand Veil", () => { .moveset([Moves.SPLASH]) .enemySpecies(Species.MEOWSCARADA) .enemyAbility(Abilities.INSOMNIA) - .enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]) + .enemyMoveset(Moves.TWISTER) .startingLevel(100) .enemyLevel(100) .weather(WeatherType.SANDSTORM) diff --git a/test/abilities/schooling.test.ts b/test/abilities/schooling.test.ts index 20e3cebf610..fb59140c23c 100644 --- a/test/abilities/schooling.test.ts +++ b/test/abilities/schooling.test.ts @@ -25,11 +25,7 @@ describe("Abilities - SCHOOLING", () => { beforeEach(() => { game = new GameManager(phaserGame); const moveToUse = Moves.SPLASH; - game.override - .battleStyle("single") - .ability(Abilities.SCHOOLING) - .moveset([moveToUse]) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.battleStyle("single").ability(Abilities.SCHOOLING).moveset([moveToUse]).enemyMoveset(Moves.TACKLE); }); test("check if fainted pokemon switches to base form on arena reset", async () => { diff --git a/test/abilities/screen_cleaner.test.ts b/test/abilities/screen_cleaner.test.ts index aa1c6170bcf..8b3b7140788 100644 --- a/test/abilities/screen_cleaner.test.ts +++ b/test/abilities/screen_cleaner.test.ts @@ -28,9 +28,7 @@ describe("Abilities - Screen Cleaner", () => { }); it("removes Aurora Veil", async () => { - game.override - .moveset([Moves.HAIL]) - .enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]); + game.override.moveset([Moves.HAIL]).enemyMoveset(Moves.AURORA_VEIL); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); @@ -47,7 +45,7 @@ describe("Abilities - Screen Cleaner", () => { }); it("removes Light Screen", async () => { - game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]); + game.override.enemyMoveset(Moves.LIGHT_SCREEN); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); @@ -64,7 +62,7 @@ describe("Abilities - Screen Cleaner", () => { }); it("removes Reflect", async () => { - game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]); + game.override.enemyMoveset(Moves.REFLECT); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); diff --git a/test/abilities/stall.test.ts b/test/abilities/stall.test.ts index dcf98660477..9c5980773fa 100644 --- a/test/abilities/stall.test.ts +++ b/test/abilities/stall.test.ts @@ -27,7 +27,7 @@ describe("Abilities - Stall", () => { .disableCrits() .enemySpecies(Species.REGIELEKI) .enemyAbility(Abilities.STALL) - .enemyMoveset([Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK]) + .enemyMoveset(Moves.QUICK_ATTACK) .moveset([Moves.QUICK_ATTACK, Moves.TACKLE]); }); diff --git a/test/abilities/sweet_veil.test.ts b/test/abilities/sweet_veil.test.ts index cc15c68f62d..4f3eaaabbf5 100644 --- a/test/abilities/sweet_veil.test.ts +++ b/test/abilities/sweet_veil.test.ts @@ -30,7 +30,7 @@ describe("Abilities - Sweet Veil", () => { .moveset([Moves.SPLASH, Moves.REST, Moves.YAWN]) .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset([Moves.POWDER, Moves.POWDER, Moves.POWDER, Moves.POWDER]); + .enemyMoveset(Moves.POWDER); }); it("prevents the user and its allies from falling asleep", async () => { @@ -57,7 +57,7 @@ describe("Abilities - Sweet Veil", () => { }); it("causes Yawn to fail if used on the user or its allies", async () => { - game.override.enemyMoveset([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]); + game.override.enemyMoveset(Moves.YAWN); await game.classicMode.startBattle([Species.SWIRLIX, Species.MAGIKARP]); game.move.select(Moves.SPLASH); diff --git a/test/abilities/unseen_fist.test.ts b/test/abilities/unseen_fist.test.ts index 38c569c8b9a..8f787d99d83 100644 --- a/test/abilities/unseen_fist.test.ts +++ b/test/abilities/unseen_fist.test.ts @@ -28,7 +28,7 @@ describe("Abilities - Unseen Fist", () => { .battleStyle("single") .starterSpecies(Species.URSHIFU) .enemySpecies(Species.SNORLAX) - .enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]) + .enemyMoveset(Moves.PROTECT) .startingLevel(100) .enemyLevel(100); }); @@ -73,7 +73,7 @@ async function testUnseenFistHitResult( protectMove: Moves, shouldSucceed = true, ): Promise { - game.override.moveset([attackMove]).enemyMoveset([protectMove, protectMove, protectMove, protectMove]); + game.override.moveset([attackMove]).enemyMoveset(protectMove); await game.classicMode.startBattle(); diff --git a/test/battle/battle.test.ts b/test/battle/battle.test.ts index 3d9619934af..26424b07bde 100644 --- a/test/battle/battle.test.ts +++ b/test/battle/battle.test.ts @@ -26,7 +26,7 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { Biome } from "#app/enums/biome"; -describe("Test Battle Phase", () => { +describe("Test - Battle Phase", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -95,7 +95,7 @@ describe("Test Battle Phase", () => { .startingLevel(2000) .startingWave(3) .battleStyle("single") - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + .enemyMoveset(Moves.TACKLE); await game.classicMode.startBattle([Species.MEWTWO]); game.move.select(Moves.TACKLE); await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(SelectModifierPhase, false); @@ -108,7 +108,7 @@ describe("Test Battle Phase", () => { .startingWave(3) .moveset([Moves.TACKLE]) .enemyAbility(Abilities.HYDRATION) - .enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]) + .enemyMoveset(Moves.TAIL_WHIP) .battleStyle("single"); await game.classicMode.startBattle([Species.MEWTWO]); game.move.select(Moves.TACKLE); @@ -205,7 +205,7 @@ describe("Test Battle Phase", () => { { name: "2v1", double: false, qty: 2 }, { name: "2v2", double: true, qty: 2 }, { name: "4v2", double: true, qty: 4 }, - ])("should not crash when starting $1 battle", async ({ double, qty }) => { + ])("should not crash when starting $name battle", async ({ double, qty }) => { game.override .battleStyle(double ? "double" : "single") .enemySpecies(Species.MIGHTYENA) @@ -213,11 +213,11 @@ describe("Test Battle Phase", () => { .ability(Abilities.HYDRATION); await game.classicMode.startBattle( - [Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE].slice(qty), + [Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE].slice(0, qty), ); expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND); - expect(game.scene.getCurrentPhase()).toBeInstanceOf(CommandPhase.name); + expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name); }); it("kill opponent pokemon", async () => { @@ -231,7 +231,7 @@ describe("Test Battle Phase", () => { .startingLevel(2000) .startingWave(3) .moveset([moveToUse]) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + .enemyMoveset(Moves.TACKLE); await game.classicMode.startBattle([Species.DARMANITAN, Species.CHARIZARD]); game.move.select(moveToUse); @@ -250,7 +250,7 @@ describe("Test Battle Phase", () => { .startingLevel(2000) .startingWave(3) .moveset([moveToUse]) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + .enemyMoveset(Moves.TACKLE); await game.classicMode.startBattle([Species.MEWTWO]); const turn = game.scene.currentBattle.turn; game.move.select(moveToUse); @@ -270,7 +270,7 @@ describe("Test Battle Phase", () => { .startingWave(3) .startingBiome(Biome.LAKE) .moveset([moveToUse]) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + .enemyMoveset(Moves.TACKLE); await game.classicMode.startBattle(); const waveIndex = game.scene.currentBattle.waveIndex; game.move.select(moveToUse); diff --git a/test/battle/inverse_battle.test.ts b/test/battle/inverse_battle.test.ts index 799442bb603..168df0b9505 100644 --- a/test/battle/inverse_battle.test.ts +++ b/test/battle/inverse_battle.test.ts @@ -188,9 +188,7 @@ describe("Inverse Battle", () => { }); it("Conversion 2 should change the type to the resistive type - Conversion 2 against Dragonite", async () => { - game.override - .moveset([Moves.CONVERSION_2]) - .enemyMoveset([Moves.DRAGON_CLAW, Moves.DRAGON_CLAW, Moves.DRAGON_CLAW, Moves.DRAGON_CLAW]); + game.override.moveset([Moves.CONVERSION_2]).enemyMoveset(Moves.DRAGON_CLAW); await game.challengeMode.startBattle(); diff --git a/test/battle/special_battle.test.ts b/test/battle/special_battle.test.ts index 703c6941cdf..a9ba028d482 100644 --- a/test/battle/special_battle.test.ts +++ b/test/battle/special_battle.test.ts @@ -29,7 +29,7 @@ describe("Test Battle Phase", () => { .moveset([Moves.TACKLE]) .enemyAbility(Abilities.HYDRATION) .ability(Abilities.HYDRATION) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + .enemyMoveset(Moves.TACKLE); }); it("startBattle 2vs1 boss", async () => { diff --git a/test/items/leek.test.ts b/test/items/leek.test.ts index 780cdc99ff0..fcc8be143e2 100644 --- a/test/items/leek.test.ts +++ b/test/items/leek.test.ts @@ -25,7 +25,7 @@ describe("Items - Leek", () => { game.override .enemySpecies(Species.MAGIKARP) - .enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]) + .enemyMoveset(Moves.SPLASH) .startingHeldItems([{ name: "LEEK" }]) .moveset([Moves.TACKLE]) .battleStyle("single"); diff --git a/test/items/leftovers.test.ts b/test/items/leftovers.test.ts index e960c000167..c0f836831d6 100644 --- a/test/items/leftovers.test.ts +++ b/test/items/leftovers.test.ts @@ -30,7 +30,7 @@ describe("Items - Leftovers", () => { .moveset([Moves.SPLASH]) .enemySpecies(Species.SHUCKLE) .enemyAbility(Abilities.UNNERVE) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]) + .enemyMoveset(Moves.TACKLE) .startingHeldItems([{ name: "LEFTOVERS", count: 1 }]); }); diff --git a/test/moves/astonish.test.ts b/test/moves/astonish.test.ts index 99147d32e21..c07b0d7d2c5 100644 --- a/test/moves/astonish.test.ts +++ b/test/moves/astonish.test.ts @@ -32,7 +32,7 @@ describe("Moves - Astonish", () => { .moveset([Moves.ASTONISH, Moves.SPLASH]) .enemySpecies(Species.BLASTOISE) .enemyAbility(Abilities.INSOMNIA) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]) + .enemyMoveset(Moves.TACKLE) .startingLevel(100) .enemyLevel(100); diff --git a/test/moves/aurora_veil.test.ts b/test/moves/aurora_veil.test.ts index 7994870299f..76569ac4a0e 100644 --- a/test/moves/aurora_veil.test.ts +++ b/test/moves/aurora_veil.test.ts @@ -42,7 +42,7 @@ describe("Moves - Aurora Veil", () => { .moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]) .enemyLevel(100) .enemySpecies(Species.MAGIKARP) - .enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]) + .enemyMoveset(Moves.AURORA_VEIL) .disableCrits() .weather(WeatherType.HAIL); }); diff --git a/test/moves/double_team.test.ts b/test/moves/double_team.test.ts index da9b24290fc..aa07ee5f688 100644 --- a/test/moves/double_team.test.ts +++ b/test/moves/double_team.test.ts @@ -30,7 +30,7 @@ describe("Moves - Double Team", () => { .ability(Abilities.BALL_FETCH) .enemySpecies(Species.SHUCKLE) .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + .enemyMoveset(Moves.TACKLE); }); it("raises the user's EVA stat stage by 1", async () => { diff --git a/test/moves/dynamax_cannon.test.ts b/test/moves/dynamax_cannon.test.ts index 3a869d4a3e0..ccc38fbed72 100644 --- a/test/moves/dynamax_cannon.test.ts +++ b/test/moves/dynamax_cannon.test.ts @@ -36,7 +36,7 @@ describe("Moves - Dynamax Cannon", () => { .battleStyle("single") .disableCrits() .enemySpecies(Species.MAGIKARP) - .enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); + .enemyMoveset(Moves.SPLASH); vi.spyOn(allMoves[Moves.DYNAMAX_CANNON], "calculateBattlePower"); }); diff --git a/test/moves/flower_shield.test.ts b/test/moves/flower_shield.test.ts index 6c7f8277008..df1b0fa29f4 100644 --- a/test/moves/flower_shield.test.ts +++ b/test/moves/flower_shield.test.ts @@ -75,7 +75,7 @@ describe("Moves - Flower Shield", () => { * See semi-vulnerable state tags. {@linkcode SemiInvulnerableTag} */ it("does not raise DEF stat stage for a Pokemon in semi-vulnerable state", async () => { - game.override.enemySpecies(Species.PARAS).enemyMoveset([Moves.DIG, Moves.DIG, Moves.DIG, Moves.DIG]).enemyLevel(50); + game.override.enemySpecies(Species.PARAS).enemyMoveset(Moves.DIG).enemyLevel(50); await game.classicMode.startBattle([Species.CHERRIM]); const paras = game.scene.getEnemyPokemon()!; diff --git a/test/moves/freezy_frost.test.ts b/test/moves/freezy_frost.test.ts index 7cee9bfb372..2b2e06bfe74 100644 --- a/test/moves/freezy_frost.test.ts +++ b/test/moves/freezy_frost.test.ts @@ -27,7 +27,7 @@ describe("Moves - Freezy Frost", () => { .battleStyle("single") .enemySpecies(Species.RATTATA) .enemyLevel(100) - .enemyMoveset([Moves.HOWL, Moves.HOWL, Moves.HOWL, Moves.HOWL]) + .enemyMoveset(Moves.HOWL) .enemyAbility(Abilities.BALL_FETCH) .startingLevel(100) .moveset([Moves.FREEZY_FROST, Moves.HOWL, Moves.SPLASH]) @@ -55,7 +55,7 @@ describe("Moves - Freezy Frost", () => { }); it("should clear all stat changes even when enemy uses the move", async () => { - game.override.enemyMoveset([Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST]); + game.override.enemyMoveset(Moves.FREEZY_FROST); await game.classicMode.startBattle([Species.SHUCKLE]); // Shuckle for slower Howl on first turn so Freezy Frost doesn't affect it. const user = game.scene.getPlayerPokemon()!; diff --git a/test/moves/fusion_bolt.test.ts b/test/moves/fusion_bolt.test.ts index 7aa653efeee..3004f733cc8 100644 --- a/test/moves/fusion_bolt.test.ts +++ b/test/moves/fusion_bolt.test.ts @@ -28,7 +28,7 @@ describe("Moves - Fusion Bolt", () => { .startingLevel(1) .enemySpecies(Species.RESHIRAM) .enemyAbility(Abilities.ROUGH_SKIN) - .enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]) + .enemyMoveset(Moves.SPLASH) .battleStyle("single") .startingWave(97) .disableCrits(); diff --git a/test/moves/fusion_flare.test.ts b/test/moves/fusion_flare.test.ts index 8462906f0c1..9f16b94da5c 100644 --- a/test/moves/fusion_flare.test.ts +++ b/test/moves/fusion_flare.test.ts @@ -28,7 +28,7 @@ describe("Moves - Fusion Flare", () => { .moveset([fusionFlare]) .startingLevel(1) .enemySpecies(Species.RATTATA) - .enemyMoveset([Moves.REST, Moves.REST, Moves.REST, Moves.REST]) + .enemyMoveset(Moves.REST) .battleStyle("single") .startingWave(97) .disableCrits(); diff --git a/test/moves/fusion_flare_bolt.test.ts b/test/moves/fusion_flare_bolt.test.ts index 51143ab72c4..63bfa114df3 100644 --- a/test/moves/fusion_flare_bolt.test.ts +++ b/test/moves/fusion_flare_bolt.test.ts @@ -37,7 +37,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { .moveset([fusionFlare.id, fusionBolt.id]) .startingLevel(1) .enemySpecies(Species.RESHIRAM) - .enemyMoveset([Moves.REST, Moves.REST, Moves.REST, Moves.REST]) + .enemyMoveset(Moves.REST) .battleStyle("double") .startingWave(97) .disableCrits(); @@ -112,7 +112,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { }); it("FUSION_FLARE should not double power of subsequent FUSION_BOLT if a move succeeded in between", async () => { - game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); + game.override.enemyMoveset(Moves.SPLASH); await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]); game.move.select(fusionFlare.id, 0, BattlerIndex.ENEMY); @@ -157,7 +157,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { }); it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves", async () => { - game.override.enemyMoveset([fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id]); + game.override.enemyMoveset(fusionFlare.id); await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]); const party = game.scene.getPlayerParty(); @@ -211,7 +211,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => { }); it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves if moves are aimed at allies", async () => { - game.override.enemyMoveset([fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id]); + game.override.enemyMoveset(fusionFlare.id); await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]); const party = game.scene.getPlayerParty(); diff --git a/test/moves/light_screen.test.ts b/test/moves/light_screen.test.ts index d9614551fe1..6ce51da68cd 100644 --- a/test/moves/light_screen.test.ts +++ b/test/moves/light_screen.test.ts @@ -41,7 +41,7 @@ describe("Moves - Light Screen", () => { .moveset([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]) .enemyLevel(100) .enemySpecies(Species.MAGIKARP) - .enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]) + .enemyMoveset(Moves.LIGHT_SCREEN) .disableCrits(); }); diff --git a/test/moves/magnet_rise.test.ts b/test/moves/magnet_rise.test.ts index c7b2094ceb4..0ece592c621 100644 --- a/test/moves/magnet_rise.test.ts +++ b/test/moves/magnet_rise.test.ts @@ -27,7 +27,7 @@ describe("Moves - Magnet Rise", () => { .battleStyle("single") .starterSpecies(Species.MAGNEZONE) .enemySpecies(Species.RATTATA) - .enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]) + .enemyMoveset(Moves.DRILL_RUN) .disableCrits() .enemyLevel(1) .moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]); diff --git a/test/moves/reflect.test.ts b/test/moves/reflect.test.ts index 4e6197aab12..191a1a45a09 100644 --- a/test/moves/reflect.test.ts +++ b/test/moves/reflect.test.ts @@ -41,7 +41,7 @@ describe("Moves - Reflect", () => { .moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]) .enemyLevel(100) .enemySpecies(Species.MAGIKARP) - .enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]) + .enemyMoveset(Moves.REFLECT) .disableCrits(); }); diff --git a/test/moves/retaliate.test.ts b/test/moves/retaliate.test.ts index 40f31635d9b..24d0cd542cb 100644 --- a/test/moves/retaliate.test.ts +++ b/test/moves/retaliate.test.ts @@ -28,7 +28,7 @@ describe("Moves - Retaliate", () => { game.override .battleStyle("single") .enemySpecies(Species.SNORLAX) - .enemyMoveset([Moves.RETALIATE, Moves.RETALIATE, Moves.RETALIATE, Moves.RETALIATE]) + .enemyMoveset(Moves.RETALIATE) .enemyLevel(100) .moveset([Moves.RETALIATE, Moves.SPLASH]) .startingLevel(80) diff --git a/test/moves/swallow.test.ts b/test/moves/swallow.test.ts index b998bbccf55..6a2fa8840ea 100644 --- a/test/moves/swallow.test.ts +++ b/test/moves/swallow.test.ts @@ -33,7 +33,7 @@ describe("Moves - Swallow", () => { .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.NONE) .enemyLevel(2000) - .moveset([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]) + .moveset(Moves.SWALLOW) .ability(Abilities.NONE); }); diff --git a/test/moves/tackle.test.ts b/test/moves/tackle.test.ts index a680cc6db1b..a834867185d 100644 --- a/test/moves/tackle.test.ts +++ b/test/moves/tackle.test.ts @@ -30,7 +30,7 @@ describe("Moves - Tackle", () => { .startingLevel(1) .startingWave(97) .moveset([moveToUse]) - .enemyMoveset([Moves.GROWTH, Moves.GROWTH, Moves.GROWTH, Moves.GROWTH]) + .enemyMoveset(Moves.GROWTH) .disableCrits(); }); diff --git a/test/moves/tidy_up.test.ts b/test/moves/tidy_up.test.ts index 2f6d3036eb8..2be7b331556 100644 --- a/test/moves/tidy_up.test.ts +++ b/test/moves/tidy_up.test.ts @@ -38,9 +38,7 @@ describe("Moves - Tidy Up", () => { }); it("spikes are cleared", async () => { - game.override - .moveset([Moves.SPIKES, Moves.TIDY_UP]) - .enemyMoveset([Moves.SPIKES, Moves.SPIKES, Moves.SPIKES, Moves.SPIKES]); + game.override.moveset([Moves.SPIKES, Moves.TIDY_UP]).enemyMoveset(Moves.SPIKES); await game.classicMode.startBattle(); game.move.select(Moves.SPIKES); @@ -51,9 +49,7 @@ describe("Moves - Tidy Up", () => { }); it("stealth rocks are cleared", async () => { - game.override - .moveset([Moves.STEALTH_ROCK, Moves.TIDY_UP]) - .enemyMoveset([Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK]); + game.override.moveset([Moves.STEALTH_ROCK, Moves.TIDY_UP]).enemyMoveset(Moves.STEALTH_ROCK); await game.classicMode.startBattle(); game.move.select(Moves.STEALTH_ROCK); @@ -64,9 +60,7 @@ describe("Moves - Tidy Up", () => { }); it("toxic spikes are cleared", async () => { - game.override - .moveset([Moves.TOXIC_SPIKES, Moves.TIDY_UP]) - .enemyMoveset([Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES]); + game.override.moveset([Moves.TOXIC_SPIKES, Moves.TIDY_UP]).enemyMoveset(Moves.TOXIC_SPIKES); await game.classicMode.startBattle(); game.move.select(Moves.TOXIC_SPIKES); @@ -77,9 +71,7 @@ describe("Moves - Tidy Up", () => { }); it("sticky webs are cleared", async () => { - game.override - .moveset([Moves.STICKY_WEB, Moves.TIDY_UP]) - .enemyMoveset([Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB]); + game.override.moveset([Moves.STICKY_WEB, Moves.TIDY_UP]).enemyMoveset(Moves.STICKY_WEB); await game.classicMode.startBattle(); @@ -91,9 +83,7 @@ describe("Moves - Tidy Up", () => { }); it("substitutes are cleared", async () => { - game.override - .moveset([Moves.SUBSTITUTE, Moves.TIDY_UP]) - .enemyMoveset([Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE]); + game.override.moveset([Moves.SUBSTITUTE, Moves.TIDY_UP]).enemyMoveset(Moves.SUBSTITUTE); await game.classicMode.startBattle();