From 11d912bad8f2ec36b36d7151afa5e3e649e2b834 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Mon, 9 Sep 2024 09:55:11 -0700 Subject: [PATCH] [Dev] Make `OPP_MOVESET_OVERRIDE` fully override the enemy's moveset (#4062) * Make `OPP_MOVESET_OVERRIDE` fully override the enemy's moveset * Update tests with new override behavior * Fix tests * Fix another test * Move overrides no longer required to be arrays * Remove `SPLASH_ONLY` test utility variable * Update moveset override helper functions * Missed some tests --- src/field/pokemon.ts | 10 ++- src/overrides.ts | 4 +- src/test/abilities/aura_break.test.ts | 3 +- src/test/abilities/battery.test.ts | 3 +- src/test/abilities/beast_boost.test.ts | 5 +- src/test/abilities/contrary.test.ts | 8 +- src/test/abilities/costar.test.ts | 3 +- src/test/abilities/dancer.test.ts | 2 +- src/test/abilities/disguise.test.ts | 7 +- src/test/abilities/dry_skin.test.ts | 80 ++++++++----------- src/test/abilities/flash_fire.test.ts | 13 ++- src/test/abilities/flower_gift.test.ts | 7 +- src/test/abilities/forecast.test.ts | 7 +- src/test/abilities/galvanize.test.ts | 3 +- src/test/abilities/gulp_missile.test.ts | 19 +++-- src/test/abilities/heatproof.test.ts | 3 +- src/test/abilities/hustle.test.ts | 3 +- src/test/abilities/hyper_cutter.test.ts | 3 +- src/test/abilities/imposter.test.ts | 7 +- src/test/abilities/intimidate.test.ts | 5 +- src/test/abilities/libero.test.ts | 3 +- src/test/abilities/magic_guard.test.ts | 3 +- src/test/abilities/moody.test.ts | 5 +- src/test/abilities/moxie.test.ts | 3 +- src/test/abilities/parental_bond.test.ts | 7 +- src/test/abilities/pastel_veil.test.ts | 3 +- src/test/abilities/power_spot.test.ts | 3 +- src/test/abilities/protean.test.ts | 3 +- src/test/abilities/quick_draw.test.ts | 4 +- src/test/abilities/sand_spit.test.ts | 4 +- src/test/abilities/sap_sipper.test.ts | 11 ++- src/test/abilities/simple.test.ts | 8 +- src/test/abilities/steely_spirit.test.ts | 3 +- src/test/abilities/sweet_veil.test.ts | 5 +- src/test/abilities/tera_shell.test.ts | 8 +- src/test/abilities/wind_power.test.ts | 3 +- src/test/abilities/wind_rider.test.ts | 3 +- src/test/abilities/wonder_skin.test.ts | 3 +- src/test/abilities/zero_to_hero.test.ts | 5 +- src/test/arena/arena_gravity.test.ts | 3 +- src/test/arena/weather_fog.test.ts | 2 +- src/test/arena/weather_hail.test.ts | 5 +- src/test/arena/weather_sandstorm.test.ts | 5 +- src/test/battle/battle.test.ts | 3 +- src/test/battle/damage_calculation.test.ts | 3 +- src/test/battle/double_battle.test.ts | 3 +- src/test/battle/inverse_battle.test.ts | 3 +- src/test/boss-pokemon.test.ts | 3 +- src/test/evolution.test.ts | 5 +- src/test/final_boss.test.ts | 3 +- src/test/items/dire_hit.test.ts | 3 +- .../double_battle_chance_booster.test.ts | 3 +- src/test/items/grip_claw.test.ts | 3 +- src/test/items/scope_lens.test.ts | 3 +- .../items/temp_stat_stage_booster.test.ts | 3 +- src/test/moves/alluring_voice.test.ts | 2 +- src/test/moves/baton_pass.test.ts | 10 ++- src/test/moves/beak_blast.test.ts | 6 +- src/test/moves/beat_up.test.ts | 2 +- src/test/moves/belly_drum.test.ts | 3 +- src/test/moves/burning_jealousy.test.ts | 7 +- src/test/moves/clangorous_soul.test.ts | 3 +- src/test/moves/crafty_shield.test.ts | 6 +- src/test/moves/disable.test.ts | 7 +- src/test/moves/dragon_cheer.test.ts | 3 +- src/test/moves/dragon_rage.test.ts | 3 +- src/test/moves/dragon_tail.test.ts | 7 +- src/test/moves/fake_out.test.ts | 3 +- src/test/moves/fillet_away.test.ts | 3 +- src/test/moves/fissure.test.ts | 3 +- src/test/moves/flame_burst.test.ts | 2 +- src/test/moves/flower_shield.test.ts | 3 +- src/test/moves/focus_punch.test.ts | 7 +- src/test/moves/foresight.test.ts | 5 +- src/test/moves/freeze_dry.test.ts | 5 +- src/test/moves/freezy_frost.test.ts | 3 +- src/test/moves/gastro_acid.test.ts | 3 +- src/test/moves/gigaton_hammer.test.ts | 3 +- src/test/moves/glaive_rush.test.ts | 10 +-- src/test/moves/growth.test.ts | 3 +- src/test/moves/guard_split.test.ts | 5 +- src/test/moves/guard_swap.test.ts | 2 +- src/test/moves/hard_press.test.ts | 3 +- src/test/moves/haze.test.ts | 3 +- src/test/moves/hyper_beam.test.ts | 2 +- src/test/moves/jaw_lock.test.ts | 5 +- src/test/moves/lash_out.test.ts | 2 +- src/test/moves/lucky_chant.test.ts | 4 +- src/test/moves/lunar_blessing.test.ts | 3 +- src/test/moves/make_it_rain.test.ts | 3 +- src/test/moves/mat_block.test.ts | 4 +- src/test/moves/miracle_eye.test.ts | 3 +- src/test/moves/multi_target.test.ts | 3 +- src/test/moves/octolock.test.ts | 3 +- src/test/moves/parting_shot.test.ts | 5 +- src/test/moves/power_split.test.ts | 5 +- src/test/moves/power_swap.test.ts | 2 +- src/test/moves/protect.test.ts | 10 +-- src/test/moves/quick_guard.test.ts | 8 +- src/test/moves/rollout.test.ts | 3 +- src/test/moves/safeguard.test.ts | 10 ++- src/test/moves/shell_trap.test.ts | 9 +-- src/test/moves/speed_swap.test.ts | 3 +- src/test/moves/spikes.test.ts | 3 +- src/test/moves/spit_up.test.ts | 3 +- src/test/moves/stockpile.test.ts | 3 +- src/test/moves/swallow.test.ts | 3 +- src/test/moves/tail_whip.test.ts | 3 +- src/test/moves/tailwind.test.ts | 3 +- src/test/moves/tera_blast.test.ts | 3 +- src/test/moves/thunder_wave.test.ts | 3 +- src/test/moves/tidy_up.test.ts | 3 +- src/test/moves/transform.test.ts | 5 +- src/test/moves/u_turn.test.ts | 3 +- src/test/moves/wide_guard.test.ts | 8 +- src/test/reload.test.ts | 3 +- src/test/ui/type-hints.test.ts | 5 +- src/test/utils/helpers/overridesHelper.ts | 10 ++- src/test/utils/testUtils.ts | 4 - 119 files changed, 260 insertions(+), 352 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 01d728d6de0..4bc4aca448c 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -984,10 +984,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { : this.moveset; // Overrides moveset based on arrays specified in overrides.ts - const overrideArray: Array = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE; + let overrideArray: Moves | Array = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE; + if (!Array.isArray(overrideArray)) { + overrideArray = [overrideArray]; + } if (overrideArray.length > 0) { + if (!this.isPlayer()) { + this.moveset = []; + } overrideArray.forEach((move: Moves, index: number) => { - const ppUsed = this.moveset[index]?.ppUsed || 0; + const ppUsed = this.moveset[index]?.ppUsed ?? 0; this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp)); }); } diff --git a/src/overrides.ts b/src/overrides.ts index 48c118b55bc..d1597dfdee8 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -98,7 +98,7 @@ class DefaultOverrides { readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; readonly GENDER_OVERRIDE: Gender | null = null; - readonly MOVESET_OVERRIDE: Array = []; + readonly MOVESET_OVERRIDE: Moves | Array = []; readonly SHINY_OVERRIDE: boolean = false; readonly VARIANT_OVERRIDE: Variant = 0; @@ -111,7 +111,7 @@ class DefaultOverrides { readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; readonly OPP_GENDER_OVERRIDE: Gender | null = null; - readonly OPP_MOVESET_OVERRIDE: Array = []; + readonly OPP_MOVESET_OVERRIDE: Moves | Array = []; readonly OPP_SHINY_OVERRIDE: boolean = false; readonly OPP_VARIANT_OVERRIDE: Variant = 0; readonly OPP_IVS_OVERRIDE: number | number[] = []; diff --git a/src/test/abilities/aura_break.test.ts b/src/test/abilities/aura_break.test.ts index 0fb2212d817..422ac5178c1 100644 --- a/src/test/abilities/aura_break.test.ts +++ b/src/test/abilities/aura_break.test.ts @@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -27,7 +26,7 @@ describe("Abilities - Aura Break", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.AURA_BREAK); game.override.enemySpecies(Species.SHUCKLE); }); diff --git a/src/test/abilities/battery.test.ts b/src/test/abilities/battery.test.ts index 020866509d6..cd02ed0c4eb 100644 --- a/src/test/abilities/battery.test.ts +++ b/src/test/abilities/battery.test.ts @@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -31,7 +30,7 @@ describe("Abilities - Battery", () => { game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("raises the power of allies' special moves by 30%", async () => { diff --git a/src/test/abilities/beast_boost.test.ts b/src/test/abilities/beast_boost.test.ts index 05645a1231d..26bae7b8838 100644 --- a/src/test/abilities/beast_boost.test.ts +++ b/src/test/abilities/beast_boost.test.ts @@ -4,7 +4,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { Stat } from "#enums/stat"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -31,7 +30,7 @@ describe("Abilities - Beast Boost", () => { .ability(Abilities.BEAST_BOOST) .startingLevel(2000) .moveset([ Moves.FLAMETHROWER ]) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => { @@ -51,7 +50,7 @@ describe("Abilities - Beast Boost", () => { }, 20000); it("should use in-battle overriden stats when determining the stat stage to raise by 1", async() => { - game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT)); + game.override.enemyMoveset([Moves.GUARD_SPLIT]); await game.classicMode.startBattle([Species.SLOWBRO]); diff --git a/src/test/abilities/contrary.test.ts b/src/test/abilities/contrary.test.ts index 19ecc7e0240..95a209395dc 100644 --- a/src/test/abilities/contrary.test.ts +++ b/src/test/abilities/contrary.test.ts @@ -1,10 +1,10 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/utils/gameManager"; +import { Moves } from "#app/enums/moves"; import { Abilities } from "#enums/abilities"; import { Species } from "#enums/species"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Abilities - Contrary", () => { let phaserGame: Phaser.Game; @@ -27,7 +27,7 @@ describe("Abilities - Contrary", () => { .enemySpecies(Species.BULBASAUR) .enemyAbility(Abilities.CONTRARY) .ability(Abilities.INTIMIDATE) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); it("should invert stat changes when applied", async() => { diff --git a/src/test/abilities/costar.test.ts b/src/test/abilities/costar.test.ts index 96ec775f2a0..794bed0d3cf 100644 --- a/src/test/abilities/costar.test.ts +++ b/src/test/abilities/costar.test.ts @@ -5,7 +5,6 @@ import { Species } from "#app/enums/species"; import { CommandPhase } from "#app/phases/command-phase"; import { MessagePhase } from "#app/phases/message-phase"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; @@ -30,7 +29,7 @@ describe("Abilities - COSTAR", () => { game.override.battleType("double"); game.override.ability(Abilities.COSTAR); game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); diff --git a/src/test/abilities/dancer.test.ts b/src/test/abilities/dancer.test.ts index d80f497f8b2..ec5ce53f4c3 100644 --- a/src/test/abilities/dancer.test.ts +++ b/src/test/abilities/dancer.test.ts @@ -30,7 +30,7 @@ describe("Abilities - Dancer", () => { .moveset([Moves.SWORDS_DANCE, Moves.SPLASH]) .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.DANCER) - .enemyMoveset(Array(4).fill(Moves.VICTORY_DANCE)); + .enemyMoveset([Moves.VICTORY_DANCE]); }); // Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability) diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index ef145262954..fa7f26d2716 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -6,7 +6,6 @@ import { StatusEffect } from "#app/data/status-effect"; import { Stat } from "#enums/stat"; import GameManager from "#test/utils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -31,7 +30,7 @@ describe("Abilities - Disguise", () => { game.override .battleType("single") .enemySpecies(Species.MIMIKYU) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .starterSpecies(Species.REGIELEKI) .moveset([Moves.SHADOW_SNEAK, Moves.VACUUM_WAVE, Moves.TOXIC_THREAD, Moves.SPLASH]); }, TIMEOUT); @@ -108,7 +107,7 @@ describe("Abilities - Disguise", () => { }, TIMEOUT); it("persists form change when switched out", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)); + game.override.enemyMoveset([Moves.SHADOW_SNEAK]); game.override.starterSpecies(0); await game.classicMode.startBattle([ Species.MIMIKYU, Species.FURRET ]); @@ -194,7 +193,7 @@ describe("Abilities - Disguise", () => { }, TIMEOUT); it("doesn't faint twice when fainting due to Disguise break damage, nor prevent faint from Disguise break damage if using Endure", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.ENDURE)); + game.override.enemyMoveset([Moves.ENDURE]); await game.classicMode.startBattle(); const mimikyu = game.scene.getEnemyPokemon()!; diff --git a/src/test/abilities/dry_skin.test.ts b/src/test/abilities/dry_skin.test.ts index b337e4d96f7..1af8831f25b 100644 --- a/src/test/abilities/dry_skin.test.ts +++ b/src/test/abilities/dry_skin.test.ts @@ -1,9 +1,7 @@ import { Species } from "#app/enums/species"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -23,63 +21,56 @@ describe("Abilities - Dry Skin", () => { beforeEach(() => { game = new GameManager(phaserGame); - game.override.battleType("single"); - game.override.disableCrits(); - game.override.enemyAbility(Abilities.DRY_SKIN); - game.override.enemyMoveset(SPLASH_ONLY); - game.override.enemySpecies(Species.CHARMANDER); - game.override.ability(Abilities.UNNERVE); - game.override.starterSpecies(Species.CHANDELURE); + game.override + .battleType("single") + .disableCrits() + .enemyAbility(Abilities.DRY_SKIN) + .enemyMoveset(Moves.SPLASH) + .enemySpecies(Species.CHARMANDER) + .ability(Abilities.BALL_FETCH) + .moveset([Moves.SUNNY_DAY, Moves.RAIN_DANCE, Moves.SPLASH, Moves.WATER_GUN]) + .starterSpecies(Species.CHANDELURE); }); it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => { - game.override.moveset([Moves.SUNNY_DAY, Moves.SPLASH]); - - await game.startBattle(); + await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; - expect(enemy).not.toBe(undefined); // first turn - let previousEnemyHp = enemy.hp; game.move.select(Moves.SUNNY_DAY); - await game.phaseInterceptor.to(TurnEndPhase); - expect(enemy.hp).toBeLessThan(previousEnemyHp); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.hp).toBeLessThan(enemy.getMaxHp()); // second turn - previousEnemyHp = enemy.hp; + enemy.hp = enemy.getMaxHp(); game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - expect(enemy.hp).toBeLessThan(previousEnemyHp); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.hp).toBeLessThan(enemy.getMaxHp()); }); it("during rain, gain 1/8 of maximum health at the end of each turn", async () => { - game.override.moveset([Moves.RAIN_DANCE, Moves.SPLASH]); - - await game.startBattle(); + await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; - expect(enemy).not.toBe(undefined); enemy.hp = 1; // first turn - let previousEnemyHp = enemy.hp; game.move.select(Moves.RAIN_DANCE); - await game.phaseInterceptor.to(TurnEndPhase); - expect(enemy.hp).toBeGreaterThan(previousEnemyHp); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.hp).toBeGreaterThan(1); // second turn - previousEnemyHp = enemy.hp; + enemy.hp = 1; game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - expect(enemy.hp).toBeGreaterThan(previousEnemyHp); + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.hp).toBeGreaterThan(1); }); it("opposing fire attacks do 25% more damage", async () => { game.override.moveset([Moves.FLAMETHROWER]); - - await game.startBattle(); + await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; const initialHP = 1000; @@ -87,72 +78,65 @@ describe("Abilities - Dry Skin", () => { // first turn game.move.select(Moves.FLAMETHROWER); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); const fireDamageTakenWithDrySkin = initialHP - enemy.hp; - expect(enemy.hp > 0); enemy.hp = initialHP; game.override.enemyAbility(Abilities.NONE); // second turn game.move.select(Moves.FLAMETHROWER); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); const fireDamageTakenWithoutDrySkin = initialHP - enemy.hp; expect(fireDamageTakenWithDrySkin).toBeGreaterThan(fireDamageTakenWithoutDrySkin); }); it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => { - game.override.moveset([Moves.WATER_GUN]); - - await game.startBattle(); + await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; - expect(enemy).not.toBe(undefined); enemy.hp = 1; game.move.select(Moves.WATER_GUN); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(enemy.hp).toBeGreaterThan(1); }); it("opposing water attacks do not heal if they were protected from", async () => { - game.override.moveset([Moves.WATER_GUN]); + game.override.enemyMoveset([Moves.PROTECT]); - await game.startBattle(); + await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; - expect(enemy).not.toBe(undefined); enemy.hp = 1; - game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]); game.move.select(Moves.WATER_GUN); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(enemy.hp).toBe(1); }); it("multi-strike water attacks only heal once", async () => { game.override.moveset([Moves.WATER_GUN, Moves.WATER_SHURIKEN]); - await game.startBattle(); + await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; - expect(enemy).not.toBe(undefined); enemy.hp = 1; // first turn game.move.select(Moves.WATER_SHURIKEN); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); const healthGainedFromWaterShuriken = enemy.hp - 1; enemy.hp = 1; // second turn game.move.select(Moves.WATER_GUN); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); const healthGainedFromWaterGun = enemy.hp - 1; expect(healthGainedFromWaterShuriken).toBe(healthGainedFromWaterGun); diff --git a/src/test/abilities/flash_fire.test.ts b/src/test/abilities/flash_fire.test.ts index de40873998f..c3cf31496ea 100644 --- a/src/test/abilities/flash_fire.test.ts +++ b/src/test/abilities/flash_fire.test.ts @@ -7,7 +7,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -38,7 +37,7 @@ describe("Abilities - Flash Fire", () => { it("immune to Fire-type moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY); + game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH); await game.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; @@ -49,7 +48,7 @@ describe("Abilities - Flash Fire", () => { }, 20000); it("not activate if the Pokémon is protected from the Fire-type move", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.PROTECT]); + game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.PROTECT]); await game.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; @@ -60,7 +59,7 @@ describe("Abilities - Flash Fire", () => { }, 20000); it("activated by Will-O-Wisp", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.WILL_O_WISP)).moveset(SPLASH_ONLY); + game.override.enemyMoveset([Moves.WILL_O_WISP]).moveset(Moves.SPLASH); await game.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; @@ -75,7 +74,7 @@ describe("Abilities - Flash Fire", () => { }, 20000); it("activated after being frozen", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY); + game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH); game.override.statusEffect(StatusEffect.FREEZE); await game.startBattle([Species.BLISSEY]); @@ -88,7 +87,7 @@ describe("Abilities - Flash Fire", () => { }, 20000); it("not passing with baton pass", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.BATON_PASS]); + game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.BATON_PASS]); await game.startBattle([Species.BLISSEY, Species.CHANSEY]); // ensure use baton pass after enemy moved @@ -104,7 +103,7 @@ describe("Abilities - Flash Fire", () => { }, 20000); it("boosts Fire-type move when the ability is activated", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.FIRE_PLEDGE)).moveset([Moves.EMBER, Moves.SPLASH]); + game.override.enemyMoveset([Moves.FIRE_PLEDGE]).moveset([Moves.EMBER, Moves.SPLASH]); game.override.enemyAbility(Abilities.FLASH_FIRE).ability(Abilities.NONE); await game.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; diff --git a/src/test/abilities/flower_gift.test.ts b/src/test/abilities/flower_gift.test.ts index de07bd29478..256b61c6fea 100644 --- a/src/test/abilities/flower_gift.test.ts +++ b/src/test/abilities/flower_gift.test.ts @@ -5,7 +5,6 @@ import { WeatherType } from "#app/enums/weather-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -44,7 +43,7 @@ describe("Abilities - Flower Gift", () => { game.override .moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.SKILL_SWAP]) .enemySpecies(Species.MAGIKARP) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH); }); @@ -92,7 +91,7 @@ describe("Abilities - Flower Gift", () => { }); it("reverts to Overcast Form when the Pokémon loses Flower Gift, changes form under Harsh Sunlight/Sunny when it regains it", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP)).weather(WeatherType.HARSH_SUN); + game.override.enemyMoveset([Moves.SKILL_SWAP]).weather(WeatherType.HARSH_SUN); await game.classicMode.startBattle([Species.CHERRIM]); @@ -111,7 +110,7 @@ describe("Abilities - Flower Gift", () => { }); it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.HARSH_SUN); + game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.HARSH_SUN); await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]); diff --git a/src/test/abilities/forecast.test.ts b/src/test/abilities/forecast.test.ts index 78453c5f4d2..c1eb3600b8b 100644 --- a/src/test/abilities/forecast.test.ts +++ b/src/test/abilities/forecast.test.ts @@ -10,7 +10,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -67,7 +66,7 @@ describe("Abilities - Forecast", () => { game.override .moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.TACKLE]) .enemySpecies(Species.MAGIKARP) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH); }); @@ -229,7 +228,7 @@ describe("Abilities - Forecast", () => { }); it("reverts to Normal Form when Forecast is suppressed, changes form to match the weather when it regains it", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.RAIN); + game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.RAIN); await game.startBattle([Species.CASTFORM, Species.PIKACHU]); const castform = game.scene.getPlayerPokemon()!; @@ -260,7 +259,7 @@ describe("Abilities - Forecast", () => { }); it("does not change Castform's form until after Stealth Rock deals damage", async () => { - game.override.weather(WeatherType.RAIN).enemyMoveset(Array(4).fill(Moves.STEALTH_ROCK)); + game.override.weather(WeatherType.RAIN).enemyMoveset([Moves.STEALTH_ROCK]); await game.startBattle([Species.PIKACHU, Species.CASTFORM]); // First turn - set up stealth rock diff --git a/src/test/abilities/galvanize.test.ts b/src/test/abilities/galvanize.test.ts index 4b0ddc14d7c..f81b854180a 100644 --- a/src/test/abilities/galvanize.test.ts +++ b/src/test/abilities/galvanize.test.ts @@ -6,7 +6,6 @@ import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import { HitResult } from "#app/field/pokemon"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -36,7 +35,7 @@ describe("Abilities - Galvanize", () => { .moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES]) .enemySpecies(Species.DUSCLOPS) .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyLevel(100); }); diff --git a/src/test/abilities/gulp_missile.test.ts b/src/test/abilities/gulp_missile.test.ts index 286c3af1c56..ac0efd8e8d1 100644 --- a/src/test/abilities/gulp_missile.test.ts +++ b/src/test/abilities/gulp_missile.test.ts @@ -11,7 +11,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { Stat } from "#enums/stat"; describe("Abilities - Gulp Missile", () => { @@ -49,7 +48,7 @@ describe("Abilities - Gulp Missile", () => { .moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH]) .enemySpecies(Species.SNORLAX) .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyLevel(5); }); @@ -108,7 +107,7 @@ describe("Abilities - Gulp Missile", () => { }); it("deals 1/4 of the attacker's maximum HP when hit by a damaging attack", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle([Species.CRAMORANT]); const enemy = game.scene.getEnemyPokemon()!; @@ -121,7 +120,7 @@ describe("Abilities - Gulp Missile", () => { }); it("does not have any effect when hit by non-damaging attack", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TAIL_WHIP)); + game.override.enemyMoveset([Moves.TAIL_WHIP]); await game.startBattle([Species.CRAMORANT]); const cramorant = game.scene.getPlayerPokemon()!; @@ -140,7 +139,7 @@ describe("Abilities - Gulp Missile", () => { }); it("lowers attacker's DEF stat stage by 1 when hit in Gulping form", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle([Species.CRAMORANT]); const cramorant = game.scene.getPlayerPokemon()!; @@ -164,7 +163,7 @@ describe("Abilities - Gulp Missile", () => { }); it("paralyzes the enemy when hit in Gorging form", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle([Species.CRAMORANT]); const cramorant = game.scene.getPlayerPokemon()!; @@ -188,7 +187,7 @@ describe("Abilities - Gulp Missile", () => { }); it("does not activate the ability when underwater", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SURF)); + game.override.enemyMoveset([Moves.SURF]); await game.startBattle([Species.CRAMORANT]); const cramorant = game.scene.getPlayerPokemon()!; @@ -201,7 +200,7 @@ describe("Abilities - Gulp Missile", () => { }); it("prevents effect damage but inflicts secondary effect on attacker with Magic Guard", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)).enemyAbility(Abilities.MAGIC_GUARD); + game.override.enemyMoveset([Moves.TACKLE]).enemyAbility(Abilities.MAGIC_GUARD); await game.startBattle([Species.CRAMORANT]); const cramorant = game.scene.getPlayerPokemon()!; @@ -225,7 +224,7 @@ describe("Abilities - Gulp Missile", () => { }); it("cannot be suppressed", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)); + game.override.enemyMoveset([Moves.GASTRO_ACID]); await game.startBattle([Species.CRAMORANT]); const cramorant = game.scene.getPlayerPokemon()!; @@ -245,7 +244,7 @@ describe("Abilities - Gulp Missile", () => { }); it("cannot be swapped with another ability", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP)); + game.override.enemyMoveset([Moves.SKILL_SWAP]); await game.startBattle([Species.CRAMORANT]); const cramorant = game.scene.getPlayerPokemon()!; diff --git a/src/test/abilities/heatproof.test.ts b/src/test/abilities/heatproof.test.ts index e2a558e6d99..61c406201bd 100644 --- a/src/test/abilities/heatproof.test.ts +++ b/src/test/abilities/heatproof.test.ts @@ -5,7 +5,6 @@ import { toDmgValue } from "#app/utils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -30,7 +29,7 @@ describe("Abilities - Heatproof", () => { .disableCrits() .enemySpecies(Species.CHARMANDER) .enemyAbility(Abilities.HEATPROOF) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyLevel(100) .starterSpecies(Species.CHANDELURE) .ability(Abilities.BALL_FETCH) diff --git a/src/test/abilities/hustle.test.ts b/src/test/abilities/hustle.test.ts index ff96b98c7ac..29cbfdc1a5d 100644 --- a/src/test/abilities/hustle.test.ts +++ b/src/test/abilities/hustle.test.ts @@ -4,7 +4,6 @@ import { Stat } from "#app/enums/stat"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -29,7 +28,7 @@ describe("Abilities - Hustle", () => { .moveset([ Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE ]) .disableCrits() .battleType("single") - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemySpecies(Species.SHUCKLE) .enemyAbility(Abilities.BALL_FETCH); }); diff --git a/src/test/abilities/hyper_cutter.test.ts b/src/test/abilities/hyper_cutter.test.ts index 64e04ac2fd3..ec947add939 100644 --- a/src/test/abilities/hyper_cutter.test.ts +++ b/src/test/abilities/hyper_cutter.test.ts @@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -29,7 +28,7 @@ describe("Abilities - Hyper Cutter", () => { .ability(Abilities.BALL_FETCH) .enemySpecies(Species.SHUCKLE) .enemyAbility(Abilities.HYPER_CUTTER) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); // Reference Link: https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability) diff --git a/src/test/abilities/imposter.test.ts b/src/test/abilities/imposter.test.ts index 2857f80632a..27673564aaa 100644 --- a/src/test/abilities/imposter.test.ts +++ b/src/test/abilities/imposter.test.ts @@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; import { Abilities } from "#enums/abilities"; -import { SPLASH_ONLY } from "../utils/testUtils"; // TODO: Add more tests once Imposter is fully implemented describe("Abilities - Imposter", () => { @@ -31,9 +30,9 @@ describe("Abilities - Imposter", () => { .enemyLevel(200) .enemyAbility(Abilities.BEAST_BOOST) .enemyPassiveAbility(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .ability(Abilities.IMPOSTER) - .moveset(SPLASH_ONLY); + .moveset(Moves.SPLASH); }); it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => { @@ -77,7 +76,7 @@ describe("Abilities - Imposter", () => { }, 20000); it("should copy in-battle overridden stats", async () => { - game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT)); + game.override.enemyMoveset([Moves.POWER_SPLIT]); await game.startBattle([ Species.DITTO diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index f90ba6c0e1e..d4c097022df 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -7,7 +7,6 @@ import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; describe("Abilities - Intimidate", () => { let phaserGame: Phaser.Game; @@ -31,7 +30,7 @@ describe("Abilities - Intimidate", () => { .enemyPassiveAbility(Abilities.HYDRATION) .ability(Abilities.INTIMIDATE) .startingWave(3) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); it("should lower ATK stat stage by 1 of enemy Pokemon on entry and player switch", async () => { @@ -108,7 +107,7 @@ describe("Abilities - Intimidate", () => { it("should lower ATK stat stage by 1 for every switch", async () => { game.override.moveset([Moves.SPLASH]) - .enemyMoveset(new Array(4).fill(Moves.VOLT_SWITCH)) + .enemyMoveset([Moves.VOLT_SWITCH]) .startingWave(5); await game.classicMode.startBattle([ Species.MIGHTYENA, Species.POOCHYENA ]); diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index 7895e7de6bf..51f182d5401 100644 --- a/src/test/abilities/libero.test.ts +++ b/src/test/abilities/libero.test.ts @@ -9,7 +9,6 @@ import { Biome } from "#enums/biome"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; @@ -183,7 +182,7 @@ describe("Abilities - Libero", () => { "ability applies correctly even if the pokemon's move misses", async () => { game.override.moveset([Moves.TACKLE]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([Species.MAGIKARP]); diff --git a/src/test/abilities/magic_guard.test.ts b/src/test/abilities/magic_guard.test.ts index 64c1746c7d9..4b3fb0ba985 100644 --- a/src/test/abilities/magic_guard.test.ts +++ b/src/test/abilities/magic_guard.test.ts @@ -8,7 +8,6 @@ import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -39,7 +38,7 @@ describe("Abilities - Magic Guard", () => { /** Enemy Pokemon overrides */ game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.INSOMNIA); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyLevel(100); }); diff --git a/src/test/abilities/moody.test.ts b/src/test/abilities/moody.test.ts index 5c46ea68ec5..166f69b0fe3 100644 --- a/src/test/abilities/moody.test.ts +++ b/src/test/abilities/moody.test.ts @@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -29,8 +28,8 @@ describe("Abilities - Moody", () => { .enemySpecies(Species.RATTATA) .enemyAbility(Abilities.BALL_FETCH) .ability(Abilities.MOODY) - .enemyMoveset(SPLASH_ONLY) - .moveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH) + .moveset(Moves.SPLASH); }); it("should increase one stat stage by 2 and decrease a different stat stage by 1", diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index e713d78f39e..5f337fedabb 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -5,7 +5,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { BattlerIndex } from "#app/battle"; import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { VictoryPhase } from "#app/phases/victory-phase"; @@ -34,7 +33,7 @@ describe("Abilities - Moxie", () => { game.override.ability(Abilities.MOXIE); game.override.startingLevel(2000); game.override.moveset([ moveToUse ]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("should raise ATK stat stage by 1 when winning a battle", async() => { diff --git a/src/test/abilities/parental_bond.test.ts b/src/test/abilities/parental_bond.test.ts index 81a30524a5e..2ad3f9e3f5c 100644 --- a/src/test/abilities/parental_bond.test.ts +++ b/src/test/abilities/parental_bond.test.ts @@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -34,7 +33,7 @@ describe("Abilities - Parental Bond", () => { game.override.ability(Abilities.PARENTAL_BOND); game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.FUR_COAT); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.startingLevel(100); game.override.enemyLevel(100); }); @@ -175,7 +174,7 @@ describe("Abilities - Parental Bond", () => { "should not apply multiplier to counter moves", async () => { game.override.moveset([Moves.COUNTER]); - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.classicMode.startBattle([Species.SHUCKLE]); @@ -465,7 +464,7 @@ describe("Abilities - Parental Bond", () => { "should not cause user to hit into King's Shield more than once", async () => { game.override.moveset([Moves.TACKLE]); - game.override.enemyMoveset(Array(4).fill(Moves.KINGS_SHIELD)); + game.override.enemyMoveset([Moves.KINGS_SHIELD]); await game.classicMode.startBattle([Species.MAGIKARP]); diff --git a/src/test/abilities/pastel_veil.test.ts b/src/test/abilities/pastel_veil.test.ts index ba90c7e3b3f..31490aab143 100644 --- a/src/test/abilities/pastel_veil.test.ts +++ b/src/test/abilities/pastel_veil.test.ts @@ -8,7 +8,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Abilities - Pastel Veil", () => { let phaserGame: Phaser.Game; @@ -31,7 +30,7 @@ describe("Abilities - Pastel Veil", () => { .moveset([Moves.TOXIC_THREAD, Moves.SPLASH]) .enemyAbility(Abilities.BALL_FETCH) .enemySpecies(Species.SUNKERN) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); it("prevents the user and its allies from being afflicted by poison", async () => { diff --git a/src/test/abilities/power_spot.test.ts b/src/test/abilities/power_spot.test.ts index b83284c0bac..6d349a1a3f9 100644 --- a/src/test/abilities/power_spot.test.ts +++ b/src/test/abilities/power_spot.test.ts @@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -29,7 +28,7 @@ describe("Abilities - Power Spot", () => { game = new GameManager(phaserGame); game.override.battleType("double"); game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.BALL_FETCH); }); diff --git a/src/test/abilities/protean.test.ts b/src/test/abilities/protean.test.ts index 6ecabbfade0..4be58a677a6 100644 --- a/src/test/abilities/protean.test.ts +++ b/src/test/abilities/protean.test.ts @@ -9,7 +9,6 @@ import { Biome } from "#enums/biome"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; @@ -183,7 +182,7 @@ describe("Abilities - Protean", () => { "ability applies correctly even if the pokemon's move misses", async () => { game.override.moveset([Moves.TACKLE]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([Species.MAGIKARP]); diff --git a/src/test/abilities/quick_draw.test.ts b/src/test/abilities/quick_draw.test.ts index 00d344ed333..a02ee5cf56a 100644 --- a/src/test/abilities/quick_draw.test.ts +++ b/src/test/abilities/quick_draw.test.ts @@ -32,7 +32,7 @@ describe("Abilities - Quick Draw", () => { game.override.enemyLevel(100); game.override.enemySpecies(Species.MAGIKARP); game.override.enemyAbility(Abilities.BALL_FETCH); - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); vi.spyOn(allAbilities[Abilities.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue(100); }); @@ -76,7 +76,7 @@ describe("Abilities - Quick Draw", () => { ); test("does not increase priority", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.EXTREME_SPEED)); + game.override.enemyMoveset([Moves.EXTREME_SPEED]); await game.startBattle(); diff --git a/src/test/abilities/sand_spit.test.ts b/src/test/abilities/sand_spit.test.ts index 041e20faf7f..add13ede296 100644 --- a/src/test/abilities/sand_spit.test.ts +++ b/src/test/abilities/sand_spit.test.ts @@ -35,7 +35,7 @@ describe("Abilities - Sand Spit", () => { }); it("should trigger when hit with damaging move", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle(); game.move.select(Moves.SPLASH); @@ -45,7 +45,7 @@ describe("Abilities - Sand Spit", () => { }, 20000); it("should not trigger when targetted with status moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.GROWL)); + game.override.enemyMoveset([Moves.GROWL]); await game.startBattle(); game.move.select(Moves.COIL); diff --git a/src/test/abilities/sap_sipper.test.ts b/src/test/abilities/sap_sipper.test.ts index 2d70ede3530..5e8cac74c95 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -9,7 +9,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; // See also: TypeImmunityAbAttr describe("Abilities - Sap Sipper", () => { @@ -37,7 +36,7 @@ describe("Abilities - Sap Sipper", () => { const enemyAbility = Abilities.SAP_SIPPER; game.override.moveset([ moveToUse ]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemySpecies(Species.DUSKULL); game.override.enemyAbility(enemyAbility); @@ -59,7 +58,7 @@ describe("Abilities - Sap Sipper", () => { const enemyAbility = Abilities.SAP_SIPPER; game.override.moveset([ moveToUse ]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); @@ -80,7 +79,7 @@ describe("Abilities - Sap Sipper", () => { const enemyAbility = Abilities.SAP_SIPPER; game.override.moveset([ moveToUse ]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); @@ -100,7 +99,7 @@ describe("Abilities - Sap Sipper", () => { const enemyAbility = Abilities.SAP_SIPPER; game.override.moveset([ moveToUse ]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); @@ -123,7 +122,7 @@ describe("Abilities - Sap Sipper", () => { game.override.moveset([ moveToUse ]); game.override.ability(ability); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.NONE); diff --git a/src/test/abilities/simple.test.ts b/src/test/abilities/simple.test.ts index 4310c5d45d1..e5ca474d7c3 100644 --- a/src/test/abilities/simple.test.ts +++ b/src/test/abilities/simple.test.ts @@ -1,10 +1,10 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/utils/gameManager"; +import { Moves } from "#app/enums/moves"; import { Abilities } from "#enums/abilities"; import { Species } from "#enums/species"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Abilities - Simple", () => { let phaserGame: Phaser.Game; @@ -27,7 +27,7 @@ describe("Abilities - Simple", () => { .enemySpecies(Species.BULBASAUR) .enemyAbility(Abilities.SIMPLE) .ability(Abilities.INTIMIDATE) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); it("should double stat changes when applied", async() => { diff --git a/src/test/abilities/steely_spirit.test.ts b/src/test/abilities/steely_spirit.test.ts index 7aaa0a42ae3..7b5879555be 100644 --- a/src/test/abilities/steely_spirit.test.ts +++ b/src/test/abilities/steely_spirit.test.ts @@ -4,7 +4,6 @@ import { Abilities } from "#app/enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -31,7 +30,7 @@ describe("Abilities - Steely Spirit", () => { game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.moveset([Moves.IRON_HEAD, Moves.SPLASH]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); vi.spyOn(allMoves[moveToCheck], "calculateBattlePower"); }); diff --git a/src/test/abilities/sweet_veil.test.ts b/src/test/abilities/sweet_veil.test.ts index 5de3c7285a9..c2946443245 100644 --- a/src/test/abilities/sweet_veil.test.ts +++ b/src/test/abilities/sweet_veil.test.ts @@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -45,7 +44,7 @@ describe("Abilities - Sweet Veil", () => { }); it("causes Rest to fail when used by the user or its allies", async () => { - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]); game.move.select(Moves.SPLASH); @@ -72,7 +71,7 @@ describe("Abilities - Sweet Veil", () => { game.override.enemySpecies(Species.PIKACHU); game.override.enemyLevel(5); game.override.startingLevel(5); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]); diff --git a/src/test/abilities/tera_shell.test.ts b/src/test/abilities/tera_shell.test.ts index 6a6b7bb252b..2826469f3bf 100644 --- a/src/test/abilities/tera_shell.test.ts +++ b/src/test/abilities/tera_shell.test.ts @@ -30,7 +30,7 @@ describe("Abilities - Tera Shell", () => { .moveset([Moves.SPLASH]) .enemySpecies(Species.SNORLAX) .enemyAbility(Abilities.INSOMNIA) - .enemyMoveset(Array(4).fill(Moves.MACH_PUNCH)) + .enemyMoveset([Moves.MACH_PUNCH]) .startingLevel(100) .enemyLevel(100); }); @@ -60,7 +60,7 @@ describe("Abilities - Tera Shell", () => { it( "should not override type immunities", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)); + game.override.enemyMoveset([Moves.SHADOW_SNEAK]); await game.classicMode.startBattle([Species.SNORLAX]); @@ -77,7 +77,7 @@ describe("Abilities - Tera Shell", () => { it( "should not override type multipliers less than 0.5x", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.QUICK_ATTACK)); + game.override.enemyMoveset([Moves.QUICK_ATTACK]); await game.classicMode.startBattle([Species.AGGRON]); @@ -94,7 +94,7 @@ describe("Abilities - Tera Shell", () => { it( "should not affect the effectiveness of fixed-damage moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.DRAGON_RAGE)); + game.override.enemyMoveset([Moves.DRAGON_RAGE]); await game.classicMode.startBattle([Species.CHARIZARD]); diff --git a/src/test/abilities/wind_power.test.ts b/src/test/abilities/wind_power.test.ts index c944e01b43a..12b8d2f2299 100644 --- a/src/test/abilities/wind_power.test.ts +++ b/src/test/abilities/wind_power.test.ts @@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -28,7 +27,7 @@ describe("Abilities - Wind Power", () => { game.override.enemySpecies(Species.SHIFTRY); game.override.enemyAbility(Abilities.WIND_POWER); game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("it becomes charged when hit by wind moves", async () => { diff --git a/src/test/abilities/wind_rider.test.ts b/src/test/abilities/wind_rider.test.ts index 7a1fee6794a..c917f56e101 100644 --- a/src/test/abilities/wind_rider.test.ts +++ b/src/test/abilities/wind_rider.test.ts @@ -3,7 +3,6 @@ import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -28,7 +27,7 @@ describe("Abilities - Wind Rider", () => { .enemySpecies(Species.SHIFTRY) .enemyAbility(Abilities.WIND_RIDER) .moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); it("takes no damage from wind moves and its ATK stat stage is raised by 1 when hit by one", async () => { diff --git a/src/test/abilities/wonder_skin.test.ts b/src/test/abilities/wonder_skin.test.ts index 0c2aedc8ce8..6ef985fbd42 100644 --- a/src/test/abilities/wonder_skin.test.ts +++ b/src/test/abilities/wonder_skin.test.ts @@ -5,7 +5,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -30,7 +29,7 @@ describe("Abilities - Wonder Skin", () => { game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.WONDER_SKIN); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("lowers accuracy of status moves to 50%", async () => { diff --git a/src/test/abilities/zero_to_hero.test.ts b/src/test/abilities/zero_to_hero.test.ts index 1a9697f974e..eafc32b4c79 100644 --- a/src/test/abilities/zero_to_hero.test.ts +++ b/src/test/abilities/zero_to_hero.test.ts @@ -6,7 +6,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -30,8 +29,8 @@ describe("Abilities - ZERO TO HERO", () => { game = new GameManager(phaserGame); game.override .battleType("single") - .moveset(SPLASH_ONLY) - .enemyMoveset(SPLASH_ONLY) + .moveset(Moves.SPLASH) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH); }); diff --git a/src/test/arena/arena_gravity.test.ts b/src/test/arena/arena_gravity.test.ts index eda8c687ba1..47b8bf4cf70 100644 --- a/src/test/arena/arena_gravity.test.ts +++ b/src/test/arena/arena_gravity.test.ts @@ -8,7 +8,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Arena - Gravity", () => { let phaserGame: Phaser.Game; @@ -32,7 +31,7 @@ describe("Arena - Gravity", () => { .ability(Abilities.UNNERVE) .enemyAbility(Abilities.BALL_FETCH) .enemySpecies(Species.SHUCKLE) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); // Reference: https://bulbapedia.bulbagarden.net/wiki/Gravity_(move) diff --git a/src/test/arena/weather_fog.test.ts b/src/test/arena/weather_fog.test.ts index b36b0de2e06..b47145e8dd0 100644 --- a/src/test/arena/weather_fog.test.ts +++ b/src/test/arena/weather_fog.test.ts @@ -31,7 +31,7 @@ describe("Weather - Fog", () => { game.override.ability(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemySpecies(Species.MAGIKARP); - game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH)); + game.override.enemyMoveset([Moves.SPLASH]); }); it("move accuracy is multiplied by 90%", async () => { diff --git a/src/test/arena/weather_hail.test.ts b/src/test/arena/weather_hail.test.ts index 75125b3448c..31d20be2ded 100644 --- a/src/test/arena/weather_hail.test.ts +++ b/src/test/arena/weather_hail.test.ts @@ -4,7 +4,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { BattlerIndex } from "#app/battle"; describe("Weather - Hail", () => { @@ -26,8 +25,8 @@ describe("Weather - Hail", () => { game.override .weather(WeatherType.HAIL) .battleType("single") - .moveset(SPLASH_ONLY) - .enemyMoveset(SPLASH_ONLY) + .moveset(Moves.SPLASH) + .enemyMoveset(Moves.SPLASH) .enemySpecies(Species.MAGIKARP); }); diff --git a/src/test/arena/weather_sandstorm.test.ts b/src/test/arena/weather_sandstorm.test.ts index 978774ba4c1..91188de6985 100644 --- a/src/test/arena/weather_sandstorm.test.ts +++ b/src/test/arena/weather_sandstorm.test.ts @@ -4,7 +4,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Weather - Sandstorm", () => { let phaserGame: Phaser.Game; @@ -25,8 +24,8 @@ describe("Weather - Sandstorm", () => { game.override .weather(WeatherType.SANDSTORM) .battleType("single") - .moveset(SPLASH_ONLY) - .enemyMoveset(SPLASH_ONLY) + .moveset(Moves.SPLASH) + .enemyMoveset(Moves.SPLASH) .enemySpecies(Species.MAGIKARP); }); diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index 25dfbc765bd..6e15bbd99d9 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -25,7 +25,6 @@ import { PlayerGender } from "#enums/player-gender"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; @@ -319,7 +318,7 @@ describe("Test Battle Phase", () => { .startingWave(1) .startingLevel(100) .moveset([moveToUse]) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]); await game.startBattle(); diff --git a/src/test/battle/damage_calculation.test.ts b/src/test/battle/damage_calculation.test.ts index 9c7c9dc9d3e..89f2bb4c269 100644 --- a/src/test/battle/damage_calculation.test.ts +++ b/src/test/battle/damage_calculation.test.ts @@ -5,7 +5,6 @@ import { ArenaTagType } from "#enums/arena-tag-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -31,7 +30,7 @@ describe("Round Down and Minimun 1 test in Damage Calculation", () => { it("When the user fails to use Jump Kick with Wonder Guard ability, the damage should be 1.", async () => { game.override.enemySpecies(Species.GASTLY); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.starterSpecies(Species.SHEDINJA); game.override.moveset([Moves.JUMP_KICK]); game.override.ability(Abilities.WONDER_GUARD); diff --git a/src/test/battle/double_battle.test.ts b/src/test/battle/double_battle.test.ts index d264a29ef9b..b7a5616d642 100644 --- a/src/test/battle/double_battle.test.ts +++ b/src/test/battle/double_battle.test.ts @@ -4,7 +4,6 @@ import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -29,7 +28,7 @@ describe("Double Battles", () => { // double-battle player's pokemon both fainted in same round, then revive one, and next double battle summons two player's pokemon successfully. // (There were bugs that either only summon one when can summon two, player stuck in switchPhase etc) it("3v2 edge case: player summons 2 pokemon on the next battle after being fainted and revived", async () => { - game.override.battleType("double").enemyMoveset(SPLASH_ONLY).moveset(SPLASH_ONLY); + game.override.battleType("double").enemyMoveset(Moves.SPLASH).moveset(Moves.SPLASH); await game.startBattle([ Species.BULBASAUR, Species.CHARIZARD, diff --git a/src/test/battle/inverse_battle.test.ts b/src/test/battle/inverse_battle.test.ts index 2a561a09e5e..d808f71addb 100644 --- a/src/test/battle/inverse_battle.test.ts +++ b/src/test/battle/inverse_battle.test.ts @@ -8,7 +8,6 @@ import { Species } from "#enums/species"; import { StatusEffect } from "#enums/status-effect"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const TIMEOUT = 20 * 1000; @@ -38,7 +37,7 @@ describe("Inverse Battle", () => { .ability(Abilities.BALL_FETCH) .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); it("Immune types are 2x effective - Thunderbolt against Ground Type", async () => { diff --git a/src/test/boss-pokemon.test.ts b/src/test/boss-pokemon.test.ts index c6fc276551f..8a0a0e01617 100644 --- a/src/test/boss-pokemon.test.ts +++ b/src/test/boss-pokemon.test.ts @@ -2,7 +2,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import GameManager from "./utils/gameManager"; import { Species } from "#app/enums/species"; import { getPokemonSpecies } from "#app/data/pokemon-species"; -import { SPLASH_ONLY } from "./utils/testUtils"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { EFFECTIVE_STATS } from "#app/enums/stat"; @@ -33,7 +32,7 @@ describe("Boss Pokemon / Shields", () => { .disableTrainerWaves() .disableCrits() .enemySpecies(Species.RATTATA) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyHeldItems([]) .startingLevel(1000) .moveset([Moves.FALSE_SWIPE, Moves.SUPER_FANG, Moves.SPLASH]) diff --git a/src/test/evolution.test.ts b/src/test/evolution.test.ts index 9f0806b8e24..16922babd7c 100644 --- a/src/test/evolution.test.ts +++ b/src/test/evolution.test.ts @@ -6,7 +6,6 @@ import * as Utils from "#app/utils"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "./utils/testUtils"; describe("Evolution", () => { let phaserGame: Phaser.Game; @@ -99,7 +98,7 @@ describe("Evolution", () => { it("should increase both HP and max HP when evolving", async () => { game.override.moveset([Moves.SURF]) .enemySpecies(Species.GOLEM) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .startingWave(21) .startingLevel(16) .enemyLevel(50); @@ -126,7 +125,7 @@ describe("Evolution", () => { it("should not fully heal HP when evolving", async () => { game.override.moveset([Moves.SURF]) .enemySpecies(Species.GOLEM) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .startingWave(21) .startingLevel(13) .enemyLevel(30); diff --git a/src/test/final_boss.test.ts b/src/test/final_boss.test.ts index 5d006998a0b..fee4dc6c8f6 100644 --- a/src/test/final_boss.test.ts +++ b/src/test/final_boss.test.ts @@ -7,7 +7,6 @@ import { GameModes } from "#app/game-mode"; import { TurnHeldItemTransferModifier } from "#app/modifier/modifier"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import GameManager from "./utils/gameManager"; -import { SPLASH_ONLY } from "./utils/testUtils"; const FinalWave = { Classic: 200, @@ -29,7 +28,7 @@ describe("Final Boss", () => { .startingWave(FinalWave.Classic) .startingBiome(Biome.END) .disableCrits() - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .moveset([ Moves.SPLASH, Moves.WILL_O_WISP, Moves.DRAGON_PULSE ]) .startingLevel(10000); }); diff --git a/src/test/items/dire_hit.test.ts b/src/test/items/dire_hit.test.ts index 4b5988294f3..601552de7f1 100644 --- a/src/test/items/dire_hit.test.ts +++ b/src/test/items/dire_hit.test.ts @@ -4,7 +4,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phase from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { BattleEndPhase } from "#app/phases/battle-end-phase"; import { TempCritBoosterModifier } from "#app/modifier/modifier"; import { Mode } from "#app/ui/ui"; @@ -34,7 +33,7 @@ describe("Items - Dire Hit", () => { game.override .enemySpecies(Species.MAGIKARP) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .moveset([ Moves.POUND ]) .startingHeldItems([{ name: "DIRE_HIT" }]) .battleType("single") diff --git a/src/test/items/double_battle_chance_booster.test.ts b/src/test/items/double_battle_chance_booster.test.ts index 808d4c7ca51..f581af7afc5 100644 --- a/src/test/items/double_battle_chance_booster.test.ts +++ b/src/test/items/double_battle_chance_booster.test.ts @@ -4,7 +4,6 @@ import { DoubleBattleChanceBoosterModifier } from "#app/modifier/modifier"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { ShopCursorTarget } from "#app/enums/shop-cursor-target.js"; import { Mode } from "#app/ui/ui.js"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler.js"; @@ -64,7 +63,7 @@ describe("Items - Double Battle Chance Boosters", () => { game.override .startingModifier([{ name: "LURE" }]) .itemRewards([{ name: "LURE" }]) - .moveset(SPLASH_ONLY) + .moveset(Moves.SPLASH) .startingLevel(200); await game.classicMode.startBattle([ diff --git a/src/test/items/grip_claw.test.ts b/src/test/items/grip_claw.test.ts index 09afa9aea0b..d9871616449 100644 --- a/src/test/items/grip_claw.test.ts +++ b/src/test/items/grip_claw.test.ts @@ -8,7 +8,6 @@ import { MoveEndPhase } from "#app/phases/move-end-phase"; import GameManager from "#test/utils/gameManager"; import Phase from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; // 20 seconds @@ -38,7 +37,7 @@ describe("Items - Grip Claw", () => { ]) .enemySpecies(Species.SNORLAX) .ability(Abilities.KLUTZ) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyHeldItems([ { name: "BERRY", type: BerryType.SITRUS, count: 2 }, { name: "BERRY", type: BerryType.LUM, count: 2 }, diff --git a/src/test/items/scope_lens.test.ts b/src/test/items/scope_lens.test.ts index c8629093ab5..e39517ceae9 100644 --- a/src/test/items/scope_lens.test.ts +++ b/src/test/items/scope_lens.test.ts @@ -4,7 +4,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phase from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Items - Scope Lens", () => { let phaserGame: Phaser.Game; @@ -25,7 +24,7 @@ describe("Items - Scope Lens", () => { game.override .enemySpecies(Species.MAGIKARP) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .moveset([ Moves.POUND ]) .startingHeldItems([{ name: "SCOPE_LENS" }]) .battleType("single") diff --git a/src/test/items/temp_stat_stage_booster.test.ts b/src/test/items/temp_stat_stage_booster.test.ts index 3e32fa13a04..6186799623a 100644 --- a/src/test/items/temp_stat_stage_booster.test.ts +++ b/src/test/items/temp_stat_stage_booster.test.ts @@ -5,7 +5,6 @@ import Phase from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { Moves } from "#app/enums/moves"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { Abilities } from "#app/enums/abilities"; import { TempStatStageBoosterModifier } from "#app/modifier/modifier"; import { Mode } from "#app/ui/ui"; @@ -34,7 +33,7 @@ describe("Items - Temporary Stat Stage Boosters", () => { game.override .battleType("single") .enemySpecies(Species.SHUCKLE) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH) .moveset([ Moves.TACKLE, Moves.SPLASH, Moves.HONE_CLAWS, Moves.BELLY_DRUM ]) .startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]); diff --git a/src/test/moves/alluring_voice.test.ts b/src/test/moves/alluring_voice.test.ts index 9807d1bce85..b438d0f736a 100644 --- a/src/test/moves/alluring_voice.test.ts +++ b/src/test/moves/alluring_voice.test.ts @@ -31,7 +31,7 @@ describe("Moves - Alluring Voice", () => { .disableCrits() .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.ICE_SCALES) - .enemyMoveset(Array(4).fill(Moves.HOWL)) + .enemyMoveset([Moves.HOWL]) .startingLevel(10) .enemyLevel(10) .starterSpecies(Species.FEEBAS) diff --git a/src/test/moves/baton_pass.test.ts b/src/test/moves/baton_pass.test.ts index 1a4edafdd36..5643efceae2 100644 --- a/src/test/moves/baton_pass.test.ts +++ b/src/test/moves/baton_pass.test.ts @@ -5,7 +5,6 @@ import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { Stat } from "#enums/stat"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -31,7 +30,7 @@ describe("Moves - Baton Pass", () => { .enemyAbility(Abilities.BALL_FETCH) .moveset([Moves.BATON_PASS, Moves.NASTY_PLOT, Moves.SPLASH]) .ability(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .disableCrits(); }); @@ -71,7 +70,10 @@ describe("Moves - Baton Pass", () => { // round 2 - baton pass game.scene.getEnemyPokemon()!.hp = 100; - game.override.enemyMoveset(new Array(4).fill(Moves.BATON_PASS)); + game.override.enemyMoveset([Moves.BATON_PASS]); + // Force moveset to update mid-battle + // TODO: replace with enemy ai control function when it's added + game.scene.getEnemyParty()[0].getMoveset(); game.move.select(Moves.SPLASH); await game.phaseInterceptor.to("PostSummonPhase", false); @@ -90,7 +92,7 @@ describe("Moves - Baton Pass", () => { }, 20000); it("doesn't transfer effects that aren't transferrable", async() => { - game.override.enemyMoveset(Array(4).fill(Moves.SALT_CURE)); + game.override.enemyMoveset([Moves.SALT_CURE]); await game.classicMode.startBattle([Species.PIKACHU, Species.FEEBAS]); const [player1, player2] = game.scene.getParty(); diff --git a/src/test/moves/beak_blast.test.ts b/src/test/moves/beak_blast.test.ts index 2a93dc00a54..fe748c87826 100644 --- a/src/test/moves/beak_blast.test.ts +++ b/src/test/moves/beak_blast.test.ts @@ -34,7 +34,7 @@ describe("Moves - Beak Blast", () => { .moveset([Moves.BEAK_BLAST]) .enemySpecies(Species.SNORLAX) .enemyAbility(Abilities.INSOMNIA) - .enemyMoveset(Array(4).fill(Moves.TACKLE)) + .enemyMoveset([Moves.TACKLE]) .startingLevel(100) .enemyLevel(100); }); @@ -80,7 +80,7 @@ describe("Moves - Beak Blast", () => { it( "should not burn attackers that don't make contact", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.WATER_GUN)); + game.override.enemyMoveset([Moves.WATER_GUN]); await game.startBattle([Species.BLASTOISE]); @@ -116,7 +116,7 @@ describe("Moves - Beak Blast", () => { it( "should be blocked by Protect", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.PROTECT)); + game.override.enemyMoveset([Moves.PROTECT]); await game.startBattle([Species.BLASTOISE]); diff --git a/src/test/moves/beat_up.test.ts b/src/test/moves/beat_up.test.ts index ce1598a49b4..70b33f56583 100644 --- a/src/test/moves/beat_up.test.ts +++ b/src/test/moves/beat_up.test.ts @@ -29,7 +29,7 @@ describe("Moves - Beat Up", () => { game.override.enemySpecies(Species.SNORLAX); game.override.enemyLevel(100); - game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); + game.override.enemyMoveset([Moves.SPLASH]); game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(100); diff --git a/src/test/moves/belly_drum.test.ts b/src/test/moves/belly_drum.test.ts index 7024deb3f18..3d85c59a2a5 100644 --- a/src/test/moves/belly_drum.test.ts +++ b/src/test/moves/belly_drum.test.ts @@ -6,7 +6,6 @@ import { Stat } from "#enums/stat"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { Abilities } from "#app/enums/abilities"; const TIMEOUT = 20 * 1000; @@ -37,7 +36,7 @@ describe("Moves - BELLY DRUM", () => { .startingLevel(100) .enemyLevel(100) .moveset([Moves.BELLY_DRUM]) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH); }); diff --git a/src/test/moves/burning_jealousy.test.ts b/src/test/moves/burning_jealousy.test.ts index 2cb6a0bc52a..3f2bf453684 100644 --- a/src/test/moves/burning_jealousy.test.ts +++ b/src/test/moves/burning_jealousy.test.ts @@ -7,7 +7,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -32,7 +31,7 @@ describe("Moves - Burning Jealousy", () => { .disableCrits() .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.ICE_SCALES) - .enemyMoveset(Array(4).fill(Moves.HOWL)) + .enemyMoveset([Moves.HOWL]) .startingLevel(10) .enemyLevel(10) .starterSpecies(Species.FEEBAS) @@ -73,7 +72,7 @@ describe("Moves - Burning Jealousy", () => { game.override .enemySpecies(Species.DITTO) .enemyAbility(Abilities.IMPOSTER) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; @@ -91,7 +90,7 @@ describe("Moves - Burning Jealousy", () => { it("should be boosted by Sheer Force even if opponent didn't raise stat stages", async () => { game.override .ability(Abilities.SHEER_FORCE) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); vi.spyOn(allMoves[Moves.BURNING_JEALOUSY], "calculateBattlePower"); await game.classicMode.startBattle(); diff --git a/src/test/moves/clangorous_soul.test.ts b/src/test/moves/clangorous_soul.test.ts index 9bd3bc2379e..015b73b4dab 100644 --- a/src/test/moves/clangorous_soul.test.ts +++ b/src/test/moves/clangorous_soul.test.ts @@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { Stat } from "#enums/stat"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; const TIMEOUT = 20 * 1000; /** HP Cost of Move */ @@ -34,7 +33,7 @@ describe("Moves - Clangorous Soul", () => { game.override.startingLevel(100); game.override.enemyLevel(100); game.override.moveset([Moves.CLANGOROUS_SOUL]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move) diff --git a/src/test/moves/crafty_shield.test.ts b/src/test/moves/crafty_shield.test.ts index e73a1fd256d..7b962518944 100644 --- a/src/test/moves/crafty_shield.test.ts +++ b/src/test/moves/crafty_shield.test.ts @@ -33,7 +33,7 @@ describe("Moves - Crafty Shield", () => { game.override.moveset([Moves.CRAFTY_SHIELD, Moves.SPLASH, Moves.SWORDS_DANCE]); game.override.enemySpecies(Species.SNORLAX); - game.override.enemyMoveset(Array(4).fill(Moves.GROWL)); + game.override.enemyMoveset([Moves.GROWL]); game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(100); @@ -62,7 +62,7 @@ describe("Moves - Crafty Shield", () => { test( "should not protect the user and allies from attack moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); @@ -84,7 +84,7 @@ describe("Moves - Crafty Shield", () => { "should protect the user and allies from moves that ignore other protection", async () => { game.override.enemySpecies(Species.DUSCLOPS); - game.override.enemyMoveset(Array(4).fill(Moves.CURSE)); + game.override.enemyMoveset([Moves.CURSE]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); diff --git a/src/test/moves/disable.test.ts b/src/test/moves/disable.test.ts index 3d207035ce3..a35d294e91f 100644 --- a/src/test/moves/disable.test.ts +++ b/src/test/moves/disable.test.ts @@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Disable", () => { @@ -28,7 +27,7 @@ describe("Moves - Disable", () => { .ability(Abilities.BALL_FETCH) .enemyAbility(Abilities.BALL_FETCH) .moveset([Moves.DISABLE, Moves.SPLASH]) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .starterSpecies(Species.PIKACHU) .enemySpecies(Species.SHUCKLE); }); @@ -79,7 +78,7 @@ describe("Moves - Disable", () => { }, 20000); it("cannot disable STRUGGLE", async() => { - game.override.enemyMoveset(Array(4).fill(Moves.STRUGGLE)); + game.override.enemyMoveset([Moves.STRUGGLE]); await game.classicMode.startBattle(); const playerMon = game.scene.getPlayerPokemon()!; @@ -114,7 +113,7 @@ describe("Moves - Disable", () => { }, 20000); it("disables NATURE POWER, not the move invoked by it", async() => { - game.override.enemyMoveset(Array(4).fill(Moves.NATURE_POWER)); + game.override.enemyMoveset([Moves.NATURE_POWER]); await game.classicMode.startBattle(); const enemyMon = game.scene.getEnemyPokemon()!; diff --git a/src/test/moves/dragon_cheer.test.ts b/src/test/moves/dragon_cheer.test.ts index 747d71bd000..0fc389ccfb6 100644 --- a/src/test/moves/dragon_cheer.test.ts +++ b/src/test/moves/dragon_cheer.test.ts @@ -4,7 +4,6 @@ import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import { Abilities } from "#enums/abilities"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -28,7 +27,7 @@ describe("Moves - Dragon Cheer", () => { game.override .battleType("double") .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyLevel(20) .moveset([Moves.DRAGON_CHEER, Moves.TACKLE, Moves.SPLASH]); }); diff --git a/src/test/moves/dragon_rage.test.ts b/src/test/moves/dragon_rage.test.ts index 5da6e082ce5..cab8c3f808b 100644 --- a/src/test/moves/dragon_rage.test.ts +++ b/src/test/moves/dragon_rage.test.ts @@ -8,7 +8,6 @@ import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -42,7 +41,7 @@ describe("Moves - Dragon Rage", () => { game.override.startingLevel(100); game.override.enemySpecies(Species.SNORLAX); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyPassiveAbility(Abilities.BALL_FETCH); game.override.enemyLevel(100); diff --git a/src/test/moves/dragon_tail.test.ts b/src/test/moves/dragon_tail.test.ts index 362383e2fe3..e1af29b2db1 100644 --- a/src/test/moves/dragon_tail.test.ts +++ b/src/test/moves/dragon_tail.test.ts @@ -9,7 +9,6 @@ import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; import GameManager from "../utils/gameManager"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -32,7 +31,7 @@ describe("Moves - Dragon Tail", () => { game.override.battleType("single") .moveset([Moves.DRAGON_TAIL, Moves.SPLASH]) .enemySpecies(Species.WAILORD) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .startingLevel(5) .enemyLevel(5); @@ -82,7 +81,7 @@ describe("Moves - Dragon Tail", () => { test( "Double battles should proceed without crashing", async () => { - game.override.battleType("double").enemyMoveset(SPLASH_ONLY); + game.override.battleType("double").enemyMoveset(Moves.SPLASH); game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER]) .enemyAbility(Abilities.ROUGH_SKIN); await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]); @@ -116,7 +115,7 @@ describe("Moves - Dragon Tail", () => { test( "Flee move redirection works", async () => { - game.override.battleType("double").enemyMoveset(SPLASH_ONLY); + game.override.battleType("double").enemyMoveset(Moves.SPLASH); game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER]); game.override.enemyAbility(Abilities.ROUGH_SKIN); await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]); diff --git a/src/test/moves/fake_out.test.ts b/src/test/moves/fake_out.test.ts index ac09917daea..04d6216b952 100644 --- a/src/test/moves/fake_out.test.ts +++ b/src/test/moves/fake_out.test.ts @@ -3,7 +3,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Fake Out", () => { let phaserGame: Phaser.Game; @@ -26,7 +25,7 @@ describe("Moves - Fake Out", () => { .enemySpecies(Species.CORVIKNIGHT) .starterSpecies(Species.FEEBAS) .moveset([Moves.FAKE_OUT, Moves.SPLASH]) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .disableCrits(); }); diff --git a/src/test/moves/fillet_away.test.ts b/src/test/moves/fillet_away.test.ts index a639a86c5c1..68ace42c2ec 100644 --- a/src/test/moves/fillet_away.test.ts +++ b/src/test/moves/fillet_away.test.ts @@ -4,7 +4,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { Stat } from "#enums/stat"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; @@ -35,7 +34,7 @@ describe("Moves - FILLET AWAY", () => { game.override.startingLevel(100); game.override.enemyLevel(100); game.override.moveset([Moves.FILLET_AWAY]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move) diff --git a/src/test/moves/fissure.test.ts b/src/test/moves/fissure.test.ts index 34612d1fb18..8689ce4079e 100644 --- a/src/test/moves/fissure.test.ts +++ b/src/test/moves/fissure.test.ts @@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -38,7 +37,7 @@ describe("Moves - Fissure", () => { game.override.startingLevel(100); game.override.enemySpecies(Species.SNORLAX); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyPassiveAbility(Abilities.BALL_FETCH); game.override.enemyLevel(100); diff --git a/src/test/moves/flame_burst.test.ts b/src/test/moves/flame_burst.test.ts index 2777b8178b8..b2858af2b24 100644 --- a/src/test/moves/flame_burst.test.ts +++ b/src/test/moves/flame_burst.test.ts @@ -42,7 +42,7 @@ describe("Moves - Flame Burst", () => { game.override.startingWave(4); game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.BALL_FETCH); - game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH)); + game.override.enemyMoveset([Moves.SPLASH]); }); it("inflicts damage to the target's ally equal to 1/16 of its max HP", async () => { diff --git a/src/test/moves/flower_shield.test.ts b/src/test/moves/flower_shield.test.ts index ffe8ae995d3..f5fe8d532cc 100644 --- a/src/test/moves/flower_shield.test.ts +++ b/src/test/moves/flower_shield.test.ts @@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -31,7 +30,7 @@ describe("Moves - Flower Shield", () => { game.override.enemyAbility(Abilities.NONE); game.override.battleType("single"); game.override.moveset([Moves.FLOWER_SHIELD, Moves.SPLASH]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - single battle", async () => { diff --git a/src/test/moves/focus_punch.test.ts b/src/test/moves/focus_punch.test.ts index 249647f0294..ca80c688169 100644 --- a/src/test/moves/focus_punch.test.ts +++ b/src/test/moves/focus_punch.test.ts @@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -35,7 +34,7 @@ describe("Moves - Focus Punch", () => { .moveset([Moves.FOCUS_PUNCH]) .enemySpecies(Species.GROUDON) .enemyAbility(Abilities.INSOMNIA) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .startingLevel(100) .enemyLevel(100); }); @@ -68,7 +67,7 @@ describe("Moves - Focus Punch", () => { it( "should fail if the user is hit", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle([Species.CHARIZARD]); @@ -95,7 +94,7 @@ describe("Moves - Focus Punch", () => { it( "should be cancelled if the user falls asleep mid-turn", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SPORE)); + game.override.enemyMoveset([Moves.SPORE]); await game.startBattle([Species.CHARIZARD]); diff --git a/src/test/moves/foresight.test.ts b/src/test/moves/foresight.test.ts index b856ec0f852..d58097691fd 100644 --- a/src/test/moves/foresight.test.ts +++ b/src/test/moves/foresight.test.ts @@ -4,7 +4,6 @@ import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Foresight", () => { let phaserGame: Phaser.Game; @@ -25,7 +24,7 @@ describe("Moves - Foresight", () => { game.override .disableCrits() .enemySpecies(Species.GASTLY) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyLevel(5) .starterSpecies(Species.MAGIKARP) .moveset([Moves.FORESIGHT, Moves.QUICK_ATTACK, Moves.MACH_PUNCH]); @@ -55,7 +54,7 @@ describe("Moves - Foresight", () => { }); it("should ignore target's evasiveness boosts", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.MINIMIZE)); + game.override.enemyMoveset([Moves.MINIMIZE]); await game.startBattle(); const pokemon = game.scene.getPlayerPokemon()!; diff --git a/src/test/moves/freeze_dry.test.ts b/src/test/moves/freeze_dry.test.ts index 445a432a812..ff9e2f07162 100644 --- a/src/test/moves/freeze_dry.test.ts +++ b/src/test/moves/freeze_dry.test.ts @@ -3,7 +3,6 @@ import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -28,7 +27,7 @@ describe("Moves - Freeze-Dry", () => { .battleType("single") .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .starterSpecies(Species.FEEBAS) .ability(Abilities.BALL_FETCH) .moveset([Moves.FREEZE_DRY]); @@ -92,7 +91,7 @@ describe("Moves - Freeze-Dry", () => { // enable once Electrify is implemented (and the interaction is fixed, as above) it.todo("should deal 2x damage to water types under Electrify", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.ELECTRIFY)); + game.override.enemyMoveset([Moves.ELECTRIFY]); await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; diff --git a/src/test/moves/freezy_frost.test.ts b/src/test/moves/freezy_frost.test.ts index ae42d5b6dc6..05c61aab49a 100644 --- a/src/test/moves/freezy_frost.test.ts +++ b/src/test/moves/freezy_frost.test.ts @@ -5,7 +5,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import { allMoves } from "#app/data/move"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; @@ -28,7 +27,7 @@ describe("Moves - Freezy Frost", () => { game.override.enemySpecies(Species.RATTATA); game.override.enemyLevel(100); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.NONE); game.override.startingLevel(100); diff --git a/src/test/moves/gastro_acid.test.ts b/src/test/moves/gastro_acid.test.ts index 67fd3464cf9..cfc458a908f 100644 --- a/src/test/moves/gastro_acid.test.ts +++ b/src/test/moves/gastro_acid.test.ts @@ -4,7 +4,6 @@ import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import { MoveResult } from "#app/field/pokemon"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; const TIMEOUT = 20 * 1000; @@ -31,7 +30,7 @@ describe("Moves - Gastro Acid", () => { game.override.ability(Abilities.NONE); game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]); game.override.enemySpecies(Species.BIDOOF); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.WATER_ABSORB); }); diff --git a/src/test/moves/gigaton_hammer.test.ts b/src/test/moves/gigaton_hammer.test.ts index 0162375cdb2..b0ab06fdeb5 100644 --- a/src/test/moves/gigaton_hammer.test.ts +++ b/src/test/moves/gigaton_hammer.test.ts @@ -4,7 +4,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Gigaton Hammer", () => { let phaserGame: Phaser.Game; @@ -29,7 +28,7 @@ describe("Moves - Gigaton Hammer", () => { .moveset([Moves.GIGATON_HAMMER]) .startingLevel(10) .enemyLevel(100) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .disableCrits(); }); diff --git a/src/test/moves/glaive_rush.test.ts b/src/test/moves/glaive_rush.test.ts index 5867ef751b8..9eed6868432 100644 --- a/src/test/moves/glaive_rush.test.ts +++ b/src/test/moves/glaive_rush.test.ts @@ -29,7 +29,7 @@ describe("Moves - Glaive Rush", () => { .disableCrits() .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH)) + .enemyMoveset([Moves.GLAIVE_RUSH]) .starterSpecies(Species.KLINK) .ability(Abilities.BALL_FETCH) .moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]); @@ -67,7 +67,7 @@ describe("Moves - Glaive Rush", () => { it("interacts properly with multi-lens", async () => { game.override .startingHeldItems([{ name: "MULTI_LENS", count: 2 }]) - .enemyMoveset(Array(4).fill(Moves.AVALANCHE)); + .enemyMoveset([Moves.AVALANCHE]); await game.classicMode.startBattle(); const player = game.scene.getPlayerPokemon()!; @@ -88,7 +88,7 @@ describe("Moves - Glaive Rush", () => { }, TIMEOUT); it("secondary effects only last until next move", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)); + game.override.enemyMoveset([Moves.SHADOW_SNEAK]); await game.classicMode.startBattle(); const player = game.scene.getPlayerPokemon()!; @@ -115,7 +115,7 @@ describe("Moves - Glaive Rush", () => { it("secondary effects are removed upon switching", async () => { game.override - .enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)) + .enemyMoveset([Moves.SHADOW_SNEAK]) .starterSpecies(0); await game.classicMode.startBattle([Species.KLINK, Species.FEEBAS]); @@ -152,7 +152,7 @@ describe("Moves - Glaive Rush", () => { game.move.select(Moves.SHADOW_SNEAK); await game.phaseInterceptor.to("TurnEndPhase"); - game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); + game.override.enemyMoveset([Moves.SPLASH]); const damagedHP1 = 1000 - enemy.hp; enemy.hp = 1000; diff --git a/src/test/moves/growth.test.ts b/src/test/moves/growth.test.ts index defe5e26f41..a66e4ec6719 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -5,7 +5,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; @@ -29,7 +28,7 @@ describe("Moves - Growth", () => { game.override.enemyAbility(Abilities.MOXIE); game.override.ability(Abilities.INSOMNIA); game.override.moveset([ Moves.GROWTH ]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("should raise SPATK stat stage by 1", async() => { diff --git a/src/test/moves/guard_split.test.ts b/src/test/moves/guard_split.test.ts index f95d09f726c..36be82ba5e4 100644 --- a/src/test/moves/guard_split.test.ts +++ b/src/test/moves/guard_split.test.ts @@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; import { Abilities } from "#enums/abilities"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Guard Split", () => { let phaserGame: Phaser.Game; @@ -34,7 +33,7 @@ describe("Moves - Guard Split", () => { }); it("should average the user's DEF and SPDEF stats with those of the target", async () => { - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([ Species.INDEEDEE ]); @@ -56,7 +55,7 @@ describe("Moves - Guard Split", () => { }, 20000); it("should be idempotent", async () => { - game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT)); + game.override.enemyMoveset([Moves.GUARD_SPLIT]); await game.startBattle([ Species.INDEEDEE ]); diff --git a/src/test/moves/guard_swap.test.ts b/src/test/moves/guard_swap.test.ts index 407d475de09..a27afaaa7ba 100644 --- a/src/test/moves/guard_swap.test.ts +++ b/src/test/moves/guard_swap.test.ts @@ -27,7 +27,7 @@ describe("Moves - Guard Swap", () => { game.override .battleType("single") .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH)) + .enemyMoveset([Moves.SHELL_SMASH]) .enemySpecies(Species.MEW) .enemyLevel(200) .moveset([ Moves.GUARD_SWAP ]) diff --git a/src/test/moves/hard_press.test.ts b/src/test/moves/hard_press.test.ts index 70c78490269..5d2e4e5b145 100644 --- a/src/test/moves/hard_press.test.ts +++ b/src/test/moves/hard_press.test.ts @@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -30,7 +29,7 @@ describe("Moves - Hard Press", () => { game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.MUNCHLAX); game.override.enemyAbility(Abilities.BALL_FETCH); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.moveset([Moves.HARD_PRESS]); vi.spyOn(moveToCheck, "calculateBattlePower"); }); diff --git a/src/test/moves/haze.test.ts b/src/test/moves/haze.test.ts index 42081ce74e8..211c1a41409 100644 --- a/src/test/moves/haze.test.ts +++ b/src/test/moves/haze.test.ts @@ -5,7 +5,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Haze", () => { @@ -28,7 +27,7 @@ describe("Moves - Haze", () => { game.override.enemySpecies(Species.RATTATA); game.override.enemyLevel(100); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.NONE); game.override.startingLevel(100); diff --git a/src/test/moves/hyper_beam.test.ts b/src/test/moves/hyper_beam.test.ts index 1280d8b429a..7aa2dbfec2b 100644 --- a/src/test/moves/hyper_beam.test.ts +++ b/src/test/moves/hyper_beam.test.ts @@ -32,7 +32,7 @@ describe("Moves - Hyper Beam", () => { game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.BALL_FETCH); - game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); + game.override.enemyMoveset([Moves.SPLASH]); game.override.enemyLevel(100); game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]); diff --git a/src/test/moves/jaw_lock.test.ts b/src/test/moves/jaw_lock.test.ts index 42f7a244977..75fd6f0ff32 100644 --- a/src/test/moves/jaw_lock.test.ts +++ b/src/test/moves/jaw_lock.test.ts @@ -6,7 +6,6 @@ import { FaintPhase } from "#app/phases/faint-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import GameManager from "#app/test/utils/gameManager"; -import { SPLASH_ONLY } from "#app/test/utils/testUtils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; @@ -35,7 +34,7 @@ describe("Moves - Jaw Lock", () => { .battleType("single") .enemySpecies(Species.SNORLAX) .enemyAbility(Abilities.INSOMNIA) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .moveset([Moves.JAW_LOCK, Moves.SPLASH]) .startingLevel(100) .enemyLevel(100) @@ -153,7 +152,7 @@ describe("Moves - Jaw Lock", () => { it( "should not trap either pokemon if the target is protected", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.PROTECT)); + game.override.enemyMoveset([Moves.PROTECT]); await game.startBattle([Species.BULBASAUR]); diff --git a/src/test/moves/lash_out.test.ts b/src/test/moves/lash_out.test.ts index 74d9fcd66c0..8c414832f36 100644 --- a/src/test/moves/lash_out.test.ts +++ b/src/test/moves/lash_out.test.ts @@ -30,7 +30,7 @@ describe("Moves - Lash Out", () => { .disableCrits() .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.FUR_COAT) - .enemyMoveset(Array(4).fill(Moves.GROWL)) + .enemyMoveset([Moves.GROWL]) .startingLevel(10) .enemyLevel(10) .starterSpecies(Species.FEEBAS) diff --git a/src/test/moves/lucky_chant.test.ts b/src/test/moves/lucky_chant.test.ts index 7d5bfe02476..57e5ff80f1d 100644 --- a/src/test/moves/lucky_chant.test.ts +++ b/src/test/moves/lucky_chant.test.ts @@ -31,7 +31,7 @@ describe("Moves - Lucky Chant", () => { .moveset([Moves.LUCKY_CHANT, Moves.SPLASH, Moves.FOLLOW_ME]) .enemySpecies(Species.SNORLAX) .enemyAbility(Abilities.INSOMNIA) - .enemyMoveset(Array(4).fill(Moves.FLOWER_TRICK)) + .enemyMoveset([Moves.FLOWER_TRICK]) .startingLevel(100) .enemyLevel(100); }); @@ -87,7 +87,7 @@ describe("Moves - Lucky Chant", () => { it( "should prevent critical hits from field effects", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle([Species.CHARIZARD]); diff --git a/src/test/moves/lunar_blessing.test.ts b/src/test/moves/lunar_blessing.test.ts index 92428c39029..6a104762f4d 100644 --- a/src/test/moves/lunar_blessing.test.ts +++ b/src/test/moves/lunar_blessing.test.ts @@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -26,7 +25,7 @@ describe("Moves - Lunar Blessing", () => { game.override.battleType("double"); game.override.enemySpecies(Species.SHUCKLE); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.moveset([Moves.LUNAR_BLESSING, Moves.SPLASH]); diff --git a/src/test/moves/make_it_rain.test.ts b/src/test/moves/make_it_rain.test.ts index e41472d7561..5ac35168f92 100644 --- a/src/test/moves/make_it_rain.test.ts +++ b/src/test/moves/make_it_rain.test.ts @@ -5,7 +5,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import { MoveEndPhase } from "#app/phases/move-end-phase"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; @@ -31,7 +30,7 @@ describe("Moves - Make It Rain", () => { game.override.moveset([Moves.MAKE_IT_RAIN, Moves.SPLASH]); game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.INSOMNIA); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.startingLevel(100); game.override.enemyLevel(100); }); diff --git a/src/test/moves/mat_block.test.ts b/src/test/moves/mat_block.test.ts index 4a95985eb92..b759f49bf98 100644 --- a/src/test/moves/mat_block.test.ts +++ b/src/test/moves/mat_block.test.ts @@ -33,7 +33,7 @@ describe("Moves - Mat Block", () => { game.override.moveset([Moves.MAT_BLOCK, Moves.SPLASH]); game.override.enemySpecies(Species.SNORLAX); - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(100); @@ -62,7 +62,7 @@ describe("Moves - Mat Block", () => { test( "should not protect the user and allies from status moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.GROWL)); + game.override.enemyMoveset([Moves.GROWL]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); diff --git a/src/test/moves/miracle_eye.test.ts b/src/test/moves/miracle_eye.test.ts index d6b21a5dc2f..0528b509c82 100644 --- a/src/test/moves/miracle_eye.test.ts +++ b/src/test/moves/miracle_eye.test.ts @@ -5,7 +5,6 @@ import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Miracle Eye", () => { let phaserGame: Phaser.Game; @@ -26,7 +25,7 @@ describe("Moves - Miracle Eye", () => { game.override .disableCrits() .enemySpecies(Species.UMBREON) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyLevel(5) .starterSpecies(Species.MAGIKARP) .moveset([Moves.MIRACLE_EYE, Moves.CONFUSION]); diff --git a/src/test/moves/multi_target.test.ts b/src/test/moves/multi_target.test.ts index 16ccd5519b1..5e830f23fc7 100644 --- a/src/test/moves/multi_target.test.ts +++ b/src/test/moves/multi_target.test.ts @@ -4,7 +4,6 @@ import { Species } from "#app/enums/species"; import * as Utils from "#app/utils"; import { Moves } from "#enums/moves"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -32,7 +31,7 @@ describe("Multi-target damage reduction", () => { .enemyLevel(100) .startingLevel(100) .enemySpecies(Species.POLIWAG) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH) .moveset([Moves.TACKLE, Moves.DAZZLING_GLEAM, Moves.EARTHQUAKE, Moves.SPLASH]) .ability(Abilities.BALL_FETCH); diff --git a/src/test/moves/octolock.test.ts b/src/test/moves/octolock.test.ts index c86906ea240..7618b08e9fc 100644 --- a/src/test/moves/octolock.test.ts +++ b/src/test/moves/octolock.test.ts @@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -30,7 +29,7 @@ describe("Moves - Octolock", () => { game.override.battleType("single") .enemySpecies(Species.RATTATA) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH) .startingLevel(2000) .moveset([ Moves.OCTOLOCK, Moves.SPLASH ]) diff --git a/src/test/moves/parting_shot.test.ts b/src/test/moves/parting_shot.test.ts index d9535ca6482..52cfaf98111 100644 --- a/src/test/moves/parting_shot.test.ts +++ b/src/test/moves/parting_shot.test.ts @@ -9,7 +9,6 @@ import { BerryPhase } from "#app/phases/berry-phase"; import { FaintPhase } from "#app/phases/faint-phase"; import { MessagePhase } from "#app/phases/message-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -31,7 +30,7 @@ describe("Moves - Parting Shot", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.moveset([Moves.PARTING_SHOT, Moves.SPLASH]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.startingLevel(5); game.override.enemyLevel(5); @@ -125,7 +124,7 @@ describe("Moves - Parting Shot", () => { game.override .enemySpecies(Species.ALTARIA) .enemyAbility(Abilities.NONE) - .enemyMoveset(Array(4).fill(Moves.MIST)); + .enemyMoveset([Moves.MIST]); await game.startBattle([Species.SNORLAX, Species.MEOWTH]); const enemyPokemon = game.scene.getEnemyPokemon()!; diff --git a/src/test/moves/power_split.test.ts b/src/test/moves/power_split.test.ts index a532a90a54d..aaf34541567 100644 --- a/src/test/moves/power_split.test.ts +++ b/src/test/moves/power_split.test.ts @@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; import { Abilities } from "#enums/abilities"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Power Split", () => { let phaserGame: Phaser.Game; @@ -34,7 +33,7 @@ describe("Moves - Power Split", () => { }); it("should average the user's ATK and SPATK stats with those of the target", async () => { - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([ Species.INDEEDEE ]); @@ -56,7 +55,7 @@ describe("Moves - Power Split", () => { }, 20000); it("should be idempotent", async () => { - game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT)); + game.override.enemyMoveset([Moves.POWER_SPLIT]); await game.startBattle([ Species.INDEEDEE ]); diff --git a/src/test/moves/power_swap.test.ts b/src/test/moves/power_swap.test.ts index f1efeaa3af3..a3d4bfca19a 100644 --- a/src/test/moves/power_swap.test.ts +++ b/src/test/moves/power_swap.test.ts @@ -27,7 +27,7 @@ describe("Moves - Power Swap", () => { game.override .battleType("single") .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH)) + .enemyMoveset([Moves.SHELL_SMASH]) .enemySpecies(Species.MEW) .enemyLevel(200) .moveset([ Moves.POWER_SWAP ]) diff --git a/src/test/moves/protect.test.ts b/src/test/moves/protect.test.ts index 83cd088aa47..24bbcbb9d34 100644 --- a/src/test/moves/protect.test.ts +++ b/src/test/moves/protect.test.ts @@ -35,7 +35,7 @@ describe("Moves - Protect", () => { game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.INSOMNIA); - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); game.override.startingLevel(100); game.override.enemyLevel(100); @@ -59,7 +59,7 @@ describe("Moves - Protect", () => { test( "should prevent secondary effects from the opponent's attack", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.CEASELESS_EDGE)); + game.override.enemyMoveset([Moves.CEASELESS_EDGE]); vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100); await game.classicMode.startBattle([Species.CHARIZARD]); @@ -78,7 +78,7 @@ describe("Moves - Protect", () => { test( "should protect the user from status moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.CHARM)); + game.override.enemyMoveset([Moves.CHARM]); await game.classicMode.startBattle([Species.CHARIZARD]); @@ -95,7 +95,7 @@ describe("Moves - Protect", () => { test( "should stop subsequent hits of a multi-hit move", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACHYON_CUTTER)); + game.override.enemyMoveset([Moves.TACHYON_CUTTER]); await game.classicMode.startBattle([Species.CHARIZARD]); @@ -114,7 +114,7 @@ describe("Moves - Protect", () => { test( "should fail if the user is the last to move in the turn", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.PROTECT)); + game.override.enemyMoveset([Moves.PROTECT]); await game.classicMode.startBattle([Species.CHARIZARD]); diff --git a/src/test/moves/quick_guard.test.ts b/src/test/moves/quick_guard.test.ts index 5f4af40eb71..9ab0fe1509c 100644 --- a/src/test/moves/quick_guard.test.ts +++ b/src/test/moves/quick_guard.test.ts @@ -32,7 +32,7 @@ describe("Moves - Quick Guard", () => { game.override.moveset([Moves.QUICK_GUARD, Moves.SPLASH, Moves.FOLLOW_ME]); game.override.enemySpecies(Species.SNORLAX); - game.override.enemyMoveset(Array(4).fill(Moves.QUICK_ATTACK)); + game.override.enemyMoveset([Moves.QUICK_ATTACK]); game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(100); @@ -59,7 +59,7 @@ describe("Moves - Quick Guard", () => { "should protect the user and allies from Prankster-boosted moves", async () => { game.override.enemyAbility(Abilities.PRANKSTER); - game.override.enemyMoveset(Array(4).fill(Moves.GROWL)); + game.override.enemyMoveset([Moves.GROWL]); await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]); @@ -77,7 +77,7 @@ describe("Moves - Quick Guard", () => { test( "should stop subsequent hits of a multi-hit priority move", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.WATER_SHURIKEN)); + game.override.enemyMoveset([Moves.WATER_SHURIKEN]); await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]); @@ -98,7 +98,7 @@ describe("Moves - Quick Guard", () => { "should fail if the user is the last to move in the turn", async () => { game.override.battleType("single"); - game.override.enemyMoveset(Array(4).fill(Moves.QUICK_GUARD)); + game.override.enemyMoveset([Moves.QUICK_GUARD]); await game.classicMode.startBattle([Species.CHARIZARD]); diff --git a/src/test/moves/rollout.test.ts b/src/test/moves/rollout.test.ts index ddb0b22e642..c08535a61df 100644 --- a/src/test/moves/rollout.test.ts +++ b/src/test/moves/rollout.test.ts @@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -32,7 +31,7 @@ describe("Moves - Rollout", () => { game.override.enemyAbility(Abilities.BALL_FETCH); game.override.startingLevel(100); game.override.enemyLevel(100); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("should double it's dmg on sequential uses but reset after 5", async () => { diff --git a/src/test/moves/safeguard.test.ts b/src/test/moves/safeguard.test.ts index 8068c475539..2caf698a73a 100644 --- a/src/test/moves/safeguard.test.ts +++ b/src/test/moves/safeguard.test.ts @@ -29,7 +29,7 @@ describe("Moves - Safeguard", () => { game.override .battleType("single") .enemySpecies(Species.DRATINI) - .enemyMoveset(Array(4).fill(Moves.SAFEGUARD)) + .enemyMoveset([Moves.SAFEGUARD]) .enemyAbility(Abilities.BALL_FETCH) .enemyLevel(5) .starterSpecies(Species.DRATINI) @@ -126,8 +126,12 @@ describe("Moves - Safeguard", () => { expect(enemyPokemon.status?.effect).toEqual(StatusEffect.BURN); - game.override.enemyMoveset(Array(4).fill(Moves.REST)); + game.override.enemyMoveset([Moves.REST]); + // Force the moveset to update mid-battle + // TODO: Remove after enemy AI rework is in + enemyPokemon.getMoveset(); game.move.select(Moves.SPLASH); + enemyPokemon.damageAndUpdate(1); await game.toNextTurn(); expect(enemyPokemon.status?.effect).toEqual(StatusEffect.SLEEP); @@ -142,7 +146,7 @@ describe("Moves - Safeguard", () => { game.move.select(Moves.SPLASH); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toNextTurn(); - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); game.move.select(Moves.SPLASH); await game.toNextTurn(); diff --git a/src/test/moves/shell_trap.test.ts b/src/test/moves/shell_trap.test.ts index 4549a8b2b73..213b9c3fd0a 100644 --- a/src/test/moves/shell_trap.test.ts +++ b/src/test/moves/shell_trap.test.ts @@ -9,7 +9,6 @@ import { MovePhase } from "#app/phases/move-phase"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -33,7 +32,7 @@ describe("Moves - Shell Trap", () => { .battleType("double") .moveset([Moves.SHELL_TRAP, Moves.SPLASH, Moves.BULLDOZE]) .enemySpecies(Species.SNORLAX) - .enemyMoveset(Array(4).fill(Moves.RAZOR_LEAF)) + .enemyMoveset([Moves.RAZOR_LEAF]) .startingLevel(100) .enemyLevel(100); @@ -67,7 +66,7 @@ describe("Moves - Shell Trap", () => { it( "should fail if the user is only hit by special attacks", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SWIFT)); + game.override.enemyMoveset([Moves.SWIFT]); await game.startBattle([Species.CHARIZARD, Species.TURTONATOR]); @@ -93,7 +92,7 @@ describe("Moves - Shell Trap", () => { it( "should fail if the user isn't hit with any attack", async () => { - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([Species.CHARIZARD, Species.TURTONATOR]); @@ -119,7 +118,7 @@ describe("Moves - Shell Trap", () => { it( "should not activate from an ally's attack", async () => { - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]); diff --git a/src/test/moves/speed_swap.test.ts b/src/test/moves/speed_swap.test.ts index 131d506792b..179f1212394 100644 --- a/src/test/moves/speed_swap.test.ts +++ b/src/test/moves/speed_swap.test.ts @@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; import { Abilities } from "#enums/abilities"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Speed Swap", () => { let phaserGame: Phaser.Game; @@ -27,7 +26,7 @@ describe("Moves - Speed Swap", () => { game.override .battleType("single") .enemyAbility(Abilities.NONE) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemySpecies(Species.MEW) .enemyLevel(200) .moveset([ Moves.SPEED_SWAP ]) diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index fa2e7521152..aa59912d802 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -4,7 +4,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Spikes", () => { @@ -28,7 +27,7 @@ describe("Moves - Spikes", () => { .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.BALL_FETCH) .ability(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .moveset([Moves.SPIKES, Moves.SPLASH, Moves.ROAR]); }); diff --git a/src/test/moves/spit_up.test.ts b/src/test/moves/spit_up.test.ts index f88791efb74..acf7f01d991 100644 --- a/src/test/moves/spit_up.test.ts +++ b/src/test/moves/spit_up.test.ts @@ -9,7 +9,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import { MovePhase } from "#app/phases/move-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; @@ -33,7 +32,7 @@ describe("Moves - Spit Up", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.NONE); game.override.enemyLevel(2000); diff --git a/src/test/moves/stockpile.test.ts b/src/test/moves/stockpile.test.ts index d57768d0ffd..8e7a44d053b 100644 --- a/src/test/moves/stockpile.test.ts +++ b/src/test/moves/stockpile.test.ts @@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -30,7 +29,7 @@ describe("Moves - Stockpile", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.NONE); game.override.startingLevel(2000); diff --git a/src/test/moves/swallow.test.ts b/src/test/moves/swallow.test.ts index 9cea7ae8dc9..5a0e63e6e78 100644 --- a/src/test/moves/swallow.test.ts +++ b/src/test/moves/swallow.test.ts @@ -8,7 +8,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -30,7 +29,7 @@ describe("Moves - Swallow", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.enemyAbility(Abilities.NONE); game.override.enemyLevel(2000); diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index 04730a04f7a..5c83feb8a4e 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -5,7 +5,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; @@ -33,7 +32,7 @@ describe("Moves - Tail whip", () => { game.override.ability(Abilities.INSOMNIA); game.override.startingLevel(2000); game.override.moveset([ moveToUse ]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("should lower DEF stat stage by 1", async() => { diff --git a/src/test/moves/tailwind.test.ts b/src/test/moves/tailwind.test.ts index d158a9cce86..6a08cfe802f 100644 --- a/src/test/moves/tailwind.test.ts +++ b/src/test/moves/tailwind.test.ts @@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -27,7 +26,7 @@ describe("Moves - Tailwind", () => { game = new GameManager(phaserGame); game.override.battleType("double"); game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); }); it("doubles the Speed stat of the Pokemons on its side", async () => { diff --git a/src/test/moves/tera_blast.test.ts b/src/test/moves/tera_blast.test.ts index fa7a99adc14..55d61496297 100644 --- a/src/test/moves/tera_blast.test.ts +++ b/src/test/moves/tera_blast.test.ts @@ -9,7 +9,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - Tera Blast", () => { let phaserGame: Phaser.Game; @@ -37,7 +36,7 @@ describe("Moves - Tera Blast", () => { .ability(Abilities.BALL_FETCH) .startingHeldItems([{ name: "TERA_SHARD", type: Type.FIRE }]) .enemySpecies(Species.MAGIKARP) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH) .enemyLevel(20); diff --git a/src/test/moves/thunder_wave.test.ts b/src/test/moves/thunder_wave.test.ts index 0c91be29714..7ad59518013 100644 --- a/src/test/moves/thunder_wave.test.ts +++ b/src/test/moves/thunder_wave.test.ts @@ -6,7 +6,6 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -30,7 +29,7 @@ describe("Moves - Thunder Wave", () => { .battleType("single") .starterSpecies(Species.PIKACHU) .moveset([Moves.THUNDER_WAVE]) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); }); // References: https://bulbapedia.bulbagarden.net/wiki/Thunder_Wave_(move) diff --git a/src/test/moves/tidy_up.test.ts b/src/test/moves/tidy_up.test.ts index 5204b06106b..255fe948447 100644 --- a/src/test/moves/tidy_up.test.ts +++ b/src/test/moves/tidy_up.test.ts @@ -6,7 +6,6 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -30,7 +29,7 @@ describe("Moves - Tidy Up", () => { game.override.battleType("single"); game.override.enemySpecies(Species.MAGIKARP); game.override.enemyAbility(Abilities.BALL_FETCH); - game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyMoveset(Moves.SPLASH); game.override.starterSpecies(Species.FEEBAS); game.override.ability(Abilities.BALL_FETCH); game.override.moveset([Moves.TIDY_UP]); diff --git a/src/test/moves/transform.test.ts b/src/test/moves/transform.test.ts index 45769447e4d..6686f1fc73b 100644 --- a/src/test/moves/transform.test.ts +++ b/src/test/moves/transform.test.ts @@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; import { Abilities } from "#enums/abilities"; -import { SPLASH_ONLY } from "../utils/testUtils"; // TODO: Add more tests once Transform is fully implemented describe("Moves - Transform", () => { @@ -31,7 +30,7 @@ describe("Moves - Transform", () => { .enemyLevel(200) .enemyAbility(Abilities.BEAST_BOOST) .enemyPassiveAbility(Abilities.BALL_FETCH) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .ability(Abilities.INTIMIDATE) .moveset([ Moves.TRANSFORM ]); }); @@ -77,7 +76,7 @@ describe("Moves - Transform", () => { }, 20000); it("should copy in-battle overridden stats", async () => { - game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT)); + game.override.enemyMoveset([Moves.POWER_SPLIT]); await game.startBattle([ Species.DITTO diff --git a/src/test/moves/u_turn.test.ts b/src/test/moves/u_turn.test.ts index ae55302bb42..c4b6ae2497f 100644 --- a/src/test/moves/u_turn.test.ts +++ b/src/test/moves/u_turn.test.ts @@ -7,7 +7,6 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("Moves - U-turn", () => { let phaserGame: Phaser.Game; @@ -31,7 +30,7 @@ describe("Moves - U-turn", () => { .startingLevel(90) .startingWave(97) .moveset([Moves.U_TURN]) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .disableCrits(); }); diff --git a/src/test/moves/wide_guard.test.ts b/src/test/moves/wide_guard.test.ts index 6feeff815b5..b4e6e305539 100644 --- a/src/test/moves/wide_guard.test.ts +++ b/src/test/moves/wide_guard.test.ts @@ -32,7 +32,7 @@ describe("Moves - Wide Guard", () => { game.override.moveset([Moves.WIDE_GUARD, Moves.SPLASH, Moves.SURF]); game.override.enemySpecies(Species.SNORLAX); - game.override.enemyMoveset(Array(4).fill(Moves.SWIFT)); + game.override.enemyMoveset([Moves.SWIFT]); game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(100); @@ -61,7 +61,7 @@ describe("Moves - Wide Guard", () => { test( "should protect the user and allies from multi-target status moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.GROWL)); + game.override.enemyMoveset([Moves.GROWL]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); @@ -82,7 +82,7 @@ describe("Moves - Wide Guard", () => { test( "should not protect the user and allies from single-target moves", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); + game.override.enemyMoveset([Moves.TACKLE]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); @@ -103,7 +103,7 @@ describe("Moves - Wide Guard", () => { test( "should protect the user from its ally's multi-target move", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); + game.override.enemyMoveset([Moves.SPLASH]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); diff --git a/src/test/reload.test.ts b/src/test/reload.test.ts index 0a712fcc7df..a96a525ca2d 100644 --- a/src/test/reload.test.ts +++ b/src/test/reload.test.ts @@ -2,7 +2,6 @@ import { Species } from "#app/enums/species"; import { GameModes } from "#app/game-mode"; import GameManager from "#test/utils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "./utils/testUtils"; import { Moves } from "#app/enums/moves"; import { Biome } from "#app/enums/biome"; @@ -45,7 +44,7 @@ describe("Reload", () => { .enemyLevel(1000) .disableTrainerWaves() .moveset([Moves.KOWTOW_CLEAVE]) - .enemyMoveset(SPLASH_ONLY); + .enemyMoveset(Moves.SPLASH); await game.dailyMode.startBattle(); // Transition from Daily Run Wave 10 to Wave 11 in order to trigger biome switch diff --git a/src/test/ui/type-hints.test.ts b/src/test/ui/type-hints.test.ts index ccab02b82bf..726094b258a 100644 --- a/src/test/ui/type-hints.test.ts +++ b/src/test/ui/type-hints.test.ts @@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import MockText from "../utils/mocks/mocksContainer/mockText"; -import { SPLASH_ONLY } from "../utils/testUtils"; describe("UI - Type Hints", () => { let phaserGame: Phaser.Game; @@ -27,7 +26,7 @@ describe("UI - Type Hints", () => { beforeEach(async () => { game = new GameManager(phaserGame); game.settings.typeHints(true); //activate type hints - game.override.battleType("single").startingLevel(100).startingWave(1).enemyMoveset(SPLASH_ONLY); + game.override.battleType("single").startingLevel(100).startingWave(1).enemyMoveset(Moves.SPLASH); }); it("check immunity color", async () => { @@ -36,7 +35,7 @@ describe("UI - Type Hints", () => { .startingLevel(100) .startingWave(1) .enemySpecies(Species.FLORGES) - .enemyMoveset(SPLASH_ONLY) + .enemyMoveset(Moves.SPLASH) .moveset([Moves.DRAGON_CLAW]); game.settings.typeHints(true); //activate type hints diff --git a/src/test/utils/helpers/overridesHelper.ts b/src/test/utils/helpers/overridesHelper.ts index 3eeeecbc5f8..a17b841b682 100644 --- a/src/test/utils/helpers/overridesHelper.ts +++ b/src/test/utils/helpers/overridesHelper.ts @@ -133,8 +133,11 @@ export class OverridesHelper extends GameManagerHelper { * @param moveset the {@linkcode Moves | moves}set to set * @returns this */ - moveset(moveset: Moves[]): this { + moveset(moveset: Moves | Moves[]): this { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(moveset); + if (!Array.isArray(moveset)) { + moveset = [moveset]; + } const movesetStr = moveset.map((moveId) => Moves[moveId]).join(", "); this.log(`Player Pokemon moveset set to ${movesetStr} (=[${moveset.join(", ")}])!`); return this; @@ -252,8 +255,11 @@ export class OverridesHelper extends GameManagerHelper { * @param moveset the {@linkcode Moves | moves}set to set * @returns this */ - enemyMoveset(moveset: Moves[]): this { + enemyMoveset(moveset: Moves | Moves[]): this { vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(moveset); + if (!Array.isArray(moveset)) { + moveset = [moveset]; + } const movesetStr = moveset.map((moveId) => Moves[moveId]).join(", "); this.log(`Enemy Pokemon moveset set to ${movesetStr} (=[${moveset.join(", ")}])!`); return this; diff --git a/src/test/utils/testUtils.ts b/src/test/utils/testUtils.ts index 2265cf8d79c..b922fc9c61c 100644 --- a/src/test/utils/testUtils.ts +++ b/src/test/utils/testUtils.ts @@ -1,10 +1,6 @@ -import { Moves } from "#app/enums/moves"; import i18next, { type ParseKeys } from "i18next"; import { vi } from "vitest"; -/** Ready to use array of Moves.SPLASH x4 */ -export const SPLASH_ONLY = [Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]; - /** * Sets up the i18next mock. * Includes a i18next.t mocked implementation only returning the raw key (`(key) => key`)