apply game.override.startingHeldItems
This commit is contained in:
parent
05a3142c13
commit
4338f7b927
|
@ -339,7 +339,7 @@ describe("Abilities - Parental Bond", () => {
|
||||||
"Moves boosted by this ability and Multi-Lens should strike 4 times",
|
"Moves boosted by this ability and Multi-Lens should strike 4 times",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
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.CHARIZARD]);
|
await game.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ describe("Abilities - Parental Bond", () => {
|
||||||
"Super Fang boosted by this ability and Multi-Lens should strike twice",
|
"Super Fang boosted by this ability and Multi-Lens should strike twice",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.SUPER_FANG]);
|
game.override.moveset([Moves.SUPER_FANG]);
|
||||||
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.CHARIZARD]);
|
await game.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ describe("Abilities - Parental Bond", () => {
|
||||||
"Seismic Toss boosted by this ability and Multi-Lens should strike twice",
|
"Seismic Toss boosted by this ability and Multi-Lens should strike twice",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.SEISMIC_TOSS]);
|
game.override.moveset([Moves.SEISMIC_TOSS]);
|
||||||
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.CHARIZARD]);
|
await game.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ describe("Abilities - Parental Bond", () => {
|
||||||
async () => {
|
async () => {
|
||||||
game.override.battleType("double");
|
game.override.battleType("double");
|
||||||
game.override.moveset([Moves.EARTHQUAKE, Moves.SPLASH]);
|
game.override.moveset([Moves.EARTHQUAKE, Moves.SPLASH]);
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
|
game.override.startingHeldItems([{name: "MULTI_LENS", count: 1}]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]);
|
await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]);
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
import { applyAbAttrs, applyPostDefendAbAttrs, applyPreAttackAbAttrs, MoveEffectChanceMultiplierAbAttr, MovePowerBoostAbAttr, PostDefendTypeChangeAbAttr } from "#app/data/ability";
|
||||||
import Phaser from "phaser";
|
import { Stat } from "#app/data/pokemon-stat";
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import {Abilities} from "#enums/abilities";
|
|
||||||
import {applyAbAttrs ,applyPreAttackAbAttrs,applyPostDefendAbAttrs, MoveEffectChanceMultiplierAbAttr, MovePowerBoostAbAttr, PostDefendTypeChangeAbAttr} from "#app/data/ability";
|
|
||||||
import {Species} from "#enums/species";
|
|
||||||
import {
|
import {
|
||||||
CommandPhase,
|
CommandPhase,
|
||||||
MoveEffectPhase,
|
MoveEffectPhase,
|
||||||
} from "#app/phases";
|
} from "#app/phases";
|
||||||
import {Mode} from "#app/ui/ui";
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
import {Stat} from "#app/data/pokemon-stat";
|
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||||
import {Moves} from "#enums/moves";
|
import { Command } from "#app/ui/command-ui-handler";
|
||||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
import { Mode } from "#app/ui/ui";
|
||||||
import {Command} from "#app/ui/command-ui-handler";
|
|
||||||
import * as Utils from "#app/utils";
|
import * as Utils from "#app/utils";
|
||||||
|
import { Abilities } from "#enums/abilities";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
|
||||||
describe("Abilities - Sheer Force", () => {
|
describe("Abilities - Sheer Force", () => {
|
||||||
|
@ -161,7 +160,7 @@ describe("Abilities - Sheer Force", () => {
|
||||||
it("Sheer Force Disabling Specific Abilities", async() => {
|
it("Sheer Force Disabling Specific Abilities", async() => {
|
||||||
const moveToUse = Moves.CRUSH_CLAW;
|
const moveToUse = Moves.CRUSH_CLAW;
|
||||||
game.override.enemyAbility(Abilities.COLOR_CHANGE);
|
game.override.enemyAbility(Abilities.COLOR_CHANGE);
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "KINGS_ROCK", count: 1}]);
|
game.override.startingHeldItems([{name: "KINGS_ROCK", count: 1}]);
|
||||||
game.override.ability(Abilities.SHEER_FORCE);
|
game.override.ability(Abilities.SHEER_FORCE);
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.PIDGEOT
|
Species.PIDGEOT
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
||||||
import Phase from "phaser";
|
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import { Stat } from "#app/data/pokemon-stat";
|
import { Stat } from "#app/data/pokemon-stat";
|
||||||
import { EvolutionStatBoosterModifier } from "#app/modifier/modifier";
|
import { EvolutionStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import * as Utils from "#app/utils";
|
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Items - Eviolite", () => {
|
describe("Items - Eviolite", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -30,7 +29,7 @@ describe("Items - Eviolite", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("EVIOLITE activates in battle correctly", async() => {
|
it("EVIOLITE activates in battle correctly", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "EVIOLITE" }]);
|
game.override.startingHeldItems([{ name: "EVIOLITE" }]);
|
||||||
const consoleSpy = vi.spyOn(console, "log");
|
const consoleSpy = vi.spyOn(console, "log");
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.PICHU
|
Species.PICHU
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
||||||
import Phase from "phaser";
|
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import { Abilities } from "#app/enums/abilities.js";
|
import { Abilities } from "#app/enums/abilities.js";
|
||||||
import { PokemonExpBoosterModifier } from "#app/modifier/modifier.js";
|
import { PokemonExpBoosterModifier } from "#app/modifier/modifier.js";
|
||||||
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
import * as Utils from "#app/utils";
|
import * as Utils from "#app/utils";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("EXP Modifier Items", () => {
|
describe("EXP Modifier Items", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -29,7 +28,7 @@ describe("EXP Modifier Items", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("EXP booster items stack additively", async() => {
|
it("EXP booster items stack additively", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "LUCKY_EGG"}, {name: "GOLDEN_EGG"}]);
|
game.override.startingHeldItems([{name: "LUCKY_EGG"}, {name: "GOLDEN_EGG"}]);
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerPokemon();
|
const partyMember = game.scene.getPlayerPokemon();
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe("Items - Grip Claw", () => {
|
||||||
|
|
||||||
game.override.battleType("double");
|
game.override.battleType("double");
|
||||||
game.override.moveset([ Moves.POPULATION_BOMB, Moves.SPLASH ]);
|
game.override.moveset([ Moves.POPULATION_BOMB, Moves.SPLASH ]);
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "GRIP_CLAW", count: 5}, {name: "MULTI_LENS", count: 3}]);
|
game.override.startingHeldItems([{name: "GRIP_CLAW", count: 5}, {name: "MULTI_LENS", count: 3}]);
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.ability(Abilities.KLUTZ);
|
game.override.ability(Abilities.KLUTZ);
|
||||||
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
|
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import Phase 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 { CritBoosterModifier } from "#app/modifier/modifier";
|
import { CritBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import * as Utils from "#app/utils";
|
|
||||||
import { MoveEffectPhase, TurnStartPhase } from "#app/phases";
|
import { MoveEffectPhase, TurnStartPhase } from "#app/phases";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Items - Leek", () => {
|
describe("Items - Leek", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -35,7 +34,7 @@ describe("Items - Leek", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("LEEK activates in battle correctly", async() => {
|
it("LEEK activates in battle correctly", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "LEEK" }]);
|
game.override.startingHeldItems([{ name: "LEEK" }]);
|
||||||
game.override.moveset([ Moves.POUND ]);
|
game.override.moveset([ Moves.POUND ]);
|
||||||
const consoleSpy = vi.spyOn(console, "log");
|
const consoleSpy = vi.spyOn(console, "log");
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
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 { DamagePhase, TurnEndPhase } from "#app/phases";
|
import { DamagePhase, TurnEndPhase } from "#app/phases";
|
||||||
|
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 { 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("Items - Leftovers", () => {
|
describe("Items - Leftovers", () => {
|
||||||
|
@ -32,7 +31,7 @@ describe("Items - Leftovers", () => {
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
game.override.enemyAbility(Abilities.UNNERVE);
|
game.override.enemyAbility(Abilities.UNNERVE);
|
||||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||||
vi.spyOn(overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "LEFTOVERS", count: 1}]);
|
game.override.startingHeldItems([{name: "LEFTOVERS", count: 1}]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("leftovers works", async() => {
|
it("leftovers works", async() => {
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
||||||
import Phase from "phaser";
|
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { Stat } from "#app/data/pokemon-stat";
|
import { Stat } from "#app/data/pokemon-stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import * as Utils from "#app/utils";
|
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Items - Light Ball", () => {
|
describe("Items - Light Ball", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -30,7 +29,7 @@ describe("Items - Light Ball", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("LIGHT_BALL activates in battle correctly", async() => {
|
it("LIGHT_BALL activates in battle correctly", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SPECIES_STAT_BOOSTER", type: "LIGHT_BALL" }]);
|
game.override.startingHeldItems([{ name: "SPECIES_STAT_BOOSTER", type: "LIGHT_BALL" }]);
|
||||||
const consoleSpy = vi.spyOn(console, "log");
|
const consoleSpy = vi.spyOn(console, "log");
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.PIKACHU
|
Species.PIKACHU
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
||||||
import Phase from "phaser";
|
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { Stat } from "#app/data/pokemon-stat";
|
import { Stat } from "#app/data/pokemon-stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import * as Utils from "#app/utils";
|
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Items - Metal Powder", () => {
|
describe("Items - Metal Powder", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -30,7 +29,7 @@ describe("Items - Metal Powder", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("METAL_POWDER activates in battle correctly", async() => {
|
it("METAL_POWDER activates in battle correctly", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SPECIES_STAT_BOOSTER", type: "METAL_POWDER" }]);
|
game.override.startingHeldItems([{ name: "SPECIES_STAT_BOOSTER", type: "METAL_POWDER" }]);
|
||||||
const consoleSpy = vi.spyOn(console, "log");
|
const consoleSpy = vi.spyOn(console, "log");
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.DITTO
|
Species.DITTO
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
||||||
import Phase from "phaser";
|
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { Stat } from "#app/data/pokemon-stat";
|
import { Stat } from "#app/data/pokemon-stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import * as Utils from "#app/utils";
|
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Items - Quick Powder", () => {
|
describe("Items - Quick Powder", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -30,7 +29,7 @@ describe("Items - Quick Powder", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("QUICK_POWDER activates in battle correctly", async() => {
|
it("QUICK_POWDER activates in battle correctly", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SPECIES_STAT_BOOSTER", type: "QUICK_POWDER" }]);
|
game.override.startingHeldItems([{ name: "SPECIES_STAT_BOOSTER", type: "QUICK_POWDER" }]);
|
||||||
const consoleSpy = vi.spyOn(console, "log");
|
const consoleSpy = vi.spyOn(console, "log");
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.DITTO
|
Species.DITTO
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import Phase 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 { CritBoosterModifier } from "#app/modifier/modifier";
|
import { CritBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import * as Utils from "#app/utils";
|
|
||||||
import { MoveEffectPhase, TurnStartPhase } from "#app/phases";
|
import { MoveEffectPhase, TurnStartPhase } from "#app/phases";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Items - Scope Lens", () => {
|
describe("Items - Scope Lens", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -35,7 +34,7 @@ describe("Items - Scope Lens", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("SCOPE_LENS activates in battle correctly", async() => {
|
it("SCOPE_LENS activates in battle correctly", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SCOPE_LENS" }]);
|
game.override.startingHeldItems([{ name: "SCOPE_LENS" }]);
|
||||||
game.override.moveset([ Moves.POUND ]);
|
game.override.moveset([ Moves.POUND ]);
|
||||||
const consoleSpy = vi.spyOn(console, "log");
|
const consoleSpy = vi.spyOn(console, "log");
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
||||||
import Phase from "phaser";
|
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { Stat } from "#app/data/pokemon-stat";
|
import { Stat } from "#app/data/pokemon-stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import * as Utils from "#app/utils";
|
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import Phase from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Items - Thick Club", () => {
|
describe("Items - Thick Club", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -30,7 +29,7 @@ describe("Items - Thick Club", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("THICK_CLUB activates in battle correctly", async() => {
|
it("THICK_CLUB activates in battle correctly", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SPECIES_STAT_BOOSTER", type: "THICK_CLUB" }]);
|
game.override.startingHeldItems([{ name: "SPECIES_STAT_BOOSTER", type: "THICK_CLUB" }]);
|
||||||
const consoleSpy = vi.spyOn(console, "log");
|
const consoleSpy = vi.spyOn(console, "log");
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.CUBONE
|
Species.CUBONE
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
import { StatusEffect } from "#app/data/status-effect";
|
||||||
import Phaser from "phaser";
|
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import {
|
import {
|
||||||
CommandPhase,
|
CommandPhase,
|
||||||
EnemyCommandPhase,
|
EnemyCommandPhase,
|
||||||
MessagePhase,
|
MessagePhase,
|
||||||
TurnEndPhase,
|
TurnEndPhase,
|
||||||
} from "#app/phases";
|
} from "#app/phases";
|
||||||
import {Mode} from "#app/ui/ui";
|
import i18next, { initI18n } from "#app/plugins/i18n";
|
||||||
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
import {Command} from "#app/ui/command-ui-handler";
|
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||||
import {StatusEffect} from "#app/data/status-effect";
|
import { Command } from "#app/ui/command-ui-handler";
|
||||||
|
import { Mode } from "#app/ui/ui";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import i18next, { initI18n } from "#app/plugins/i18n";
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
|
||||||
describe("Items - Toxic orb", () => {
|
describe("Items - Toxic orb", () => {
|
||||||
|
@ -43,7 +42,7 @@ describe("Items - Toxic orb", () => {
|
||||||
game.override.startingLevel(2000);
|
game.override.startingLevel(2000);
|
||||||
game.override.moveset([moveToUse]);
|
game.override.moveset([moveToUse]);
|
||||||
game.override.enemyMoveset([oppMoveToUse, oppMoveToUse, oppMoveToUse, oppMoveToUse]);
|
game.override.enemyMoveset([oppMoveToUse, oppMoveToUse, oppMoveToUse, oppMoveToUse]);
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{
|
game.override.startingHeldItems([{
|
||||||
name: "TOXIC_ORB",
|
name: "TOXIC_ORB",
|
||||||
}]);
|
}]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
|
import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag";
|
||||||
import Phaser from "phaser";
|
import { allMoves } from "#app/data/move";
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import Overrides from "#app/overrides";
|
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
||||||
import {
|
import {
|
||||||
MoveEffectPhase,
|
MoveEffectPhase,
|
||||||
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 { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
import Phaser from "phaser";
|
||||||
import { allMoves } from "#app/data/move";
|
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||||
import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag";
|
|
||||||
import { Abilities } from "#app/enums/abilities";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
|
||||||
|
@ -75,7 +74,7 @@ describe("Moves - Ceaseless Edge", () => {
|
||||||
test(
|
test(
|
||||||
"move should hit twice with multi lens and apply two layers of spikes",
|
"move should hit twice with multi lens and apply two layers of spikes",
|
||||||
async () => {
|
async () => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS"}]);
|
game.override.startingHeldItems([{name: "MULTI_LENS"}]);
|
||||||
await game.startBattle([ Species.ILLUMISE ]);
|
await game.startBattle([ Species.ILLUMISE ]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon();
|
const leadPokemon = game.scene.getPlayerPokemon();
|
||||||
|
@ -104,7 +103,7 @@ describe("Moves - Ceaseless Edge", () => {
|
||||||
test(
|
test(
|
||||||
"trainer - move should hit twice, apply two layers of spikes, force switch opponent - opponent takes damage",
|
"trainer - move should hit twice, apply two layers of spikes, force switch opponent - opponent takes damage",
|
||||||
async () => {
|
async () => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS"}]);
|
game.override.startingHeldItems([{name: "MULTI_LENS"}]);
|
||||||
game.override.startingWave(5);
|
game.override.startingWave(5);
|
||||||
|
|
||||||
await game.startBattle([ Species.ILLUMISE ]);
|
await game.startBattle([ Species.ILLUMISE ]);
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { allMoves } from "#app/data/move.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 { DamagePhase, TurnEndPhase } from "#app/phases";
|
import { DamagePhase, TurnEndPhase } from "#app/phases";
|
||||||
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
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 { Abilities } from "#app/enums/abilities.js";
|
import Phaser from "phaser";
|
||||||
import { allMoves } from "#app/data/move.js";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
|
|
||||||
describe("Moves - Glaive Rush", () => {
|
describe("Moves - Glaive Rush", () => {
|
||||||
|
@ -66,7 +65,7 @@ describe("Moves - Glaive Rush", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("interacts properly with multi-lens", async() => {
|
it("interacts properly with multi-lens", async() => {
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 2}]);
|
game.override.startingHeldItems([{name: "MULTI_LENS", count: 2}]);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.AVALANCHE));
|
game.override.enemyMoveset(Array(4).fill(Moves.AVALANCHE));
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
const player = game.scene.getPlayerPokemon();
|
const player = game.scene.getPlayerPokemon();
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { BerryType } from "#app/enums/berry-type";
|
import { BerryType } from "#app/enums/berry-type";
|
||||||
|
import { Button } from "#app/enums/buttons";
|
||||||
import { Moves } from "#app/enums/moves";
|
import { Moves } from "#app/enums/moves";
|
||||||
import { Species } from "#app/enums/species";
|
import { Species } from "#app/enums/species";
|
||||||
import { Button } from "#app/enums/buttons";
|
|
||||||
import Overrides from "#app/overrides";
|
|
||||||
import {
|
import {
|
||||||
BattleEndPhase,
|
BattleEndPhase,
|
||||||
SelectModifierPhase
|
SelectModifierPhase
|
||||||
|
@ -13,7 +12,7 @@ import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { Mode } from "#app/ui/ui";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
import { getMovePosition } from "../utils/gameManagerUtils";
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +35,7 @@ describe("UI - Transfer Items", () => {
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
game.override.startingWave(1);
|
game.override.startingWave(1);
|
||||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([
|
game.override.startingHeldItems([
|
||||||
{ name: "BERRY", count: 1, type: BerryType.SITRUS },
|
{ name: "BERRY", count: 1, type: BerryType.SITRUS },
|
||||||
{ name: "BERRY", count: 2, type: BerryType.APICOT },
|
{ name: "BERRY", count: 2, type: BerryType.APICOT },
|
||||||
{ name: "BERRY", count: 2, type: BerryType.LUM },
|
{ name: "BERRY", count: 2, type: BerryType.LUM },
|
||||||
|
|
Loading…
Reference in New Issue