mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 09:19:31 +02:00
Final tests before documentation
This commit is contained in:
parent
c1a2b76800
commit
542ac83dfd
@ -4,8 +4,9 @@ import { Abilities } from "#enums/abilities";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { MoveResult } from "#app/field/pokemon";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
|
||||
describe("Moves - Aroma Veil", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -23,32 +24,39 @@ describe("Moves - Aroma Veil", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleType("double")
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset([Moves.TAUNT, Moves.SPLASH])
|
||||
.enemyMoveset([Moves.HEAL_BLOCK, Moves.IMPRISON, Moves.SPLASH])
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.ability(Abilities.AROMA_VEIL)
|
||||
.moveset([Moves.GROWL]);
|
||||
});
|
||||
|
||||
it("Pokemon should not be able to use the same move consecutively", async () => {
|
||||
await game.classicMode.startBattle([Species.REGIELEKI]);
|
||||
it("Aroma Veil protects the Pokemon's side against most Move Restriction Battler Tags", async () => {
|
||||
await game.classicMode.startBattle([Species.REGIELEKI, Species.BULBASAUR]);
|
||||
|
||||
const playerPokemon = game.scene.getPlayerPokemon();
|
||||
const playerPokemon = game.scene.getParty()!;
|
||||
|
||||
// First turn, Player Pokemon fails usin
|
||||
game.move.select(Moves.GROWL);
|
||||
await game.forceEnemyMove(Moves.TAUNT);
|
||||
game.move.select(Moves.GROWL);
|
||||
await game.forceEnemyMove(Moves.HEAL_BLOCK);
|
||||
await game.toNextTurn();
|
||||
const move1 = playerPokemon?.getLastXMoves(1)[0]!;
|
||||
expect(move1.move).toBe(Moves.GROWL);
|
||||
expect(move1.result).toBe(MoveResult.SUCCESS);
|
||||
expect(playerPokemon?.getTag(BattlerTagType.TAUNT)).toBeDefined();
|
||||
expect(playerPokemon[0].getTag(BattlerTagType.HEAL_BLOCK)).toBeUndefined();
|
||||
expect(playerPokemon[1].getTag(BattlerTagType.HEAL_BLOCK)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("Aroma Veil does not protect against Imprison", async () => {
|
||||
await game.classicMode.startBattle([Species.REGIELEKI, Species.BULBASAUR]);
|
||||
|
||||
const playerPokemon = game.scene.getParty()!;
|
||||
|
||||
// Second turn, Taunt forces Struggle to occur
|
||||
game.move.select(Moves.GROWL);
|
||||
game.move.select(Moves.GROWL);
|
||||
await game.forceEnemyMove(Moves.IMPRISON, BattlerIndex.PLAYER);
|
||||
await game.forceEnemyMove(Moves.SPLASH);
|
||||
await game.toNextTurn();
|
||||
const move2 = playerPokemon?.getLastXMoves(1)[0]!;
|
||||
expect(move2.move).toBe(Moves.STRUGGLE);
|
||||
expect(game.scene.arena.getTag(ArenaTagType.IMPRISON)).toBeDefined();
|
||||
expect(playerPokemon[0].getTag(BattlerTagType.IMPRISON)).toBeDefined();
|
||||
expect(playerPokemon[1].getTag(BattlerTagType.IMPRISON)).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
@ -55,7 +55,6 @@ describe("Moves - Imprison", () => {
|
||||
});
|
||||
|
||||
it("Imprison applies to Pokemon switched into Battle", async () => {
|
||||
game.override.battleType("single");
|
||||
await game.classicMode.startBattle([Species.REGIELEKI, Species.BULBASAUR]);
|
||||
|
||||
const playerPokemon1 = game.scene.getPlayerPokemon();
|
||||
@ -79,14 +78,13 @@ describe("Moves - Imprison", () => {
|
||||
});
|
||||
|
||||
it("The effects of Imprison only end when the source is no longer active", async () => {
|
||||
game.override.battleType("single");
|
||||
game.override.moveset([Moves.SPLASH, Moves.IMPRISON]);
|
||||
await game.classicMode.startBattle([Species.REGIELEKI, Species.BULBASAUR]);
|
||||
|
||||
const playerPokemon = game.scene.getPlayerPokemon();
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
game.move.select(Moves.IMPRISON);
|
||||
await game.forceEnemyMove(Moves.IMPRISON);
|
||||
await game.forceEnemyMove(Moves.GROWL);
|
||||
await game.toNextTurn();
|
||||
expect(game.scene.arena.getTag(ArenaTagType.IMPRISON)).toBeDefined();
|
||||
expect(enemyPokemon!.getTag(BattlerTagType.IMPRISON)).toBeDefined();
|
||||
@ -94,6 +92,7 @@ describe("Moves - Imprison", () => {
|
||||
await game.forceEnemyMove(Moves.SPLASH);
|
||||
await game.toNextTurn();
|
||||
expect(playerPokemon?.isActive(true)).toBeFalsy();
|
||||
expect(game.scene.arena.getTag(ArenaTagType.IMPRISON)).toBeUndefined();
|
||||
expect(enemyPokemon!.getTag(BattlerTagType.IMPRISON)).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
@ -35,7 +35,7 @@ describe("Moves - Taunt", () => {
|
||||
|
||||
const playerPokemon = game.scene.getPlayerPokemon();
|
||||
|
||||
// First turn, Player Pokemon succeeds using Growl without Torment
|
||||
// First turn, Player Pokemon succeeds using Growl without Taunt
|
||||
game.move.select(Moves.GROWL);
|
||||
await game.forceEnemyMove(Moves.TAUNT);
|
||||
await game.toNextTurn();
|
||||
|
Loading…
Reference in New Issue
Block a user