apply game.override.disableCrits()

This commit is contained in:
Felix Staud 2024-07-25 16:18:47 -07:00
parent a87aec4f27
commit 6d14915f5f
19 changed files with 104 additions and 117 deletions

View File

@ -1,12 +1,11 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { Species } from "#app/enums/species.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { TurnEndPhase } from "#app/phases"; import { TurnEndPhase } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { Species } from "#app/enums/species.js"; 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 "../utils/testUtils";
describe("Abilities - Dry Skin", () => { describe("Abilities - Dry Skin", () => {
@ -26,7 +25,7 @@ describe("Abilities - Dry Skin", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.enemyAbility(Abilities.DRY_SKIN); game.override.enemyAbility(Abilities.DRY_SKIN);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
game.override.enemySpecies(Species.CHARMANDER); game.override.enemySpecies(Species.CHARMANDER);

View File

@ -1,14 +1,13 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { allMoves } from "#app/data/move.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { DamagePhase, MoveEffectPhase } from "#app/phases.js";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import { Stat } from "#app/enums/stat.js"; import { Stat } from "#app/enums/stat.js";
import { allMoves } from "#app/data/move.js"; import { DamagePhase, MoveEffectPhase } from "#app/phases.js";
import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Hustle", () => { describe("Abilities - Hustle", () => {
@ -30,7 +29,7 @@ describe("Abilities - Hustle", () => {
game.override.ability(Abilities.HUSTLE); game.override.ability(Abilities.HUSTLE);
game.override.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]); game.override.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]);
game.override.startingLevel(5); game.override.startingLevel(5);
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.enemyLevel(5); game.override.enemyLevel(5);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);

View File

@ -32,7 +32,7 @@ describe("Abilities - Parental Bond", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.ability(Abilities.PARENTAL_BOND); game.override.ability(Abilities.PARENTAL_BOND);
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);

View File

@ -1,17 +1,16 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { BattleStat } from "#app/data/battle-stat.js";
import Phaser from "phaser"; import { TerrainType } from "#app/data/terrain.js";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { import {
MoveEndPhase, TurnEndPhase, MoveEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import GameManager from "#app/test/utils/gameManager";
import { BattleStat } from "#app/data/battle-stat.js"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { TerrainType } from "#app/data/terrain.js";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
// See also: TypeImmunityAbAttr // See also: TypeImmunityAbAttr
describe("Abilities - Sap Sipper", () => { describe("Abilities - Sap Sipper", () => {
@ -31,7 +30,7 @@ describe("Abilities - Sap Sipper", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
}); });
it("raise attack 1 level and block effects when activated against a grass attack", async() => { it("raise attack 1 level and block effects when activated against a grass attack", async() => {

View File

@ -1,16 +1,15 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { BattleStat } from "#app/data/battle-stat.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import GameManager from "#app/test/utils/gameManager";
import { BattleStat } from "#app/data/battle-stat.js"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
// See also: TypeImmunityAbAttr // See also: TypeImmunityAbAttr
describe("Abilities - Volt Absorb", () => { describe("Abilities - Volt Absorb", () => {
@ -30,7 +29,7 @@ describe("Abilities - Volt Absorb", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
}); });
it("does not activate when CHARGE is used", async () => { it("does not activate when CHARGE is used", async () => {

View File

@ -29,7 +29,7 @@ describe("Items - Leek", () => {
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.battleType("single"); game.override.battleType("single");
}); });

View File

@ -29,7 +29,7 @@ describe("Items - Scope Lens", () => {
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.battleType("single"); game.override.battleType("single");
}, 20000); }, 20000);

View File

@ -1,20 +1,19 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { ArenaTagSide } from "#app/data/arena-tag.js";
import Phaser from "phaser"; import Move, { allMoves } from "#app/data/move.js";
import GameManager from "#app/test/utils/gameManager"; import { WeatherType } from "#app/data/weather.js";
import Overrides from "#app/overrides"; import { Abilities } from "#app/enums/abilities.js";
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
import Pokemon from "#app/field/pokemon.js";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { NumberHolder } from "#app/utils.js";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Abilities } from "#app/enums/abilities.js"; import Phaser from "phaser";
import Pokemon from "#app/field/pokemon.js"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import Move, { allMoves } from "#app/data/move.js";
import { NumberHolder } from "#app/utils.js";
import { ArenaTagSide } from "#app/data/arena-tag.js";
import { WeatherType } from "#app/data/weather.js";
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
describe("Moves - Aurora Veil", () => { describe("Moves - Aurora Veil", () => {
@ -41,7 +40,7 @@ describe("Moves - Aurora Veil", () => {
game.override.enemyLevel(100); game.override.enemyLevel(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]); game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.weather(WeatherType.HAIL); game.override.weather(WeatherType.HAIL);
}); });

View File

@ -1,15 +1,14 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { BattleStat } from "#app/data/battle-stat.js";
import Phaser from "phaser"; import { Abilities } from "#app/enums/abilities.js";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { BattleStat } from "#app/data/battle-stat.js"; import { Moves } from "#enums/moves";
import { Abilities } from "#app/enums/abilities.js"; import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Moves - Double Team", () => { describe("Moves - Double Team", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -29,7 +28,7 @@ describe("Moves - Double Team", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
game.override.moveset([Moves.DOUBLE_TEAM]); game.override.moveset([Moves.DOUBLE_TEAM]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);

View File

@ -36,7 +36,7 @@ describe("Moves - Dragon Rage", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.starterSpecies(Species.SNORLAX); game.override.starterSpecies(Species.SNORLAX);
game.override.moveset([Moves.DRAGON_RAGE]); game.override.moveset([Moves.DRAGON_RAGE]);

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { BattlerIndex } from "#app/battle";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { MoveEffectPhase, DamagePhase, TurnStartPhase } from "#app/phases";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { allMoves } from "#app/data/move"; 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 { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { BattlerIndex } from "#app/battle"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Moves - Dynamax Cannon", () => { describe("Moves - Dynamax Cannon", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -34,7 +33,7 @@ describe("Moves - Dynamax Cannon", () => {
// Note that, for Waves 1-10, the level cap is 10 // Note that, for Waves 1-10, the level cap is 10
game.override.startingWave(1); game.override.startingWave(1);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);

View File

@ -31,7 +31,7 @@ describe("Moves - Fissure", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.starterSpecies(Species.SNORLAX); game.override.starterSpecies(Species.SNORLAX);
game.override.moveset([Moves.FISSURE]); game.override.moveset([Moves.FISSURE]);

View File

@ -27,7 +27,7 @@ describe("Moves - Glaive Rush", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
game.override.enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH)); game.override.enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH));

View File

@ -1,19 +1,18 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { ArenaTagSide } from "#app/data/arena-tag.js";
import Phaser from "phaser"; import Move, { allMoves } from "#app/data/move.js";
import GameManager from "#app/test/utils/gameManager"; import { Abilities } from "#app/enums/abilities.js";
import Overrides from "#app/overrides"; import { ArenaTagType } from "#app/enums/arena-tag-type.js";
import Pokemon from "#app/field/pokemon.js";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { NumberHolder } from "#app/utils.js";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Abilities } from "#app/enums/abilities.js"; import Phaser from "phaser";
import Pokemon from "#app/field/pokemon.js"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import Move, { allMoves } from "#app/data/move.js";
import { NumberHolder } from "#app/utils.js";
import { ArenaTagSide } from "#app/data/arena-tag.js";
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
describe("Moves - Light Screen", () => { describe("Moves - Light Screen", () => {
@ -40,7 +39,7 @@ describe("Moves - Light Screen", () => {
game.override.enemyLevel(100); game.override.enemyLevel(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]); game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
}); });
it("reduces damage of special attacks by half in a single battle", async() => { it("reduces damage of special attacks by half in a single battle", async() => {

View File

@ -1,10 +1,9 @@
import {beforeAll, afterEach, beforeEach, describe, vi, it, expect} from "vitest"; import { CommandPhase, TurnEndPhase } from "#app/phases.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager"; import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides"; import { Moves } from "#enums/moves";
import {Moves} from "#enums/moves"; import { Species } from "#enums/species";
import {Species} from "#enums/species"; import Phaser from "phaser";
import {CommandPhase, TurnEndPhase} from "#app/phases.js"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Magnet Rise", () => { describe("Moves - Magnet Rise", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -27,7 +26,7 @@ describe("Moves - Magnet Rise", () => {
game.override.starterSpecies(Species.MAGNEZONE); game.override.starterSpecies(Species.MAGNEZONE);
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]); game.override.enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.enemyLevel(1); game.override.enemyLevel(1);
game.override.moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]); game.override.moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]);
}); });

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Moves } from "#enums/moves";
import { getMoveTargets } from "#app/data/move.js"; import { getMoveTargets } from "#app/data/move.js";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import { Species } from "#app/enums/species.js"; import { Species } from "#app/enums/species.js";
import { getMovePosition } from "../utils/gameManagerUtils";
import { TurnEndPhase } from "#app/phases.js"; import { TurnEndPhase } from "#app/phases.js";
import GameManager from "#app/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 { SPLASH_ONLY } from "../utils/testUtils";
const TIMEOUT = 20 * 1000; const TIMEOUT = 20 * 1000;
@ -169,7 +168,7 @@ function beforeTrial(phaserGame: Phaser.Game, single: boolean = false) {
game.override.moveset([Moves.EARTHQUAKE, Moves.HYPER_VOICE, Moves.SURF, Moves.SPLASH]); game.override.moveset([Moves.EARTHQUAKE, Moves.HYPER_VOICE, Moves.SURF, Moves.SPLASH]);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.startingLevel(50); game.override.startingLevel(50);
game.override.enemyLevel(40); game.override.enemyLevel(40);
game.override.enemySpecies(Species.EEVEE); game.override.enemySpecies(Species.EEVEE);

View File

@ -1,19 +1,18 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { ArenaTagSide } from "#app/data/arena-tag.js";
import Phaser from "phaser"; import Move, { allMoves } from "#app/data/move.js";
import GameManager from "#app/test/utils/gameManager"; import { Abilities } from "#app/enums/abilities.js";
import Overrides from "#app/overrides"; import { ArenaTagType } from "#app/enums/arena-tag-type.js";
import Pokemon from "#app/field/pokemon.js";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { NumberHolder } from "#app/utils.js";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Abilities } from "#app/enums/abilities.js"; import Phaser from "phaser";
import Pokemon from "#app/field/pokemon.js"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import Move, { allMoves } from "#app/data/move.js";
import { NumberHolder } from "#app/utils.js";
import { ArenaTagSide } from "#app/data/arena-tag.js";
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
describe("Moves - Reflect", () => { describe("Moves - Reflect", () => {
@ -40,7 +39,7 @@ describe("Moves - Reflect", () => {
game.override.enemyLevel(100); game.override.enemyLevel(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]); game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
}); });
it("reduces damage of physical attacks by half in a single battle", async() => { it("reduces damage of physical attacks by half in a single battle", async() => {

View File

@ -1,5 +1,4 @@
import { allMoves } from "#app/data/move.js"; import { allMoves } from "#app/data/move.js";
import Overrides from "#app/overrides";
import { CommandPhase } from "#app/phases"; import { CommandPhase } from "#app/phases";
import GameManager from "#app/test/utils/gameManager"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
@ -26,7 +25,7 @@ describe("Moves - Rollout", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
game.override.battleType("single"); game.override.battleType("single");
game.override.starterSpecies(Species.RATTATA); game.override.starterSpecies(Species.RATTATA);
game.override.ability(Abilities.NONE); game.override.ability(Abilities.NONE);

View File

@ -1,17 +1,16 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { Stat } from "#app/data/pokemon-stat";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { import {
CommandPhase, CommandPhase,
EnemyCommandPhase, TurnEndPhase, EnemyCommandPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import GameManager from "#app/test/utils/gameManager";
import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import {Command} from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import {Stat} from "#app/data/pokemon-stat"; import { Mode } from "#app/ui/ui";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Tackle", () => { describe("Moves - Tackle", () => {
@ -37,7 +36,7 @@ describe("Moves - Tackle", () => {
game.override.startingWave(97); game.override.startingWave(97);
game.override.moveset([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.GROWTH,Moves.GROWTH,Moves.GROWTH,Moves.GROWTH]); game.override.enemyMoveset([Moves.GROWTH,Moves.GROWTH,Moves.GROWTH,Moves.GROWTH]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.disableCrits();
}); });
it("TACKLE against ghost", async() => { it("TACKLE against ghost", async() => {