mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-27 01:06:09 +00:00
apply game.override.moveset
This commit is contained in:
parent
bb1e3f7d20
commit
3242a084f1
@ -1,13 +1,12 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { CommandPhase, MessagePhase, TurnInitPhase } from "#app/phases";
|
||||
import i18next, { initI18n } from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import i18next, { initI18n } from "#app/plugins/i18n";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
|
||||
@ -34,7 +33,7 @@ describe("Ability Timing", () => {
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.ICE_BEAM]);
|
||||
game.override.moveset([Moves.SPLASH, Moves.ICE_BEAM]);
|
||||
});
|
||||
|
||||
it("should trigger after switch check", async() => {
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { MoveEffectPhase } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
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("Abilities - Aura Break", () => {
|
||||
@ -29,7 +28,7 @@ describe("Abilities - Aura Break", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
|
||||
game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyAbility(Abilities.AURA_BREAK);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
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("Abilities - Battery", () => {
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Battery", () => {
|
||||
game.override.battleType("double");
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - BATTLE BOND", () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.BATTLE_BOND);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import { CommandPhase, MessagePhase } from "#app/phases.js";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { Moves } from "#app/enums/moves.js";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { CommandPhase, MessagePhase } from "#app/phases.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
@ -30,7 +29,7 @@ describe("Abilities - COSTAR", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
game.override.ability(Abilities.COSTAR);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NASTY_PLOT]);
|
||||
game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - DISGUISE", () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.DISGUISE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -35,7 +35,7 @@ describe("Abilities - Dry Skin", () => {
|
||||
});
|
||||
|
||||
it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SUNNY_DAY, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SUNNY_DAY, Moves.SPLASH]);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
@ -56,7 +56,7 @@ describe("Abilities - Dry Skin", () => {
|
||||
});
|
||||
|
||||
it("during rain, gain 1/8 of maximum health at the end of each turn", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.RAIN_DANCE, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.RAIN_DANCE, Moves.SPLASH]);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
@ -79,7 +79,7 @@ describe("Abilities - Dry Skin", () => {
|
||||
});
|
||||
|
||||
it("opposing fire attacks do 25% more damage", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLAMETHROWER]);
|
||||
game.override.moveset([Moves.FLAMETHROWER]);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
@ -106,7 +106,7 @@ describe("Abilities - Dry Skin", () => {
|
||||
});
|
||||
|
||||
it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]);
|
||||
game.override.moveset([Moves.WATER_GUN]);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
@ -121,7 +121,7 @@ describe("Abilities - Dry Skin", () => {
|
||||
});
|
||||
|
||||
it("opposing water attacks do not heal if they were protected from", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]);
|
||||
game.override.moveset([Moves.WATER_GUN]);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
@ -137,7 +137,7 @@ describe("Abilities - Dry Skin", () => {
|
||||
});
|
||||
|
||||
it("multi-strike water attacks only heal once", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN, Moves.WATER_SHURIKEN]);
|
||||
game.override.moveset([Moves.WATER_GUN, Moves.WATER_SHURIKEN]);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
|
@ -28,7 +28,7 @@ describe("Abilities - Hustle", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HUSTLE);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]);
|
||||
game.override.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
|
@ -36,7 +36,7 @@ describe("Abilities - Ice Face", () => {
|
||||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.EISCUE);
|
||||
game.override.enemyAbility(Abilities.ICE_FACE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]);
|
||||
game.override.moveset([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]);
|
||||
});
|
||||
|
||||
it("takes no damage from physical move and transforms to Noice", async () => {
|
||||
@ -54,7 +54,7 @@ describe("Abilities - Ice Face", () => {
|
||||
});
|
||||
|
||||
it("takes no damage from the first hit of multihit physical move and transforms to Noice", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SURGING_STRIKES]);
|
||||
game.override.moveset([Moves.SURGING_STRIKES]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
await game.startBattle([Species.HITMONLEE]);
|
||||
|
||||
@ -109,7 +109,7 @@ describe("Abilities - Ice Face", () => {
|
||||
});
|
||||
|
||||
it("transforms to Ice Face when Hail or Snow starts", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.QUICK_ATTACK]);
|
||||
game.override.moveset([Moves.QUICK_ATTACK]);
|
||||
game.override.enemyMoveset([Moves.HAIL, Moves.HAIL, Moves.HAIL, Moves.HAIL]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -132,7 +132,7 @@ describe("Abilities - Ice Face", () => {
|
||||
|
||||
it("transforms to Ice Face when summoned on arena with active Snow or Hail", async () => {
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SNOWSCAPE]);
|
||||
game.override.moveset([Moves.SNOWSCAPE]);
|
||||
|
||||
await game.startBattle([Species.EISCUE, Species.NINJASK]);
|
||||
|
||||
@ -227,7 +227,7 @@ describe("Abilities - Ice Face", () => {
|
||||
});
|
||||
|
||||
it("cannot be suppressed", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GASTRO_ACID]);
|
||||
game.override.moveset([Moves.GASTRO_ACID]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -243,7 +243,7 @@ describe("Abilities - Ice Face", () => {
|
||||
});
|
||||
|
||||
it("cannot be swapped with another ability", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SKILL_SWAP]);
|
||||
game.override.moveset([Moves.SKILL_SWAP]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
@ -205,7 +205,7 @@ describe("Abilities - Intimidate", () => {
|
||||
|
||||
it("single - wild next wave opp triger once, us: none", async () => {
|
||||
game.override.startingWave(2);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.AERIAL_ACE]);
|
||||
game.override.moveset([Moves.AERIAL_ACE]);
|
||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||
@ -231,7 +231,7 @@ describe("Abilities - Intimidate", () => {
|
||||
|
||||
it("single - wild next turn - no retrigger on next turn", async () => {
|
||||
game.override.startingWave(2);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||
@ -254,7 +254,7 @@ describe("Abilities - Intimidate", () => {
|
||||
}, 20000);
|
||||
|
||||
it("single - trainer should only trigger once and each time he switch", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
game.override.enemyMoveset([Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH]);
|
||||
game.override.startingWave(5);
|
||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||
@ -293,7 +293,7 @@ describe("Abilities - Intimidate", () => {
|
||||
}, 200000);
|
||||
|
||||
it("single - trainer should only trigger once whatever turn we are", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||
game.override.startingWave(5);
|
||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||
|
@ -43,7 +43,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies and changes a pokemon's type",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -61,7 +61,7 @@ describe("Abilities - Protean", () => {
|
||||
test.skip(
|
||||
"ability applies only once per switch in",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.AGILITY]);
|
||||
game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
|
||||
|
||||
@ -101,7 +101,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move has a variable type",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WEATHER_BALL]);
|
||||
game.override.moveset([Moves.WEATHER_BALL]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -124,7 +124,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the type has changed by another ability",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.REFRIGERATE);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -147,7 +147,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move calls another move",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.NATURE_POWER]);
|
||||
game.override.moveset([Moves.NATURE_POWER]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -166,7 +166,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move is delayed / charging",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DIG]);
|
||||
game.override.moveset([Moves.DIG]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -184,7 +184,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move misses",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -207,7 +207,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move is protected against",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -226,7 +226,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move fails because of type immunity",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemySpecies(Species.GASTLY);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -245,7 +245,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if pokemon's type is the same as the move's type",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -264,7 +264,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if pokemon is terastallized",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -284,7 +284,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if pokemon uses struggle",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]);
|
||||
game.override.moveset([Moves.STRUGGLE]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -302,7 +302,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if the pokemon's move fails",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]);
|
||||
game.override.moveset([Moves.BURN_UP]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -320,7 +320,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's Trick-or-Treat fails",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TRICK_OR_TREAT]);
|
||||
game.override.moveset([Moves.TRICK_OR_TREAT]);
|
||||
game.override.enemySpecies(Species.GASTLY);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -339,7 +339,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly and the pokemon curses itself",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]);
|
||||
game.override.moveset([Moves.CURSE]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
@ -1,20 +1,19 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
EnemyCommandPhase,
|
||||
VictoryPhase
|
||||
} from "#app/phases";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import {Stat} from "#app/data/pokemon-stat";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import {Command} from "#app/ui/command-ui-handler";
|
||||
import {BattleStat} from "#app/data/battle-stat";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
describe("Abilities - Moxie", () => {
|
||||
@ -39,7 +38,7 @@ describe("Abilities - Moxie", () => {
|
||||
game.override.enemyAbility(Abilities.MOXIE);
|
||||
game.override.ability(Abilities.MOXIE);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -44,7 +44,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should add second strike to attack move",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -76,7 +76,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should apply secondary effects to both strikes",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.POWER_UP_PUNCH]);
|
||||
game.override.moveset([Moves.POWER_UP_PUNCH]);
|
||||
game.override.enemySpecies(Species.AMOONGUSS);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -99,7 +99,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not apply to Status moves",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BABY_DOLL_EYES]);
|
||||
game.override.moveset([Moves.BABY_DOLL_EYES]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -119,7 +119,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not apply to multi-hit moves",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DOUBLE_HIT]);
|
||||
game.override.moveset([Moves.DOUBLE_HIT]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -144,7 +144,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not apply to self-sacrifice moves",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SELF_DESTRUCT]);
|
||||
game.override.moveset([Moves.SELF_DESTRUCT]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -165,7 +165,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not apply to Rollout",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ROLLOUT]);
|
||||
game.override.moveset([Moves.ROLLOUT]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -189,7 +189,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not apply multiplier to fixed-damage moves",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_RAGE]);
|
||||
game.override.moveset([Moves.DRAGON_RAGE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -211,7 +211,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not apply multiplier to counter moves",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.COUNTER]);
|
||||
game.override.moveset([Moves.COUNTER]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -240,7 +240,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
"ability should not apply to multi-target moves",
|
||||
async () => {
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE]);
|
||||
game.override.moveset([Moves.EARTHQUAKE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]);
|
||||
|
||||
@ -265,7 +265,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should apply to multi-target moves when hitting only one target",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE]);
|
||||
game.override.moveset([Moves.EARTHQUAKE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -285,7 +285,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should only trigger post-target move effects once",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MIND_BLOWN]);
|
||||
game.override.moveset([Moves.MIND_BLOWN]);
|
||||
|
||||
await game.startBattle([Species.PIDGEOT]);
|
||||
|
||||
@ -311,7 +311,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Burn Up only removes type after second strike with this ability",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]);
|
||||
game.override.moveset([Moves.BURN_UP]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -338,7 +338,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Moves boosted by this ability and Multi-Lens should strike 4 times",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -360,7 +360,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Super Fang boosted by this ability and Multi-Lens should strike twice",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SUPER_FANG]);
|
||||
game.override.moveset([Moves.SUPER_FANG]);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -391,7 +391,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Seismic Toss boosted by this ability and Multi-Lens should strike twice",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SEISMIC_TOSS]);
|
||||
game.override.moveset([Moves.SEISMIC_TOSS]);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -422,7 +422,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Hyper Beam boosted by this ability should strike twice, then recharge",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HYPER_BEAM]);
|
||||
game.override.moveset([Moves.HYPER_BEAM]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -452,7 +452,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Anchor Shot boosted by this ability should only trap the target after the second hit",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ANCHOR_SHOT]);
|
||||
game.override.moveset([Moves.ANCHOR_SHOT]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -484,7 +484,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Smack Down boosted by this ability should only ground the target after the second hit",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SMACK_DOWN]);
|
||||
game.override.moveset([Moves.SMACK_DOWN]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -513,7 +513,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"U-turn boosted by this ability should strike twice before forcing a switch",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.U_TURN]);
|
||||
game.override.moveset([Moves.U_TURN]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||
|
||||
@ -539,7 +539,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"Wake-Up Slap boosted by this ability should only wake up the target after the second hit",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WAKE_UP_SLAP]);
|
||||
game.override.moveset([Moves.WAKE_UP_SLAP]);
|
||||
vi.spyOn(Overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.SLEEP);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -569,7 +569,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not cause user to hit into King's Shield more than once",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset([Moves.KINGS_SHIELD,Moves.KINGS_SHIELD,Moves.KINGS_SHIELD,Moves.KINGS_SHIELD]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -591,7 +591,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
test(
|
||||
"ability should not cause user to hit into Storm Drain more than once",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]);
|
||||
game.override.moveset([Moves.WATER_GUN]);
|
||||
game.override.enemyAbility(Abilities.STORM_DRAIN);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
@ -614,7 +614,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
"ability should not apply to multi-target moves with Multi-Lens",
|
||||
async () => {
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.EARTHQUAKE, Moves.SPLASH]);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]);
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.POWER_CONSTRUCT);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
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("Abilities - Power Spot", () => {
|
||||
@ -29,7 +28,7 @@ describe("Abilities - Power Spot", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
|
@ -43,7 +43,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies and changes a pokemon's type",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -61,7 +61,7 @@ describe("Abilities - Protean", () => {
|
||||
test.skip(
|
||||
"ability applies only once per switch in",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.AGILITY]);
|
||||
game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
|
||||
|
||||
@ -101,7 +101,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move has a variable type",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WEATHER_BALL]);
|
||||
game.override.moveset([Moves.WEATHER_BALL]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -124,7 +124,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the type has changed by another ability",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.REFRIGERATE);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -147,7 +147,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move calls another move",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.NATURE_POWER]);
|
||||
game.override.moveset([Moves.NATURE_POWER]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -166,7 +166,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move is delayed / charging",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DIG]);
|
||||
game.override.moveset([Moves.DIG]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -184,7 +184,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move misses",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -207,7 +207,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move is protected against",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -226,7 +226,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's move fails because of type immunity",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemySpecies(Species.GASTLY);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -245,7 +245,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if pokemon's type is the same as the move's type",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -264,7 +264,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if pokemon is terastallized",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -284,7 +284,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if pokemon uses struggle",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]);
|
||||
game.override.moveset([Moves.STRUGGLE]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -302,7 +302,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability is not applied if the pokemon's move fails",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]);
|
||||
game.override.moveset([Moves.BURN_UP]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
@ -320,7 +320,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly even if the pokemon's Trick-or-Treat fails",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TRICK_OR_TREAT]);
|
||||
game.override.moveset([Moves.TRICK_OR_TREAT]);
|
||||
game.override.enemySpecies(Species.GASTLY);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
@ -339,7 +339,7 @@ describe("Abilities - Protean", () => {
|
||||
test(
|
||||
"ability applies correctly and the pokemon curses itself",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]);
|
||||
game.override.moveset([Moves.CURSE]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
@ -29,7 +29,7 @@ describe("Abilities - Quick Draw", () => {
|
||||
|
||||
game.override.starterSpecies(Species.MAGIKARP);
|
||||
game.override.ability(Abilities.QUICK_DRAW);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TAIL_WHIP]);
|
||||
game.override.moveset([Moves.TACKLE, Moves.TAIL_WHIP]);
|
||||
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
@ -29,7 +29,7 @@ describe("Abilities - Sand Veil", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
game.override.enemySpecies(Species.MEOWSCARADA);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]);
|
||||
|
@ -38,7 +38,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const moveToUse = Moves.LEAFAGE;
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.DUSKULL);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
@ -59,7 +59,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const moveToUse = Moves.SPORE;
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
@ -78,7 +78,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const moveToUse = Moves.GRASSY_TERRAIN;
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
@ -98,7 +98,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const moveToUse = Moves.BULLET_SEED;
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
@ -119,7 +119,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const moveToUse = Moves.SPIKY_SHIELD;
|
||||
const ability = Abilities.SAP_SIPPER;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.ability(ability);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
@ -145,7 +145,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const moveToUse = Moves.METRONOME;
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - SCHOOLING", () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.SCHOOLING);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import { PostSummonPhase, TurnEndPhase, } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Abilities - Screen Cleaner", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Screen Cleaner", () => {
|
||||
});
|
||||
|
||||
it("removes Aurora Veil", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HAIL]);
|
||||
game.override.moveset([Moves.HAIL]);
|
||||
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||
|
@ -1,20 +1,19 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import {Abilities} from "#enums/abilities";
|
||||
import {applyAbAttrs ,MoveEffectChanceMultiplierAbAttr} from "#app/data/ability";
|
||||
import {Species} from "#enums/species";
|
||||
import { applyAbAttrs, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
MoveEffectPhase,
|
||||
} from "#app/phases";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import {Stat} from "#app/data/pokemon-stat";
|
||||
import {Moves} from "#enums/moves";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import {Command} from "#app/ui/command-ui-handler";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
describe("Abilities - Serene Grace", () => {
|
||||
@ -37,7 +36,7 @@ describe("Abilities - Serene Grace", () => {
|
||||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.ONIX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(movesToUse);
|
||||
game.override.moveset(movesToUse);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe("Abilities - Sheer Force", () => {
|
||||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.ONIX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(movesToUse);
|
||||
game.override.moveset(movesToUse);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,20 +1,19 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import {applyAbAttrs ,applyPreDefendAbAttrs,IgnoreMoveEffectsAbAttr,MoveEffectChanceMultiplierAbAttr} from "#app/data/ability";
|
||||
import {Species} from "#enums/species";
|
||||
import { applyAbAttrs, applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
MoveEffectPhase,
|
||||
} from "#app/phases";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import {Stat} from "#app/data/pokemon-stat";
|
||||
import {Moves} from "#enums/moves";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import {Command} from "#app/ui/command-ui-handler";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
describe("Abilities - Shield Dust", () => {
|
||||
@ -38,7 +37,7 @@ describe("Abilities - Shield Dust", () => {
|
||||
game.override.enemySpecies(Species.ONIX);
|
||||
game.override.enemyAbility(Abilities.SHIELD_DUST);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(movesToUse);
|
||||
game.override.moveset(movesToUse);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - SHIELDS DOWN", () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.SHIELDS_DOWN);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { allAbilities } from "#app/data/ability.js";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { MoveEffectPhase, SelectTargetPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
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("Abilities - Steely Spirit", () => {
|
||||
@ -33,7 +32,7 @@ describe("Abilities - Steely Spirit", () => {
|
||||
game.override.battleType("double");
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.IRON_HEAD, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.IRON_HEAD, Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
vi.spyOn(allMoves[moveToCheck], "calculateBattlePower");
|
||||
});
|
||||
|
@ -34,7 +34,7 @@ describe("Abilities - Sturdy", () => {
|
||||
|
||||
game.override.starterSpecies(Species.LUCARIO);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CLOSE_COMBAT, Moves.FISSURE]);
|
||||
game.override.moveset([Moves.CLOSE_COMBAT, Moves.FISSURE]);
|
||||
|
||||
game.override.enemySpecies(Species.ARON);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
|
@ -68,7 +68,7 @@ describe("Abilities - Unseen Fist", () => {
|
||||
});
|
||||
|
||||
async function testUnseenFistHitResult(game: GameManager, attackMove: Moves, protectMove: Moves, shouldSucceed: boolean = true): Promise<void> {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([attackMove]);
|
||||
game.override.moveset([attackMove]);
|
||||
game.override.enemyMoveset([protectMove, protectMove, protectMove, protectMove]);
|
||||
|
||||
await game.startBattle();
|
||||
|
@ -37,7 +37,7 @@ describe("Abilities - Volt Absorb", () => {
|
||||
const moveToUse = Moves.CHARGE;
|
||||
const ability = Abilities.VOLT_ABSORB;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.ability(ability);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.DUSKULL);
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
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("Abilities - Wind Power", () => {
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Wind Power", () => {
|
||||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.SHIFTRY);
|
||||
game.override.enemyAbility(Abilities.WIND_POWER);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||
game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
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("Abilities - Wind Rider", () => {
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Wind Rider", () => {
|
||||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.SHIFTRY);
|
||||
game.override.enemyAbility(Abilities.WIND_RIDER);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||
game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { allAbilities } from "#app/data/ability.js";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { MoveEffectPhase } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { allAbilities } from "#app/data/ability.js";
|
||||
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("Abilities - Wonder Skin", () => {
|
||||
@ -28,7 +27,7 @@ describe("Abilities - Wonder Skin", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.CHARM]);
|
||||
game.override.moveset([Moves.TACKLE, Moves.CHARM]);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.WONDER_SKIN);
|
||||
|
@ -48,7 +48,7 @@ describe("Abilities - ZEN MODE", () => {
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - ZERO TO HERO", () => {
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.ZERO_TO_HERO);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import {MoneyAchv, Achv, AchvTier, RibbonAchv, DamageAchv, HealAchv, LevelAchv, ModifierAchv, achvs} from "#app/system/achv";
|
||||
import BattleScene from "../../battle-scene";
|
||||
import { IntegerHolder, NumberHolder } from "#app/utils.js";
|
||||
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier.js";
|
||||
import Phaser from "phaser";
|
||||
import { Achv, AchvTier, DamageAchv, HealAchv, LevelAchv, ModifierAchv, MoneyAchv, RibbonAchv, achvs } from "#app/system/achv";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { IntegerHolder, NumberHolder } from "#app/utils.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import BattleScene from "../../battle-scene";
|
||||
|
||||
describe("check some Achievement related stuff", () => {
|
||||
it ("should check Achievement creation", () => {
|
||||
@ -103,8 +102,8 @@ describe("RibbonAchv", () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([]);
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.moveset([]);
|
||||
game.override.startingLevel(0);
|
||||
game.override.starterSpecies(0);
|
||||
game.override.enemyMoveset([]);
|
||||
|
@ -30,7 +30,7 @@ describe("Arena - Gravity", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.GRAVITY, Moves.FISSURE]);
|
||||
game.override.moveset([Moves.TACKLE, Moves.GRAVITY, Moves.FISSURE]);
|
||||
game.override.ability(Abilities.UNNERVE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
|
@ -1,16 +1,15 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { WeatherType } from "#app/data/weather.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
describe("Weather - Fog", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -31,7 +30,7 @@ describe("Weather - Fog", () => {
|
||||
game.override
|
||||
.weather(WeatherType.FOG)
|
||||
.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import {
|
||||
TurnStartPhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Weather - Strong Winds", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -31,7 +30,7 @@ describe("Weather - Strong Winds", () => {
|
||||
game.override.startingLevel(10);
|
||||
game.override.enemySpecies(Species.TAILLOW);
|
||||
game.override.enemyAbility(Abilities.DELTA_STREAM);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.THUNDERBOLT, Moves.ICE_BEAM, Moves.ROCK_SLIDE]);
|
||||
game.override.moveset([Moves.THUNDERBOLT, Moves.ICE_BEAM, Moves.ROCK_SLIDE]);
|
||||
});
|
||||
|
||||
it("electric type move is not very effective on Rayquaza", async () => {
|
||||
|
@ -1,20 +1,19 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase, EnemyCommandPhase, SelectTargetPhase,
|
||||
TurnStartPhase
|
||||
} from "#app/phases";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import {Command} from "#app/ui/command-ui-handler";
|
||||
import {Stat} from "#app/data/pokemon-stat";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import TargetSelectUiHandler from "#app/ui/target-select-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import {Button} from "#enums/buttons";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
describe("Battle order", () => {
|
||||
@ -37,7 +36,7 @@ describe("Battle order", () => {
|
||||
game.override.enemySpecies(Species.MEWTWO);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
});
|
||||
|
||||
it("opponent faster than player 50 vs 150", async() => {
|
||||
|
@ -1,9 +1,6 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import {generateStarter, getMovePosition,} from "#app/test/utils/gameManagerUtils";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import {GameModes} from "#app/game-mode";
|
||||
import Overrides from "#app/overrides";
|
||||
import {Command} from "#app/ui/command-ui-handler";
|
||||
import { allSpecies } from "#app/data/pokemon-species";
|
||||
import { GameModes } from "#app/game-mode";
|
||||
import { getGameMode } from "#app/game-mode.js";
|
||||
import {
|
||||
CommandPhase, DamagePhase,
|
||||
EncounterPhase,
|
||||
@ -17,13 +14,15 @@ import {
|
||||
TurnInitPhase, VictoryPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import {allSpecies} from "#app/data/pokemon-species";
|
||||
import { getGameMode } from "#app/game-mode.js";
|
||||
import { generateStarter, getMovePosition, } from "#app/test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Test Battle Phase", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -96,7 +95,7 @@ describe("Test Battle Phase", () => {
|
||||
game.override
|
||||
.startingWave(3)
|
||||
.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
await game.startBattle();
|
||||
@ -115,7 +114,7 @@ describe("Test Battle Phase", () => {
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.startingLevel(5);
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
game.override.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]);
|
||||
game.override.battleType("single");
|
||||
@ -268,7 +267,7 @@ describe("Test Battle Phase", () => {
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
await game.startBattle([
|
||||
Species.DARMANITAN,
|
||||
@ -297,7 +296,7 @@ describe("Test Battle Phase", () => {
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
await game.startBattle();
|
||||
const turn = game.scene.currentBattle.turn;
|
||||
@ -315,7 +314,7 @@ describe("Test Battle Phase", () => {
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
await game.startBattle();
|
||||
const waveIndex = game.scene.currentBattle.waveIndex;
|
||||
|
@ -1,10 +1,9 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Test Battle Phase", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -31,7 +30,7 @@ describe("Test Battle Phase", () => {
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import Overrides from "#app/overrides";
|
||||
import {
|
||||
CommandPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Test Battle Phase", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -28,7 +27,7 @@ describe("Test Battle Phase", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.HYDRATION);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
|
@ -31,7 +31,7 @@ describe("Items - Grip Claw", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.POPULATION_BOMB, Moves.SPLASH ]);
|
||||
game.override.moveset([ Moves.POPULATION_BOMB, Moves.SPLASH ]);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "GRIP_CLAW", count: 5}, {name: "MULTI_LENS", count: 3}]);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.ability(Abilities.KLUTZ);
|
||||
|
@ -36,7 +36,7 @@ describe("Items - Leek", () => {
|
||||
|
||||
it("LEEK activates in battle correctly", async() => {
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "LEEK" }]);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.POUND ]);
|
||||
game.override.moveset([ Moves.POUND ]);
|
||||
const consoleSpy = vi.spyOn(console, "log");
|
||||
await game.startBattle([
|
||||
Species.FARFETCHD
|
||||
|
@ -28,7 +28,7 @@ describe("Items - Leftovers", () => {
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.UNNERVE);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
|
@ -36,7 +36,7 @@ describe("Items - Scope Lens", () => {
|
||||
|
||||
it("SCOPE_LENS activates in battle correctly", async() => {
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SCOPE_LENS" }]);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.POUND ]);
|
||||
game.override.moveset([ Moves.POUND ]);
|
||||
const consoleSpy = vi.spyOn(console, "log");
|
||||
await game.startBattle([
|
||||
Species.GASTLY
|
||||
|
@ -41,7 +41,7 @@ describe("Items - Toxic orb", () => {
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([oppMoveToUse, oppMoveToUse, oppMoveToUse, oppMoveToUse]);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{
|
||||
name: "TOXIC_ORB",
|
||||
|
@ -29,7 +29,7 @@ describe("Moves - Astonish", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ASTONISH, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.ASTONISH, Moves.SPLASH]);
|
||||
game.override.enemySpecies(Species.BLASTOISE);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
|
@ -37,7 +37,7 @@ describe("Moves - Aurora Veil", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);
|
||||
|
@ -38,7 +38,7 @@ describe("Moves - Ceaseless Edge", () => {
|
||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.RUN_AWAY);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.CEASELESS_EDGE, Moves.SPLASH, Moves.ROAR ]);
|
||||
game.override.moveset([ Moves.CEASELESS_EDGE, Moves.SPLASH, Moves.ROAR ]);
|
||||
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
||||
vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100);
|
||||
|
||||
|
@ -28,7 +28,7 @@ describe("Moves - Double Team", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DOUBLE_TEAM]);
|
||||
game.override.moveset([Moves.DOUBLE_TEAM]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
|
@ -39,7 +39,7 @@ describe("Moves - Dragon Rage", () => {
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
|
||||
game.override.starterSpecies(Species.SNORLAX);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_RAGE]);
|
||||
game.override.moveset([Moves.DRAGON_RAGE]);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.startingLevel(100);
|
||||
|
@ -28,7 +28,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ dynamaxCannon.id ]);
|
||||
game.override.moveset([ dynamaxCannon.id ]);
|
||||
game.override.startingLevel(200);
|
||||
|
||||
// Note that, for Waves 1-10, the level cap is 10
|
||||
|
@ -34,7 +34,7 @@ describe("Moves - Fissure", () => {
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
|
||||
game.override.starterSpecies(Species.SNORLAX);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FISSURE]);
|
||||
game.override.moveset([Moves.FISSURE]);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.startingLevel(100);
|
||||
|
||||
|
@ -34,7 +34,7 @@ describe("Moves - Flower Shield", () => {
|
||||
game.override.ability(Abilities.NONE);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLOWER_SHIELD, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.FLOWER_SHIELD, Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe("Moves - Follow Me", () => {
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
@ -102,7 +102,7 @@ describe("Moves - Follow Me", () => {
|
||||
"move effect should be bypassed by Stalwart",
|
||||
async () => {
|
||||
game.override.ability(Abilities.STALWART);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.QUICK_ATTACK ]);
|
||||
game.override.moveset([ Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]);
|
||||
|
||||
await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]);
|
||||
@ -136,7 +136,7 @@ describe("Moves - Follow Me", () => {
|
||||
test(
|
||||
"move effect should be bypassed by Snipe Shot",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SNIPE_SHOT ]);
|
||||
game.override.moveset([ Moves.SNIPE_SHOT ]);
|
||||
game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]);
|
||||
|
||||
await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]);
|
||||
|
@ -34,7 +34,7 @@ describe("Moves - Gastro Acid", () => {
|
||||
game.override.startingLevel(1);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
|
||||
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.enemyAbility(Abilities.WATER_ABSORB);
|
||||
|
@ -34,7 +34,7 @@ describe("Moves - Glaive Rush", () => {
|
||||
game.override.starterSpecies(Species.KLINK);
|
||||
game.override.ability(Abilities.UNNERVE);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FUR_COAT);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]);
|
||||
game.override.moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]);
|
||||
});
|
||||
|
||||
it("takes double damage from attacks", async() => {
|
||||
|
@ -1,20 +1,19 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
EnemyCommandPhase,
|
||||
TurnInitPhase,
|
||||
} from "#app/phases";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import {Stat} from "#app/data/pokemon-stat";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import {Command} from "#app/ui/command-ui-handler";
|
||||
import {BattleStat} from "#app/data/battle-stat";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
describe("Moves - Growth", () => {
|
||||
@ -39,7 +38,7 @@ describe("Moves - Growth", () => {
|
||||
game.override.enemyAbility(Abilities.MOXIE);
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import {
|
||||
MoveEffectPhase
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
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 - Hard Press", () => {
|
||||
@ -35,7 +34,7 @@ describe("Moves - Hard Press", () => {
|
||||
game.override.enemySpecies(Species.MUNCHLAX);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HARD_PRESS]);
|
||||
game.override.moveset([Moves.HARD_PRESS]);
|
||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||
});
|
||||
|
||||
|
@ -35,7 +35,7 @@ describe("Moves - Hyper Beam", () => {
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
|
||||
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HYPER_BEAM, Moves.TACKLE]);
|
||||
game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]);
|
||||
vi.spyOn(allMoves[Moves.HYPER_BEAM], "accuracy", "get").mockReturnValue(100);
|
||||
});
|
||||
|
||||
|
@ -36,7 +36,7 @@ describe("Moves - Light Screen", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]);
|
||||
game.override.moveset([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]);
|
||||
|
@ -29,7 +29,7 @@ describe("Moves - Magnet Rise", () => {
|
||||
game.override.enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]);
|
||||
game.override.moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]);
|
||||
});
|
||||
|
||||
it("MAGNET RISE", async () => {
|
||||
|
@ -33,7 +33,7 @@ describe("Moves - Make It Rain", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MAKE_IT_RAIN, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.MAKE_IT_RAIN, Moves.SPLASH]);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
@ -166,7 +166,7 @@ function leaveOneEnemyPokemon(game: GameManager) {
|
||||
function beforeTrial(phaserGame: Phaser.Game, single: boolean = false) {
|
||||
const game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE, Moves.HYPER_VOICE, Moves.SURF, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.EARTHQUAKE, Moves.HYPER_VOICE, Moves.SURF, Moves.SPLASH]);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
|
@ -1,14 +1,13 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { TrappedTag } from "#app/data/battler-tags.js";
|
||||
import { CommandPhase, MoveEndPhase, TurnInitPhase } from "#app/phases";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import {BattleStat} from "#app/data/battle-stat";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { TrappedTag } from "#app/data/battler-tags.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Moves - Octolock", () => {
|
||||
@ -36,7 +35,7 @@ describe("Moves - Octolock", () => {
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.OCTOLOCK, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.OCTOLOCK, Moves.SPLASH]);
|
||||
game.override.ability(Abilities.NONE);
|
||||
});
|
||||
|
||||
|
@ -33,7 +33,7 @@ describe("Moves - Purify", () => {
|
||||
|
||||
game.override.starterSpecies(Species.PYUKUMUKU);
|
||||
game.override.startingLevel(10);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.PURIFY, Moves.SIZZLY_SLIDE]);
|
||||
game.override.moveset([Moves.PURIFY, Moves.SIZZLY_SLIDE]);
|
||||
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(10);
|
||||
|
@ -36,7 +36,7 @@ describe("Moves - Rage Powder", () => {
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -36,7 +36,7 @@ describe("Moves - Reflect", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]);
|
||||
|
@ -38,7 +38,7 @@ describe("Moves - Rollout", () => {
|
||||
});
|
||||
|
||||
it("should double it's dmg on sequential uses but reset after 5", async () => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ROLLOUT]);
|
||||
game.override.moveset([Moves.ROLLOUT]);
|
||||
vi.spyOn(allMoves[Moves.ROLLOUT], "accuracy", "get").mockReturnValue(100); //always hit
|
||||
|
||||
const variance = 5;
|
||||
|
@ -32,7 +32,7 @@ describe("Moves - Roost", () => {
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.STOMPING_TANTRUM ]);
|
||||
game.override.moveset([ Moves.STOMPING_TANTRUM ]);
|
||||
game.override.enemyMoveset([Moves.ROOST,Moves.ROOST,Moves.ROOST,Moves.ROOST]);
|
||||
});
|
||||
|
||||
|
@ -35,7 +35,7 @@ describe("Moves - Spikes", () => {
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.startingWave(3);
|
||||
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPIKES,Moves.SPLASH, Moves.ROAR]);
|
||||
game.override.moveset([Moves.SPIKES,Moves.SPLASH, Moves.ROAR]);
|
||||
});
|
||||
|
||||
it("single - wild - stay on field - no damage", async() => {
|
||||
|
@ -35,7 +35,7 @@ describe("Moves - Spit Up", () => {
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
|
||||
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP]);
|
||||
game.override.moveset([Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP]);
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
});
|
||||
|
||||
|
@ -36,7 +36,7 @@ describe("Moves - Spotlight", () => {
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -35,7 +35,7 @@ describe("Moves - Stockpile", () => {
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STOCKPILE, Moves.SPLASH]);
|
||||
game.override.moveset([Moves.STOCKPILE, Moves.SPLASH]);
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
});
|
||||
|
||||
|
@ -34,7 +34,7 @@ describe("Moves - Swallow", () => {
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
|
||||
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]);
|
||||
game.override.moveset([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]);
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
});
|
||||
|
||||
|
@ -35,7 +35,7 @@ describe("Moves - Tackle", () => {
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.startingLevel(1);
|
||||
game.override.startingWave(97);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.GROWTH,Moves.GROWTH,Moves.GROWTH,Moves.GROWTH]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
});
|
||||
|
@ -1,19 +1,18 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
EnemyCommandPhase,
|
||||
TurnInitPhase,
|
||||
} from "#app/phases";
|
||||
import {Mode} from "#app/ui/ui";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import {Command} from "#app/ui/command-ui-handler";
|
||||
import {BattleStat} from "#app/data/battle-stat";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
describe("Moves - Tail whip", () => {
|
||||
@ -38,7 +37,7 @@ describe("Moves - Tail whip", () => {
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
@ -1,16 +1,15 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { ArenaTagSide } from "#app/data/arena-tag.js";
|
||||
import { Stat } from "#app/data/pokemon-stat.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Stat } from "#app/data/pokemon-stat.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import { ArenaTagSide } from "#app/data/arena-tag.js";
|
||||
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("Abilities - Wind Rider", () => {
|
||||
@ -30,7 +29,7 @@ describe("Abilities - Wind Rider", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||
game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
|
@ -34,7 +34,7 @@ describe("Moves - Thousand Arrows", () => {
|
||||
game.override.enemySpecies(Species.TOGETIC);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.THOUSAND_ARROWS ]);
|
||||
game.override.moveset([ Moves.THOUSAND_ARROWS ]);
|
||||
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
||||
});
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import { MoveEndPhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
|
||||
@ -34,12 +33,12 @@ describe("Moves - Tidy Up", () => {
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.starterSpecies(Species.FEEBAS);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TIDY_UP]);
|
||||
game.override.moveset([Moves.TIDY_UP]);
|
||||
game.override.startingLevel(50);
|
||||
});
|
||||
|
||||
it("spikes are cleared", async() => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPIKES, Moves.TIDY_UP]);
|
||||
game.override.moveset([Moves.SPIKES, Moves.TIDY_UP]);
|
||||
game.override.enemyMoveset([Moves.SPIKES, Moves.SPIKES, Moves.SPIKES, Moves.SPIKES]);
|
||||
await game.startBattle();
|
||||
|
||||
@ -52,7 +51,7 @@ describe("Moves - Tidy Up", () => {
|
||||
}, 20000);
|
||||
|
||||
it("stealth rocks are cleared", async() => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STEALTH_ROCK, Moves.TIDY_UP]);
|
||||
game.override.moveset([Moves.STEALTH_ROCK, Moves.TIDY_UP]);
|
||||
game.override.enemyMoveset([Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK]);
|
||||
await game.startBattle();
|
||||
|
||||
@ -65,7 +64,7 @@ describe("Moves - Tidy Up", () => {
|
||||
}, 20000);
|
||||
|
||||
it("toxic spikes are cleared", async() => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TOXIC_SPIKES, Moves.TIDY_UP]);
|
||||
game.override.moveset([Moves.TOXIC_SPIKES, Moves.TIDY_UP]);
|
||||
game.override.enemyMoveset([Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES]);
|
||||
await game.startBattle();
|
||||
|
||||
@ -78,7 +77,7 @@ describe("Moves - Tidy Up", () => {
|
||||
}, 20000);
|
||||
|
||||
it("sticky webs are cleared", async() => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STICKY_WEB, Moves.TIDY_UP]);
|
||||
game.override.moveset([Moves.STICKY_WEB, Moves.TIDY_UP]);
|
||||
game.override.enemyMoveset([Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB]);
|
||||
|
||||
await game.startBattle();
|
||||
@ -92,7 +91,7 @@ describe("Moves - Tidy Up", () => {
|
||||
}, 20000);
|
||||
|
||||
it.skip("substitutes are cleared", async() => {
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SUBSTITUTE, Moves.TIDY_UP]);
|
||||
game.override.moveset([Moves.SUBSTITUTE, Moves.TIDY_UP]);
|
||||
game.override.enemyMoveset([Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE]);
|
||||
|
||||
await game.startBattle();
|
||||
|
@ -41,7 +41,7 @@ describe("UI - Transfer Items", () => {
|
||||
{ name: "BERRY", count: 2, type: BerryType.APICOT },
|
||||
{ name: "BERRY", count: 2, type: BerryType.LUM },
|
||||
]);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_CLAW]);
|
||||
game.override.moveset([Moves.DRAGON_CLAW]);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user