[Test] Stylistic consistency pass on tests (#3378)
* Modify tests to use overrides helper functions * Apply stylistic consistency to overrides in tests Also remove some non-test-related expects()
This commit is contained in:
parent
7e81b50214
commit
877d0c6db8
|
@ -1,13 +1,13 @@
|
|||
import { CommandPhase, MessagePhase, TurnInitPhase } from "#app/phases";
|
||||
import i18next, { initI18n } from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#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 Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
|
||||
describe("Ability Timing", () => {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { allMoves } from "#app/data/move.js";
|
||||
import { MoveEffectPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Aura Break", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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 GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#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";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Battery", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -5,9 +5,9 @@ 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";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -42,8 +42,6 @@ describe("Abilities - COSTAR", () => {
|
|||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
||||
|
||||
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
||||
expect(leftPokemon).toBeDefined();
|
||||
expect(rightPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.NASTY_PLOT));
|
||||
await game.phaseInterceptor.to(CommandPhase);
|
||||
|
@ -73,8 +71,6 @@ describe("Abilities - COSTAR", () => {
|
|||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
||||
|
||||
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
||||
expect(leftPokemon).toBeDefined();
|
||||
expect(rightPokemon).toBeDefined();
|
||||
|
||||
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);
|
||||
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Species } from "#app/enums/species.js";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Dry Skin", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -83,7 +83,6 @@ describe("Abilities - Dry Skin", () => {
|
|||
await game.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
expect(enemy).toBeDefined();
|
||||
const initialHP = 1000;
|
||||
enemy.hp = initialHP;
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@ import { allMoves } from "#app/data/move.js";
|
|||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { Stat } from "#app/enums/stat.js";
|
||||
import { DamagePhase, MoveEffectPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#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";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Hustle", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
import { QuietFormChangePhase } from "#app/form-change-phase";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
MoveEndPhase,
|
||||
TurnEndPhase,
|
||||
TurnInitPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { MoveEffectPhase, MoveEndPhase, TurnEndPhase, TurnInitPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { generateStarter, getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { generateStarter, getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Status, StatusEffect } from "#app/data/status-effect";
|
||||
import { GameModes, getGameMode } from "#app/game-mode";
|
||||
|
@ -12,6 +11,7 @@ import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, SelectSta
|
|||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Intimidate", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -35,7 +35,7 @@ describe("Abilities - Intimidate", () => {
|
|||
game.override.enemyPassiveAbility(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.INTIMIDATE);
|
||||
game.override.startingWave(3);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
it("single - wild with switch", async () => {
|
||||
|
@ -294,7 +294,7 @@ describe("Abilities - Intimidate", () => {
|
|||
|
||||
it("single - trainer should only trigger once whatever turn we are", async () => {
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.startingWave(5);
|
||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||
|
@ -334,7 +334,6 @@ describe("Abilities - Intimidate", () => {
|
|||
it("double - wild vs only 1 on player side", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "COIN_CASE" }]);
|
||||
await game.runToSummon([Species.MIGHTYENA]);
|
||||
await game.phaseInterceptor.to(CommandPhase, false);
|
||||
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { CommandPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -10,9 +10,9 @@ import { Moves } from "#enums/moves";
|
|||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
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 GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#enums/species";
|
||||
import { TurnEndPhase, MoveEffectPhase } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||
import { ArenaTagSide, getArenaTag } from "#app/data/arena-tag";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { WeatherType } from "#app/data/weather.js";
|
||||
import { StatusEffect, getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000; // 20 sec timeout
|
||||
|
||||
|
@ -33,16 +33,15 @@ describe("Abilities - Magic Guard", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
/** Player Pokemon overrides */
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD);
|
||||
vi.spyOn(overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.ability(Abilities.MAGIC_GUARD);
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
game.override.startingLevel(100);
|
||||
|
||||
/** Enemy Pokemon overrides */
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyLevel(100);
|
||||
});
|
||||
|
||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Magic_Guard_(Ability)
|
||||
|
@ -50,15 +49,13 @@ describe("Abilities - Magic Guard", () => {
|
|||
it(
|
||||
"ability should prevent damage caused by weather",
|
||||
async () => {
|
||||
vi.spyOn(overrides, "WEATHER_OVERRIDE", "get").mockReturnValue(WeatherType.SANDSTORM);
|
||||
game.override.weather(WeatherType.SANDSTORM);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
|
@ -78,15 +75,11 @@ describe("Abilities - Magic Guard", () => {
|
|||
"ability should prevent damage caused by status effects but other non-damage effects still apply",
|
||||
async () => {
|
||||
//Toxic keeps track of the turn counters -> important that Magic Guard keeps track of post-Toxic turns
|
||||
vi.spyOn(overrides, "STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.POISON);
|
||||
game.override.statusEffect(StatusEffect.POISON);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
|
@ -105,16 +98,12 @@ describe("Abilities - Magic Guard", () => {
|
|||
it(
|
||||
"ability effect should not persist when the ability is replaced",
|
||||
async () => {
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED]);
|
||||
vi.spyOn(overrides, "STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.POISON);
|
||||
game.override.enemyMoveset([Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED,Moves.WORRY_SEED]);
|
||||
game.override.statusEffect(StatusEffect.POISON);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
|
@ -131,18 +120,14 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
it("Magic Guard prevents damage caused by burn but other non-damaging effects are still applied",
|
||||
async () => {
|
||||
vi.spyOn(overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.BURN);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD);
|
||||
game.override.enemyStatusEffect(StatusEffect.BURN);
|
||||
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect (leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
|
@ -159,18 +144,14 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
it("Magic Guard prevents damage caused by toxic but other non-damaging effects are still applied",
|
||||
async () => {
|
||||
vi.spyOn(overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.TOXIC);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD);
|
||||
game.override.enemyStatusEffect(StatusEffect.TOXIC);
|
||||
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect (leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
const toxicStartCounter = enemyPokemon.status.turnCount;
|
||||
//should be 0
|
||||
|
@ -197,12 +178,10 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
|
@ -225,12 +204,10 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
|
@ -250,16 +227,14 @@ describe("Abilities - Magic Guard", () => {
|
|||
it("Magic Guard prevents against damage from volatile status effects",
|
||||
async () => {
|
||||
await game.startBattle([Species.DUSKULL]);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MAGIC_GUARD);
|
||||
game.override.moveset([Moves.CURSE]);
|
||||
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect (leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.CURSE));
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
|
@ -276,11 +251,10 @@ describe("Abilities - Magic Guard", () => {
|
|||
);
|
||||
|
||||
it("Magic Guard prevents crash damage", async () => {
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HIGH_JUMP_KICK]);
|
||||
game.override.moveset([Moves.HIGH_JUMP_KICK]);
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.HIGH_JUMP_KICK));
|
||||
await game.phaseInterceptor.to(MoveEffectPhase, false);
|
||||
|
@ -297,11 +271,10 @@ describe("Abilities - Magic Guard", () => {
|
|||
);
|
||||
|
||||
it("Magic Guard prevents damage from recoil", async () => {
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAKE_DOWN]);
|
||||
game.override.moveset([Moves.TAKE_DOWN]);
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.TAKE_DOWN));
|
||||
|
||||
|
@ -316,11 +289,10 @@ describe("Abilities - Magic Guard", () => {
|
|||
);
|
||||
|
||||
it("Magic Guard does not prevent damage from Struggle's recoil", async () => {
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]);
|
||||
game.override.moveset([Moves.STRUGGLE]);
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.STRUGGLE));
|
||||
|
||||
|
@ -336,11 +308,10 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
//This tests different move attributes than the recoil tests above
|
||||
it("Magic Guard prevents self-damage from attacking moves", async () => {
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STEEL_BEAM]);
|
||||
game.override.moveset([Moves.STEEL_BEAM]);
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.STEEL_BEAM));
|
||||
|
||||
|
@ -365,11 +336,10 @@ describe("Abilities - Magic Guard", () => {
|
|||
*/
|
||||
|
||||
it("Magic Guard does not prevent self-damage from non-attacking moves", async () => {
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BELLY_DRUM]);
|
||||
game.override.moveset([Moves.BELLY_DRUM]);
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.BELLY_DRUM));
|
||||
|
||||
|
@ -385,15 +355,14 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
it("Magic Guard prevents damage from abilities with PostTurnHurtIfSleepingAbAttr", async() => {
|
||||
//Tests the ability Bad Dreams
|
||||
vi.spyOn(overrides, "STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.SLEEP);
|
||||
game.override.statusEffect(StatusEffect.SLEEP);
|
||||
//enemy pokemon is given Spore just in case player pokemon somehow awakens during test
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BAD_DREAMS);
|
||||
game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]);
|
||||
game.override.enemyAbility(Abilities.BAD_DREAMS);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
||||
|
@ -411,16 +380,14 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async() => {
|
||||
//Tests the abilities Innards Out/Aftermath
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.AFTERMATH);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyAbility(Abilities.AFTERMATH);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
enemyPokemon.hp = 1;
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE));
|
||||
|
@ -438,16 +405,14 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
it("Magic Guard prevents damage from abilities with PostDefendContactDamageAbAttr", async() => {
|
||||
//Tests the abilities Iron Barbs/Rough Skin
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.IRON_BARBS);
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyAbility(Abilities.IRON_BARBS);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE));
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
@ -464,16 +429,14 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
it("Magic Guard prevents damage from abilities with ReverseDrainAbAttr", async() => {
|
||||
//Tests the ability Liquid Ooze
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB]);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.LIQUID_OOZE);
|
||||
game.override.moveset([Moves.ABSORB]);
|
||||
game.override.enemyAbility(Abilities.LIQUID_OOZE);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.ABSORB));
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
@ -490,12 +453,11 @@ describe("Abilities - Magic Guard", () => {
|
|||
|
||||
it("Magic Guard prevents HP loss from abilities with PostWeatherLapseDamageAbAttr", async() => {
|
||||
//Tests the abilities Solar Power/Dry Skin
|
||||
vi.spyOn(overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SOLAR_POWER);
|
||||
vi.spyOn(overrides, "WEATHER_OVERRIDE", "get").mockReturnValue(WeatherType.SUNNY);
|
||||
game.override.passiveAbility(Abilities.SOLAR_POWER);
|
||||
game.override.weather(WeatherType.SUNNY);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
EnemyCommandPhase,
|
||||
VictoryPhase
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, EnemyCommandPhase, VictoryPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
|
|
@ -8,9 +8,9 @@ import { Moves } from "#enums/moves";
|
|||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
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 GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#enums/species";
|
||||
import {
|
||||
CommandPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { CommandPhase, TurnEndPhase } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { StatusEffect } from "#app/data/status-effect.js";
|
||||
import { allAbilities } from "#app/data/ability.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
|
@ -30,11 +26,11 @@ describe("Abilities - Pastel Veil", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD]);
|
||||
game.override.battleType("double");
|
||||
game.override.moveset([Moves.SPLASH]);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD, Moves.TOXIC_THREAD]);
|
||||
});
|
||||
|
||||
it("prevents the user and its allies from being afflicted by poison", async () => {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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 GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#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";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Power Spot", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -10,9 +10,9 @@ import { Moves } from "#enums/moves";
|
|||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { allAbilities, BypassSpeedChanceAbAttr } from "#app/data/ability";
|
||||
import { FaintPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
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";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { WeatherType } from "#app/enums/weather-type.js";
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import { Moves } from "#enums/moves";
|
|||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -45,10 +45,6 @@ describe("Abilities - Sand Veil", () => {
|
|||
await game.startBattle([Species.SNORLAX, Species.BLISSEY]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerField();
|
||||
leadPokemon.forEach(p => expect(p).toBeDefined());
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyField();
|
||||
enemyPokemon.forEach(p => expect(p).toBeDefined());
|
||||
|
||||
vi.spyOn(leadPokemon[0], "getAbility").mockReturnValue(allAbilities[Abilities.SAND_VEIL]);
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import { TerrainType } from "#app/data/terrain.js";
|
||||
import {
|
||||
MoveEndPhase, TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { MoveEndPhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import { PostSummonPhase, TurnEndPhase, } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { applyAbAttrs, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
MoveEffectPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, MoveEffectPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import * as Utils from "#app/utils";
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { applyAbAttrs, applyPostDefendAbAttrs, applyPreAttackAbAttrs, MoveEffectChanceMultiplierAbAttr, MovePowerBoostAbAttr, PostDefendTypeChangeAbAttr } from "#app/data/ability";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
MoveEffectPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, MoveEffectPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import * as Utils from "#app/utils";
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { applyAbAttrs, applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
MoveEffectPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, MoveEffectPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import * as Utils from "#app/utils";
|
||||
|
|
|
@ -2,13 +2,13 @@ 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 GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#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";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Steely Spirit", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import { EnemyPokemon } from "#app/field/pokemon.js";
|
||||
import {
|
||||
DamagePhase,
|
||||
MoveEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { DamagePhase, MoveEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,19 +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 GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#enums/species";
|
||||
import {
|
||||
CommandPhase,
|
||||
MoveEffectPhase,
|
||||
MovePhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { CommandPhase, MoveEffectPhase, MovePhase, TurnEndPhase } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { BattlerIndex } from "#app/battle.js";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Sweet Veil", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -31,11 +26,11 @@ describe("Abilities - Sweet Veil", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.REST]);
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.POWDER, Moves.POWDER, Moves.POWDER, Moves.POWDER]);
|
||||
game.override.battleType("double");
|
||||
game.override.moveset([Moves.SPLASH, Moves.REST]);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset([Moves.POWDER, Moves.POWDER, Moves.POWDER, Moves.POWDER]);
|
||||
});
|
||||
|
||||
it("prevents the user and its allies from falling asleep", async () => {
|
||||
|
@ -50,7 +45,7 @@ describe("Abilities - Sweet Veil", () => {
|
|||
});
|
||||
|
||||
it("causes Rest to fail when used by the user or its allies", async () => {
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
@ -62,7 +57,7 @@ describe("Abilities - Sweet Veil", () => {
|
|||
});
|
||||
|
||||
it("causes Yawn to fail if used on the user or its allies", async () => {
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]);
|
||||
game.override.enemyMoveset([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]);
|
||||
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
||||
|
@ -74,10 +69,10 @@ describe("Abilities - Sweet Veil", () => {
|
|||
});
|
||||
|
||||
it("prevents the user and its allies already drowsy due to Yawn from falling asleep.", async () => {
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.PIKACHU);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]);
|
||||
game.override.enemySpecies(Species.PIKACHU);
|
||||
game.override.enemyLevel(5);
|
||||
game.override.startingLevel(5);
|
||||
game.override.enemyMoveset([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]);
|
||||
|
||||
await game.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]);
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import { Moves } from "#enums/moves";
|
|||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Wind Power", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Wind Rider", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { allAbilities } from "#app/data/ability.js";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { MoveEffectPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Wonder Skin", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
||||
import { QuietFormChangePhase } from "#app/form-change-phase";
|
||||
import {
|
||||
CommandPhase,
|
||||
DamagePhase,
|
||||
EnemyCommandPhase,
|
||||
MessagePhase,
|
||||
PostSummonPhase,
|
||||
SwitchPhase,
|
||||
SwitchSummonPhase,
|
||||
TurnEndPhase,
|
||||
TurnInitPhase,
|
||||
TurnStartPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, DamagePhase, EnemyCommandPhase, MessagePhase, PostSummonPhase, SwitchPhase, SwitchSummonPhase, TurnEndPhase, TurnInitPhase, TurnStartPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier.js";
|
||||
import { Achv, AchvTier, DamageAchv, HealAchv, LevelAchv, ModifierAchv, MoneyAchv, RibbonAchv, achvs } from "#app/system/achv";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { IntegerHolder, NumberHolder } from "#app/utils.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
import { allMoves } from "#app/data/move.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { MoveEffectPhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
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 { MoveEffectPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import { allMoves } from "#app/data/move.js";
|
||||
import {
|
||||
TurnStartPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnStartPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
import {
|
||||
BattleStat,
|
||||
getBattleStatLevelChangeDescription,
|
||||
getBattleStatName,
|
||||
} from "#app/data/battle-stat.js";
|
||||
import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "#app/data/battle-stat.js";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { arrayOfRange, mockI18next } from "./utils/testUtils";
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase, EnemyCommandPhase, SelectTargetPhase,
|
||||
TurnStartPhase
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, EnemyCommandPhase, SelectTargetPhase, TurnStartPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#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";
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
import { allSpecies } from "#app/data/pokemon-species";
|
||||
import { GameModes } from "#app/game-mode";
|
||||
import { getGameMode } from "#app/game-mode.js";
|
||||
import {
|
||||
CommandPhase, DamagePhase,
|
||||
EncounterPhase,
|
||||
EnemyCommandPhase,
|
||||
LoginPhase,
|
||||
SelectGenderPhase,
|
||||
SelectModifierPhase,
|
||||
SelectStarterPhase,
|
||||
SummonPhase,
|
||||
TitlePhase,
|
||||
TurnInitPhase, VictoryPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { generateStarter, getMovePosition, } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, LoginPhase, SelectGenderPhase, SelectModifierPhase, SelectStarterPhase, SummonPhase, TitlePhase, TurnInitPhase, VictoryPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { generateStarter, getMovePosition, } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
import {
|
||||
BattleEndPhase,
|
||||
TurnInitPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition, } from "#app/test/utils/gameManagerUtils";
|
||||
import { BattleEndPhase, TurnInitPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition, } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
||||
|
||||
describe("Test Battle Phase", () => {
|
||||
|
@ -43,8 +40,6 @@ describe("Test Battle Phase", () => {
|
|||
game.doAttack(getMovePosition(game.scene, 1, Moves.SPLASH));
|
||||
|
||||
for (const pokemon of game.scene.getPlayerField()) {
|
||||
expect(pokemon).toBeDefined();
|
||||
|
||||
pokemon.hp = 0;
|
||||
pokemon.status = new Status(StatusEffect.FAINT);
|
||||
expect(pokemon.isFainted()).toBe(true);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import {
|
||||
CommandPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { CommandPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import BattleScene from "../../battle-scene";
|
||||
import { Egg, getLegendaryGachaSpeciesForTimestamp } from "#app/data/egg.js";
|
||||
import { Species } from "#enums/species";
|
||||
|
@ -6,7 +6,7 @@ import Phaser from "phaser";
|
|||
import { EggSourceType } from "#app/enums/egg-source-types.js";
|
||||
import { EggTier } from "#app/enums/egg-type.js";
|
||||
import { VariantTier } from "#app/enums/variant-tiers.js";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import EggData from "#app/system/egg-data.js";
|
||||
import * as Utils from "#app/utils.js";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { pokemonEvolutions } from "#app/data/pokemon-evolutions.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#enums/species";
|
||||
import * as Utils from "#app/utils";
|
||||
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
import { GameMode, GameModes, getGameMode } from "#app/game-mode.js";
|
||||
import {
|
||||
afterEach,
|
||||
beforeAll,
|
||||
beforeEach,
|
||||
describe,
|
||||
expect,
|
||||
it,
|
||||
vi,
|
||||
} from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import GameManager from "./utils/gameManager";
|
||||
import * as Utils from "../utils";
|
||||
describe("game-mode", () => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, expect, it} from "vitest";
|
||||
import {initStatsKeys} from "#app/ui/game-stats-ui-handler";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { initStatsKeys } from "#app/ui/game-stats-ui-handler";
|
||||
|
||||
async function importModule() {
|
||||
try {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, it} from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import pad_xbox360 from "#app/configs/inputs/pad_xbox360";
|
||||
import cfg_keyboard_qwerty from "#app/configs/inputs/cfg_keyboard_qwerty";
|
||||
import InputsHandler from "#app/test/utils/inputsHandler";
|
||||
import InputsHandler from "#test/utils/inputsHandler";
|
||||
|
||||
|
||||
describe("Inputs", () => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat";
|
|||
import { EvolutionStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Species } from "#enums/species";
|
||||
import Phase from "phaser";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { PokemonExpBoosterModifier } from "#app/modifier/modifier.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import Phase from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
|
|
@ -5,10 +5,10 @@ import { BerryType } from "#app/enums/berry-type.js";
|
|||
import { Moves } from "#app/enums/moves.js";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { CommandPhase, MoveEndPhase, SelectTargetPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phase from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000; // 20 seconds
|
||||
|
||||
|
@ -54,11 +54,7 @@ describe("Items - Grip Claw", () => {
|
|||
async () => {
|
||||
await game.startBattle([Species.PANSEAR, Species.ROWLET, Species.PANPOUR, Species.PANSAGE, Species.CHARMANDER, Species.SQUIRTLE]);
|
||||
|
||||
const playerPokemon = game.scene.getPlayerField();
|
||||
playerPokemon.forEach(p => expect(p).toBeDefined());
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyField();
|
||||
enemyPokemon.forEach(p => expect(p).toBeDefined());
|
||||
|
||||
const enemyHeldItemCt = enemyPokemon.map(p => p.getHeldItems.length);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle";
|
|||
import { CritBoosterModifier } from "#app/modifier/modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { MoveEffectPhase, TurnStartPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { DamagePhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
@ -41,10 +41,6 @@ describe("Items - Leftovers", () => {
|
|||
expect(game.scene.modifiers[0].type.id).toBe("LEFTOVERS");
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
// We should have full hp
|
||||
expect(leadPokemon.isFullHp()).toBe(true);
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat";
|
|||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Species } from "#enums/species";
|
||||
import Phase from "phaser";
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat";
|
|||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Species } from "#enums/species";
|
||||
import Phase from "phaser";
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat";
|
|||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Species } from "#enums/species";
|
||||
import Phase from "phaser";
|
||||
|
|
|
@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle";
|
|||
import { CritBoosterModifier } from "#app/modifier/modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { MoveEffectPhase, TurnStartPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Stat } from "#app/data/pokemon-stat";
|
|||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import * as Utils from "#app/utils";
|
||||
import { Species } from "#enums/species";
|
||||
import Phase from "phaser";
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
import { StatusEffect } from "#app/data/status-effect";
|
||||
import {
|
||||
CommandPhase,
|
||||
EnemyCommandPhase,
|
||||
MessagePhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { CommandPhase, EnemyCommandPhase, MessagePhase, TurnEndPhase } from "#app/phases";
|
||||
import i18next, { initI18n } from "#app/plugins/i18n";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
import {beforeAll, describe, expect, it} from "vitest";
|
||||
import {getBattleStatName, getBattleStatLevelChangeDescription} from "#app/data/battle-stat.js";
|
||||
import {BattleStat} from "#app/data/battle-stat.js";
|
||||
import {pokemonInfo as enPokemonInfo} from "#app/locales/en/pokemon-info.js";
|
||||
import {battle as enBattleStat} from "#app/locales/en/battle.js";
|
||||
import {pokemonInfo as dePokemonInfo} from "#app/locales/de/pokemon-info.js";
|
||||
import {battle as deBattleStat} from "#app/locales/de/battle.js";
|
||||
import {pokemonInfo as esPokemonInfo} from "#app/locales/es/pokemon-info.js";
|
||||
import {battle as esBattleStat} from "#app/locales/es/battle.js";
|
||||
import {pokemonInfo as frPokemonInfo} from "#app/locales/fr/pokemon-info.js";
|
||||
import {battle as frBattleStat} from "#app/locales/fr/battle.js";
|
||||
import {pokemonInfo as itPokemonInfo} from "#app/locales/it/pokemon-info.js";
|
||||
import {battle as itBattleStat} from "#app/locales/it/battle.js";
|
||||
import {pokemonInfo as koPokemonInfo} from "#app/locales/ko/pokemon-info.js";
|
||||
import {battle as koBattleStat} from "#app/locales/ko/battle.js";
|
||||
import {pokemonInfo as ptBrPokemonInfo} from "#app/locales/pt_BR/pokemon-info.js";
|
||||
import {battle as ptBrBattleStat} from "#app/locales/pt_BR/battle.js";
|
||||
import {pokemonInfo as zhCnPokemonInfo} from "#app/locales/zh_CN/pokemon-info.js";
|
||||
import {battle as zhCnBattleStat} from "#app/locales/zh_CN/battle.js";
|
||||
import {pokemonInfo as zhTwPokemonInfo} from "#app/locales/zh_TW/pokemon-info.js";
|
||||
import {battle as zhTwBattleStat} from "#app/locales/zh_TW/battle.js";
|
||||
|
||||
import i18next, {initI18n} from "#app/plugins/i18n";
|
||||
import {KoreanPostpositionProcessor} from "i18next-korean-postposition-processor";
|
||||
import { beforeAll, describe, expect, it } from "vitest";
|
||||
import { getBattleStatName, getBattleStatLevelChangeDescription } from "#app/data/battle-stat.js";
|
||||
import { BattleStat} from "#app/data/battle-stat.js";
|
||||
import { pokemonInfo as enPokemonInfo } from "#app/locales/en/pokemon-info.js";
|
||||
import { battle as enBattleStat } from "#app/locales/en/battle.js";
|
||||
import { pokemonInfo as dePokemonInfo } from "#app/locales/de/pokemon-info.js";
|
||||
import { battle as deBattleStat } from "#app/locales/de/battle.js";
|
||||
import { pokemonInfo as esPokemonInfo } from "#app/locales/es/pokemon-info.js";
|
||||
import { battle as esBattleStat } from "#app/locales/es/battle.js";
|
||||
import { pokemonInfo as frPokemonInfo } from "#app/locales/fr/pokemon-info.js";
|
||||
import { battle as frBattleStat } from "#app/locales/fr/battle.js";
|
||||
import { pokemonInfo as itPokemonInfo } from "#app/locales/it/pokemon-info.js";
|
||||
import { battle as itBattleStat } from "#app/locales/it/battle.js";
|
||||
import { pokemonInfo as koPokemonInfo } from "#app/locales/ko/pokemon-info.js";
|
||||
import { battle as koBattleStat } from "#app/locales/ko/battle.js";
|
||||
import { pokemonInfo as ptBrPokemonInfo } from "#app/locales/pt_BR/pokemon-info.js";
|
||||
import { battle as ptBrBattleStat } from "#app/locales/pt_BR/battle.js";
|
||||
import { pokemonInfo as zhCnPokemonInfo } from "#app/locales/zh_CN/pokemon-info.js";
|
||||
import { battle as zhCnBattleStat } from "#app/locales/zh_CN/battle.js";
|
||||
import { pokemonInfo as zhTwPokemonInfo } from "#app/locales/zh_TW/pokemon-info.js";
|
||||
import { battle as zhTwBattleStat } from "#app/locales/zh_TW/battle.js";
|
||||
import i18next, { initI18n } from "#app/plugins/i18n";
|
||||
import { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor";
|
||||
|
||||
interface BattleStatTestUnit {
|
||||
stat: BattleStat,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {afterEach, beforeAll, describe, expect, it} from "vitest";
|
||||
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import {Species} from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#enums/species";
|
||||
import i18next from "i18next";
|
||||
import {initI18n} from "#app/plugins/i18n";
|
||||
import { initI18n } from "#app/plugins/i18n";
|
||||
|
||||
describe("Lokalization - french", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
import { beforeAll, describe, afterEach, expect, it, vi } from "vitest";
|
||||
import {
|
||||
StatusEffect,
|
||||
getStatusEffectActivationText,
|
||||
getStatusEffectDescriptor,
|
||||
getStatusEffectHealText,
|
||||
getStatusEffectObtainText,
|
||||
getStatusEffectOverlapText,
|
||||
} from "#app/data/status-effect";
|
||||
import { StatusEffect, getStatusEffectActivationText, getStatusEffectDescriptor, getStatusEffectHealText, getStatusEffectObtainText, getStatusEffectOverlapText } from "#app/data/status-effect";
|
||||
import i18next from "i18next";
|
||||
import { mockI18next } from "../utils/testUtils";
|
||||
import { mockI18next } from "#test/utils/testUtils";
|
||||
|
||||
const pokemonName = "PKM";
|
||||
const sourceText = "SOURCE";
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { TerrainType, getTerrainName } from "#app/data/terrain";
|
||||
import { getTerrainBlockMessage, getTerrainClearMessage, getTerrainStartMessage } from "#app/data/weather";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#enums/species";
|
||||
import i18next from "i18next";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { mockI18next } from "../utils/testUtils";
|
||||
import { mockI18next } from "#test/utils/testUtils";
|
||||
|
||||
describe("terrain", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -6,8 +6,8 @@ import { Moves } from "#enums/moves";
|
|||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -44,10 +44,8 @@ describe("Moves - Astonish", () => {
|
|||
await game.startBattle([Species.MEOWSCARADA]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.ASTONISH));
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ import { WeatherType } from "#app/data/weather.js";
|
|||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import Pokemon from "#app/field/pokemon.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { NumberHolder } from "#app/utils.js";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { Moves } from "#app/enums/moves.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { MoveEffectPhase } from "#app/phases.js";
|
||||
import { StatusEffect } from "#app/enums/status-effect.js";
|
||||
|
||||
|
@ -27,15 +26,15 @@ describe("Moves - Beat Up", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single");
|
||||
game.override.battleType("single");
|
||||
|
||||
vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.SPLASH));
|
||||
vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
|
||||
vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BEAT_UP]);
|
||||
game.override.startingLevel(100);
|
||||
game.override.moveset([Moves.BEAT_UP]);
|
||||
});
|
||||
|
||||
it(
|
||||
|
@ -82,7 +81,7 @@ describe("Moves - Beat Up", () => {
|
|||
it(
|
||||
"should hit twice for each player Pokemon if the user has Multi-Lens",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
|
||||
game.override.startingHeldItems([{name: "MULTI_LENS", count: 1}]);
|
||||
await game.startBattle([Species.MAGIKARP, Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, Species.PIKACHU, Species.EEVEE]);
|
||||
|
||||
const playerPokemon = game.scene.getPlayerPokemon();
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import overrides from "#app/overrides";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
|
@ -32,10 +29,10 @@ describe("Moves - BELLY DRUM", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP);
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.starterSpecies(Species.MAGIKARP);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([Moves.BELLY_DRUM]);
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
});
|
||||
|
@ -47,7 +44,6 @@ describe("Moves - BELLY DRUM", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.BELLY_DRUM));
|
||||
|
@ -63,7 +59,6 @@ describe("Moves - BELLY DRUM", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
|
||||
// Here - BattleStat.ATK -> -3 and BattleStat.SPATK -> 6
|
||||
|
@ -84,7 +79,6 @@ describe("Moves - BELLY DRUM", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
leadPokemon.summonData.battleStats[BattleStat.ATK] = 6;
|
||||
|
||||
|
@ -101,7 +95,6 @@ describe("Moves - BELLY DRUM", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
leadPokemon.hp = hpLost - PREDAMAGE;
|
||||
|
||||
|
|
|
@ -2,12 +2,9 @@ import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag";
|
|||
import { allMoves } from "#app/data/move";
|
||||
import { Abilities } from "#app/enums/abilities";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
TurnEndPhase
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { MoveEffectPhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
@ -48,11 +45,7 @@ describe("Moves - Ceaseless Edge", () => {
|
|||
async () => {
|
||||
await game.startBattle([ Species.ILLUMISE ]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
const enemyStartingHp = enemyPokemon.hp;
|
||||
|
||||
|
@ -77,11 +70,7 @@ describe("Moves - Ceaseless Edge", () => {
|
|||
game.override.startingHeldItems([{name: "MULTI_LENS"}]);
|
||||
await game.startBattle([ Species.ILLUMISE ]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
const enemyStartingHp = enemyPokemon.hp;
|
||||
|
||||
|
@ -108,12 +97,6 @@ describe("Moves - Ceaseless Edge", () => {
|
|||
|
||||
await game.startBattle([ Species.ILLUMISE ]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.CEASELESS_EDGE));
|
||||
await game.phaseInterceptor.to(MoveEffectPhase, false);
|
||||
// Spikes should not have any layers before move effect is applied
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import overrides from "#app/overrides";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
// RATIO : HP Cost of Move
|
||||
/** HP Cost of Move */
|
||||
const RATIO = 3;
|
||||
// PREDAMAGE : Amount of extra HP lost
|
||||
/** Amount of extra HP lost */
|
||||
const PREDAMAGE = 15;
|
||||
|
||||
describe("Moves - CLANGOROUS_SOUL", () => {
|
||||
|
@ -32,12 +30,12 @@ describe("Moves - CLANGOROUS_SOUL", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP);
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.starterSpecies(Species.MAGIKARP);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([Moves.CLANGOROUS_SOUL]);
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move)
|
||||
|
@ -47,7 +45,6 @@ describe("Moves - CLANGOROUS_SOUL", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.CLANGOROUS_SOUL));
|
||||
|
@ -67,7 +64,6 @@ describe("Moves - CLANGOROUS_SOUL", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
|
||||
//Here - BattleStat.SPD -> 0 and BattleStat.SPDEF -> 4
|
||||
|
@ -93,7 +89,6 @@ describe("Moves - CLANGOROUS_SOUL", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
leadPokemon.summonData.battleStats[BattleStat.ATK] = 6;
|
||||
leadPokemon.summonData.battleStats[BattleStat.DEF] = 6;
|
||||
|
@ -118,7 +113,6 @@ describe("Moves - CLANGOROUS_SOUL", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
leadPokemon.hp = hpLost - PREDAMAGE;
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -4,14 +4,14 @@ import { Species } from "#app/enums/species.js";
|
|||
import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Moves - Dragon Rage", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { BattlerIndex } from "#app/battle";
|
||||
import { allMoves } from "#app/data/move";
|
||||
import { DamagePhase, MoveEffectPhase, TurnStartPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import overrides from "#app/overrides";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
// RATIO : HP Cost of Move
|
||||
/** HP Cost of Move */
|
||||
const RATIO = 2;
|
||||
// PREDAMAGE : Amount of extra HP lost
|
||||
/** Amount of extra HP lost */
|
||||
const PREDAMAGE = 15;
|
||||
|
||||
describe("Moves - FILLET AWAY", () => {
|
||||
|
@ -32,12 +30,12 @@ describe("Moves - FILLET AWAY", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP);
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SNORLAX);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.starterSpecies(Species.MAGIKARP);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([Moves.FILLET_AWAY]);
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move)
|
||||
|
@ -47,7 +45,6 @@ describe("Moves - FILLET AWAY", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.FILLET_AWAY));
|
||||
|
@ -65,7 +62,6 @@ describe("Moves - FILLET AWAY", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
|
||||
//Here - BattleStat.SPD -> 0 and BattleStat.SPATK -> 3
|
||||
|
@ -87,7 +83,6 @@ describe("Moves - FILLET AWAY", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
leadPokemon.summonData.battleStats[BattleStat.ATK] = 6;
|
||||
leadPokemon.summonData.battleStats[BattleStat.SPATK] = 6;
|
||||
|
@ -108,7 +103,6 @@ describe("Moves - FILLET AWAY", () => {
|
|||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||
leadPokemon.hp = hpLost - PREDAMAGE;
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@ import { BattleStat } from "#app/data/battle-stat";
|
|||
import { Species } from "#app/enums/species.js";
|
||||
import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
|
||||
import { DamagePhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Moves - Fissure", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
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 GameManager from "#test/utils/gameManager";
|
||||
import { Species } from "#enums/species";
|
||||
import {
|
||||
SelectTargetPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { SelectTargetPhase, TurnEndPhase } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { allAbilities } from "#app/data/ability.js";
|
||||
import Pokemon from "#app/field/pokemon.js";
|
||||
|
@ -40,14 +36,14 @@ describe("Moves - Flame Burst", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLAME_BURST, Moves.SPLASH]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE);
|
||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4);
|
||||
vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.SHUCKLE);
|
||||
vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(new Array(4).fill(Moves.SPLASH));
|
||||
game.override.battleType("double");
|
||||
game.override.moveset([Moves.FLAME_BURST, Moves.SPLASH]);
|
||||
game.override.disableCrits();
|
||||
game.override.ability(Abilities.UNNERVE);
|
||||
game.override.startingWave(4);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH));
|
||||
});
|
||||
|
||||
it("inflicts damage to the target's ally equal to 1/16 of its max HP", async () => {
|
||||
|
@ -65,7 +61,7 @@ describe("Moves - Flame Burst", () => {
|
|||
});
|
||||
|
||||
it("does not inflict damage to the target's ally if the target was not affected by Flame Burst", async () => {
|
||||
vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FLASH_FIRE);
|
||||
game.override.enemyAbility(Abilities.FLASH_FIRE);
|
||||
|
||||
await game.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
||||
const [ leftEnemy, rightEnemy ] = game.scene.getEnemyField();
|
||||
|
|
|
@ -2,17 +2,15 @@ import { BattleStat } from "#app/data/battle-stat.js";
|
|||
import { SemiInvulnerableTag } from "#app/data/battler-tags.js";
|
||||
import { Type } from "#app/data/type.js";
|
||||
import { Biome } from "#app/enums/biome.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Moves - Flower Shield", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import { BattlerIndex } from "#app/battle.js";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import {
|
||||
CommandPhase,
|
||||
SelectTargetPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, SelectTargetPhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import overrides from "#app/overrides";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Species } from "#enums/species";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
@ -25,16 +24,16 @@ describe("Moves - Fusion Bolt", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ fusionBolt ]);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
game.override.moveset([ fusionBolt ]);
|
||||
game.override.startingLevel(1);
|
||||
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RESHIRAM);
|
||||
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ROUGH_SKIN);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
|
||||
game.override.enemySpecies(Species.RESHIRAM);
|
||||
game.override.enemyAbility(Abilities.ROUGH_SKIN);
|
||||
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
|
||||
|
||||
vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single");
|
||||
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(97);
|
||||
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
game.override.battleType("single");
|
||||
game.override.startingWave(97);
|
||||
game.override.disableCrits();
|
||||
});
|
||||
|
||||
it("should not make contact", async() => {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import overrides from "#app/overrides";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { TurnStartPhase } from "#app/phases";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { StatusEffect } from "#app/data/status-effect";
|
||||
import { Species } from "#enums/species";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
@ -26,15 +25,15 @@ describe("Moves - Fusion Flare", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare ]);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
game.override.moveset([ fusionFlare ]);
|
||||
game.override.startingLevel(1);
|
||||
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RESHIRAM);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]);
|
||||
game.override.enemySpecies(Species.RESHIRAM);
|
||||
game.override.enemyMoveset([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]);
|
||||
|
||||
vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single");
|
||||
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(97);
|
||||
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
game.override.battleType("single");
|
||||
game.override.startingWave(97);
|
||||
game.override.disableCrits();
|
||||
});
|
||||
|
||||
it("should thaw freeze status condition", async() => {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
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 GameManager from "#test/utils/gameManager";
|
||||
import { MoveEffectPhase, MovePhase, MoveEndPhase, TurnStartPhase, DamagePhase } from "#app/phases";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import { allMoves } from "#app/data/move";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
|
@ -29,15 +28,15 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare.id, fusionBolt.id ]);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
game.override.moveset([ fusionFlare.id, fusionBolt.id ]);
|
||||
game.override.startingLevel(1);
|
||||
|
||||
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RESHIRAM);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]);
|
||||
game.override.enemySpecies(Species.RESHIRAM);
|
||||
game.override.enemyMoveset([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]);
|
||||
|
||||
vi.spyOn(overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(97);
|
||||
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
game.override.battleType("double");
|
||||
game.override.startingWave(97);
|
||||
game.override.disableCrits();
|
||||
|
||||
vi.spyOn(fusionFlare, "calculateBattlePower");
|
||||
vi.spyOn(fusionBolt, "calculateBattlePower");
|
||||
|
@ -133,7 +132,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
|||
}, 20000);
|
||||
|
||||
it("FUSION_FLARE should not double power of subsequent FUSION_BOLT if a move succeeded in between", async() => {
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
|
||||
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
|
||||
await game.startBattle([
|
||||
Species.ZEKROM,
|
||||
Species.ZEKROM
|
||||
|
@ -194,7 +193,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
|||
}, 20000);
|
||||
|
||||
it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves", async() => {
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]);
|
||||
game.override.enemyMoveset([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]);
|
||||
await game.startBattle([
|
||||
Species.ZEKROM,
|
||||
Species.ZEKROM
|
||||
|
@ -258,7 +257,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
|||
}, 20000);
|
||||
|
||||
it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves if moves are aimed at allies", async() => {
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]);
|
||||
game.override.enemyMoveset([ fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id ]);
|
||||
await game.startBattle([
|
||||
Species.ZEKROM,
|
||||
Species.ZEKROM
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import { BattlerIndex } from "#app/battle.js";
|
||||
import { Stat } from "#app/data/pokemon-stat.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import {
|
||||
Moves
|
||||
} from "#app/enums/moves.js";
|
||||
import { Moves } from "#app/enums/moves.js";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { MoveResult } from "#app/field/pokemon.js";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { allMoves } from "#app/data/move.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { DamagePhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
EnemyCommandPhase,
|
||||
TurnInitPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, EnemyCommandPhase, TurnInitPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import { allMoves } from "#app/data/move.js";
|
||||
import {
|
||||
MoveEffectPhase
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { MoveEffectPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Moves - Hard Press", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -4,10 +4,10 @@ import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
|||
import { Moves } from "#app/enums/moves.js";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { BerryPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000; // 20 sec timeout for all tests
|
||||
|
||||
|
|
|
@ -3,11 +3,9 @@ import Move, { allMoves } from "#app/data/move.js";
|
|||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import Pokemon from "#app/field/pokemon.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { NumberHolder } from "#app/utils.js";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CommandPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
MoveEndPhase,
|
||||
StatChangePhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { MoveEffectPhase, MoveEndPhase, StatChangePhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ import { getMoveTargets } from "#app/data/move.js";
|
|||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { TurnEndPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Moves } from "#enums/moves";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -73,7 +73,6 @@ async function checkTargetMultiplier(game: GameManager, attackMove: Moves, killA
|
|||
await game.startBattle();
|
||||
|
||||
const playerPokemonRepr = game.scene.getPlayerField();
|
||||
expect(playerPokemonRepr).not.toBeUndefined();
|
||||
|
||||
killAllyAndEnemy(game, killAlly, killSecondEnemy);
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import { TrappedTag } from "#app/data/battler-tags.js";
|
||||
import { CommandPhase, MoveEndPhase, TurnInitPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Moves - Octolock", () => {
|
||||
describe("integration tests", () => {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
||||
import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon.js";
|
||||
import {
|
||||
MoveEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { MoveEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import { BattlerIndex } from "#app/battle.js";
|
||||
import {
|
||||
CommandPhase,
|
||||
SelectTargetPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, SelectTargetPhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -3,11 +3,9 @@ import Move, { allMoves } from "#app/data/move.js";
|
|||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import Pokemon from "#app/field/pokemon.js";
|
||||
import {
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { NumberHolder } from "#app/utils.js";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { allMoves } from "#app/data/move.js";
|
||||
import { CommandPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
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, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Moves - Rollout", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -3,10 +3,10 @@ import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
|||
import { Moves } from "#app/enums/moves.js";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -40,11 +40,7 @@ describe("Moves - Roost", () => {
|
|||
async () => {
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const leadPokemon = game.scene.getPlayerPokemon();
|
||||
expect(leadPokemon).toBeDefined();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
expect(enemyPokemon).toBeDefined();
|
||||
|
||||
const enemyStartingHp = enemyPokemon.hp;
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import {
|
||||
CommandPhase
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { CommandPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
|
|
@ -4,13 +4,13 @@ import { allMoves } from "#app/data/move.js";
|
|||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import { MoveResult, TurnMove } from "#app/field/pokemon.js";
|
||||
import { MovePhase, TurnInitPhase } from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
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, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Moves - Spit Up", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
import { BattlerIndex } from "#app/battle.js";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
SelectTargetPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { CommandPhase, SelectTargetPhase, TurnEndPhase } from "#app/phases";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue