apply game.override.enemyLevel
This commit is contained in:
parent
a9031a3215
commit
5350f3a9f5
|
@ -1,13 +1,12 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
||||
import { QuietFormChangePhase } from "#app/form-change-phase.js";
|
||||
import { TurnEndPhase } from "#app/phases.js";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Species } from "#enums/species";
|
||||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
||||
import { TurnEndPhase } from "#app/phases.js";
|
||||
import { QuietFormChangePhase } from "#app/form-change-phase.js";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -73,7 +72,7 @@ describe("Abilities - DISGUISE", () => {
|
|||
|
||||
game.override.enemyMoveset([Moves.DARK_PULSE, Moves.DARK_PULSE, Moves.DARK_PULSE, Moves.DARK_PULSE]);
|
||||
game.override.startingLevel(20);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(20);
|
||||
game.override.enemyLevel(20);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.starterForms({
|
||||
[Species.MIMIKYU]: baseForm,
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Abilities - Hustle", () => {
|
|||
game.override.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]);
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
game.override.enemyLevel(5);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
|
@ -81,7 +81,7 @@ describe("Abilities - Hustle", () => {
|
|||
|
||||
it("does not affect OHKO moves", async () => {
|
||||
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(30);
|
||||
game.override.enemyLevel(30);
|
||||
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
const pikachu = game.scene.getPlayerPokemon();
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { QuietFormChangePhase } from "#app/form-change-phase";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
MoveEndPhase,
|
||||
TurnEndPhase,
|
||||
TurnInitPhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { QuietFormChangePhase } from "#app/form-change-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Abilities - Ice Face", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -55,7 +54,7 @@ describe("Abilities - Ice Face", () => {
|
|||
|
||||
it("takes no damage from the first hit of multihit physical move and transforms to Noice", async () => {
|
||||
game.override.moveset([Moves.SURGING_STRIKES]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
game.override.enemyLevel(1);
|
||||
await game.startBattle([Species.HITMONLEE]);
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SURGING_STRIKES));
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("Abilities - Parental Bond", () => {
|
|||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
});
|
||||
|
||||
test(
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Species } from "#enums/species";
|
||||
import { FaintPhase } from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
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 { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
|
||||
describe("Abilities - Quick Draw", () => {
|
||||
|
@ -31,7 +30,7 @@ describe("Abilities - Quick Draw", () => {
|
|||
game.override.ability(Abilities.QUICK_DRAW);
|
||||
game.override.moveset([Moves.TACKLE, Moves.TAIL_WHIP]);
|
||||
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
import { BattleStatMultiplierAbAttr, allAbilities } from "#app/data/ability.js";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import { WeatherType } from "#app/data/weather.js";
|
||||
import { CommandPhase, MoveEffectPhase, MoveEndPhase } from "#app/phases.js";
|
||||
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, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { CommandPhase, MoveEffectPhase, MoveEndPhase } from "#app/phases.js";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import { WeatherType } from "#app/data/weather.js";
|
||||
import { BattleStatMultiplierAbAttr, allAbilities } from "#app/data/ability.js";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -34,7 +33,7 @@ describe("Abilities - Sand Veil", () => {
|
|||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override
|
||||
.weather(WeatherType.SANDSTORM)
|
||||
.battleType("double");
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { EnemyPokemon } from "#app/field/pokemon.js";
|
||||
import {
|
||||
DamagePhase,
|
||||
MoveEndPhase,
|
||||
} 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 { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { EnemyPokemon } from "#app/field/pokemon.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -37,7 +36,7 @@ describe("Abilities - Sturdy", () => {
|
|||
game.override.moveset([Moves.CLOSE_COMBAT, Moves.FISSURE]);
|
||||
|
||||
game.override.enemySpecies(Species.ARON);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
game.override.enemyLevel(5);
|
||||
game.override.enemyAbility(Abilities.STURDY);
|
||||
});
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Abilities - Unseen Fist", () => {
|
|||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
});
|
||||
|
||||
test(
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import {
|
||||
MoveEffectPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
describe("Arena - Gravity", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -59,7 +58,7 @@ describe("Arena - Gravity", () => {
|
|||
|
||||
it("OHKO move accuracy is not affected", async () => {
|
||||
game.override.startingLevel(5);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);
|
||||
game.override.enemyLevel(5);
|
||||
|
||||
/** See Fissure {@link https://bulbapedia.bulbagarden.net/wiki/Fissure_(move)} */
|
||||
const moveToCheck = allMoves[Moves.FISSURE];
|
||||
|
|
|
@ -41,7 +41,7 @@ describe("Items - Grip Claw", () => {
|
|||
{name: "BERRY", type: BerryType.LUM, count: 2}
|
||||
]);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
|
||||
vi.spyOn(allMoves[Moves.POPULATION_BOMB], "accuracy", "get").mockReturnValue(100);
|
||||
});
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import { allMoves } from "#app/data/move.js";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import { BerryPhase, CommandPhase, MoveEndPhase, TurnEndPhase } from "#app/phases.js";
|
||||
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, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { BerryPhase, CommandPhase, MoveEndPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import { allMoves } from "#app/data/move.js";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -34,7 +33,7 @@ describe("Moves - Astonish", () => {
|
|||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
|
||||
vi.spyOn(allMoves[Moves.ASTONISH], "chance", "get").mockReturnValue(100);
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("Moves - Aurora Veil", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.NONE);
|
||||
game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
|
|
|
@ -37,7 +37,7 @@ describe("Moves - Ceaseless Edge", () => {
|
|||
game.override.enemyAbility(Abilities.RUN_AWAY);
|
||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.RUN_AWAY);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([ Moves.CEASELESS_EDGE, Moves.SPLASH, Moves.ROAR ]);
|
||||
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
||||
vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100);
|
||||
|
|
|
@ -48,7 +48,7 @@ describe("Moves - Dragon Rage", () => {
|
|||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
});
|
||||
|
||||
it("should return 100 power against an enemy below level cap", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
game.override.enemyLevel(1);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
@ -57,7 +57,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should return 100 power against an enemy at level cap", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(10);
|
||||
game.override.enemyLevel(10);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
@ -71,7 +71,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should return 120 power against an enemy 1% above level cap", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(101);
|
||||
game.override.enemyLevel(101);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
@ -88,7 +88,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should return 140 power against an enemy 2% above level capp", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(102);
|
||||
game.override.enemyLevel(102);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
@ -105,7 +105,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should return 160 power against an enemy 3% above level cap", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(103);
|
||||
game.override.enemyLevel(103);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
@ -122,7 +122,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should return 180 power against an enemy 4% above level cap", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(104);
|
||||
game.override.enemyLevel(104);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
@ -139,7 +139,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should return 200 power against an enemy 5% above level cap", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(105);
|
||||
game.override.enemyLevel(105);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
@ -156,7 +156,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should return 200 power against an enemy way above level cap", async() => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(999);
|
||||
game.override.enemyLevel(999);
|
||||
await game.startBattle([
|
||||
Species.ETERNATUS,
|
||||
]);
|
||||
|
|
|
@ -41,7 +41,7 @@ describe("Moves - Fissure", () => {
|
|||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ describe("Moves - Flower Shield", () => {
|
|||
it("does not increase defense of a pokemon in semi-vulnerable state", async () => {
|
||||
game.override.enemySpecies(Species.PARAS);
|
||||
game.override.enemyMoveset([Moves.DIG, Moves.DIG, Moves.DIG, Moves.DIG]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(50);
|
||||
game.override.enemyLevel(50);
|
||||
|
||||
await game.startBattle([Species.CHERRIM]);
|
||||
const paras = game.scene.getEnemyPokemon();
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
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 {Stat} from "#app/data/pokemon-stat";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
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 { BattlerIndex } from "#app/battle.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -36,7 +35,7 @@ describe("Moves - Follow Me", () => {
|
|||
game.override.starterSpecies(Species.AMOONGUSS);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
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 Overrides from "#app/overrides";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { BattlerIndex } from "#app/battle.js";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { MoveResult } from "#app/field/pokemon.js";
|
||||
import { Stat } from "#app/data/pokemon-stat.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";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
@ -32,7 +31,7 @@ describe("Moves - Gastro Acid", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
game.override.startingLevel(1);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.ability(Abilities.NONE);
|
||||
game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
|
||||
game.override.enemySpecies(Species.BIDOOF);
|
||||
|
|
|
@ -37,7 +37,7 @@ describe("Moves - Light Screen", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.NONE);
|
||||
game.override.moveset([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
|
|
|
@ -28,7 +28,7 @@ describe("Moves - Magnet Rise", () => {
|
|||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1);
|
||||
game.override.enemyLevel(1);
|
||||
game.override.moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import {
|
||||
CommandPhase,
|
||||
MoveEndPhase,
|
||||
StatChangePhase,
|
||||
} from "#app/phases";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattleStat } from "#app/data/battle-stat.js";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
@ -38,7 +37,7 @@ describe("Moves - Make It Rain", () => {
|
|||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
});
|
||||
|
||||
it("should only reduce Sp. Atk. once in a double battle", async () => {
|
||||
|
@ -63,7 +62,7 @@ describe("Moves - Make It Rain", () => {
|
|||
}, TIMEOUT);
|
||||
|
||||
it("should apply effects even if the target faints", async () => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1); // ensures the enemy will faint
|
||||
game.override.enemyLevel(1); // ensures the enemy will faint
|
||||
game.override.battleType("single");
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
@ -83,7 +82,7 @@ describe("Moves - Make It Rain", () => {
|
|||
}, TIMEOUT);
|
||||
|
||||
it("should reduce Sp. Atk. once after KOing two enemies", async () => {
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1); // ensures the enemy will faint
|
||||
game.override.enemyLevel(1); // ensures the enemy will faint
|
||||
|
||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ function beforeTrial(phaserGame: Phaser.Game, single: boolean = false) {
|
|||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
game.override.startingLevel(50);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(40);
|
||||
game.override.enemyLevel(40);
|
||||
game.override.enemySpecies(Species.EEVEE);
|
||||
return game;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
||||
import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon.js";
|
||||
import {
|
||||
MoveEndPhase,
|
||||
} 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 { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon.js";
|
||||
import { Status, StatusEffect } from "#app/data/status-effect.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -36,7 +35,7 @@ describe("Moves - Purify", () => {
|
|||
game.override.moveset([Moves.PURIFY, Moves.SIZZLY_SLIDE]);
|
||||
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(10);
|
||||
game.override.enemyLevel(10);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattlerIndex } from "#app/battle.js";
|
||||
import {
|
||||
CommandPhase,
|
||||
SelectTargetPhase,
|
||||
TurnEndPhase,
|
||||
} 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 { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattlerIndex } from "#app/battle.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -35,7 +34,7 @@ describe("Moves - Rage Powder", () => {
|
|||
game.override.starterSpecies(Species.AMOONGUSS);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -37,7 +37,7 @@ describe("Moves - Reflect", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.ability(Abilities.NONE);
|
||||
game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Moves - Rollout", () => {
|
|||
game.override.enemySpecies(Species.BIDOOF);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Species } from "#app/enums/species.js";
|
||||
import { Moves } from "#app/enums/moves.js";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
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 Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -31,7 +30,7 @@ describe("Moves - Roost", () => {
|
|||
game.override.enemySpecies(Species.STARAPTOR);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([ Moves.STOMPING_TANTRUM ]);
|
||||
game.override.enemyMoveset([Moves.ROOST,Moves.ROOST,Moves.ROOST,Moves.ROOST]);
|
||||
});
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Moves - Spit Up", () => {
|
|||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
|
||||
game.override.enemyLevel(2000);
|
||||
|
||||
game.override.moveset([Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP]);
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattlerIndex } from "#app/battle.js";
|
||||
import { Stat } from "#app/data/pokemon-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
SelectTargetPhase,
|
||||
TurnEndPhase,
|
||||
} from "#app/phases";
|
||||
import {Stat} from "#app/data/pokemon-stat";
|
||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
||||
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 { BattlerIndex } from "#app/battle.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -35,7 +34,7 @@ describe("Moves - Spotlight", () => {
|
|||
game.override.starterSpecies(Species.AMOONGUSS);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -32,7 +32,7 @@ describe("Moves - Swallow", () => {
|
|||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
|
||||
game.override.enemyLevel(2000);
|
||||
|
||||
game.override.moveset([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]);
|
||||
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import {
|
||||
BerryPhase,
|
||||
MoveEffectPhase
|
||||
} 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 { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type.js";
|
||||
import { Abilities } from "#app/enums/abilities.js";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
|
@ -33,7 +32,7 @@ describe("Moves - Thousand Arrows", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.TOGETIC);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([ Moves.THOUSAND_ARROWS ]);
|
||||
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue