mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-28 12:32:44 +02:00
[Test] Add ability overrides to Tailwind tests (#5541)
This commit is contained in:
parent
b1d494eadb
commit
b2848af899
@ -1,9 +1,9 @@
|
|||||||
import { Stat } from "#enums/stat";
|
|
||||||
import { ArenaTagSide } from "#app/data/arena-tag";
|
import { ArenaTagSide } from "#app/data/arena-tag";
|
||||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
||||||
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
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 { Stat } from "#enums/stat";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
@ -24,13 +24,16 @@ describe("Moves - Tailwind", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("double");
|
game.override
|
||||||
game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
.battleType("double")
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
.moveset([Moves.TAILWIND, Moves.SPLASH])
|
||||||
|
.enemyMoveset(Moves.SPLASH)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
|
.ability(Abilities.BALL_FETCH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("doubles the Speed stat of the Pokemons on its side", async () => {
|
it("doubles the Speed stat of the Pokemons on its side", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MEOWTH]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.MEOWTH]);
|
||||||
const magikarp = game.scene.getPlayerField()[0];
|
const magikarp = game.scene.getPlayerField()[0];
|
||||||
const meowth = game.scene.getPlayerField()[1];
|
const meowth = game.scene.getPlayerField()[1];
|
||||||
|
|
||||||
@ -43,7 +46,7 @@ describe("Moves - Tailwind", () => {
|
|||||||
game.move.select(Moves.TAILWIND);
|
game.move.select(Moves.TAILWIND);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
|
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
expect(magikarp.getEffectiveStat(Stat.SPD)).toBe(magikarpSpd * 2);
|
expect(magikarp.getEffectiveStat(Stat.SPD)).toBe(magikarpSpd * 2);
|
||||||
expect(meowth.getEffectiveStat(Stat.SPD)).toBe(meowthSpd * 2);
|
expect(meowth.getEffectiveStat(Stat.SPD)).toBe(meowthSpd * 2);
|
||||||
@ -53,7 +56,7 @@ describe("Moves - Tailwind", () => {
|
|||||||
it("lasts for 4 turns", async () => {
|
it("lasts for 4 turns", async () => {
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.TAILWIND);
|
game.move.select(Moves.TAILWIND);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
@ -76,7 +79,7 @@ describe("Moves - Tailwind", () => {
|
|||||||
it("does not affect the opposing side", async () => {
|
it("does not affect the opposing side", async () => {
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const ally = game.scene.getPlayerPokemon()!;
|
const ally = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
@ -91,7 +94,7 @@ describe("Moves - Tailwind", () => {
|
|||||||
|
|
||||||
game.move.select(Moves.TAILWIND);
|
game.move.select(Moves.TAILWIND);
|
||||||
|
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
expect(ally.getEffectiveStat(Stat.SPD)).toBe(allySpd * 2);
|
expect(ally.getEffectiveStat(Stat.SPD)).toBe(allySpd * 2);
|
||||||
expect(enemy.getEffectiveStat(Stat.SPD)).equal(enemySpd);
|
expect(enemy.getEffectiveStat(Stat.SPD)).equal(enemySpd);
|
||||||
|
Loading…
Reference in New Issue
Block a user