mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-04 08:58:08 +00:00
* Update Foresight PR to current beta Implements Foresight, Miracle Eye, and Odor Sleuth * Add placeholder i18n strings * Minor tsdoc updates * Fix placement of evasion level modifier, add tests * Add first batch of translations Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> * Second batch of translations Co-authored-by: Enoch <enoch.jwsong@gmail.com> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> * Add Catalan and Japanese translation placeholder strings * Fix issue caused by merge --------- Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Enoch <enoch.jwsong@gmail.com> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com>
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
import Phaser from "phaser";
|
|
import GameManager from "#test/utils/gameManager";
|
|
import { Species } from "#app/enums/species.js";
|
|
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
import { Moves } from "#app/enums/moves.js";
|
|
import { getMovePosition } from "../utils/gameManagerUtils";
|
|
import { MoveEffectPhase } from "#app/phases.js";
|
|
|
|
describe("Internals", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
game.override
|
|
.disableCrits()
|
|
.enemySpecies(Species.UMBREON)
|
|
.enemyMoveset(SPLASH_ONLY)
|
|
.enemyLevel(5)
|
|
.starterSpecies(Species.MAGIKARP)
|
|
.moveset([Moves.MIRACLE_EYE, Moves.CONFUSION]);
|
|
});
|
|
|
|
it("should allow Psychic moves to hit Dark types", async () => {
|
|
await game.startBattle();
|
|
|
|
const enemy = game.scene.getEnemyPokemon();
|
|
|
|
game.doAttack(getMovePosition(game.scene, 0, Moves.CONFUSION));
|
|
await game.toNextTurn();
|
|
expect(enemy.hp).toBe(enemy.getMaxHp());
|
|
|
|
game.doAttack(getMovePosition(game.scene, 0, Moves.MIRACLE_EYE));
|
|
await game.toNextTurn();
|
|
game.doAttack(getMovePosition(game.scene, 0, Moves.CONFUSION));
|
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
|
|
|
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
|
|
});
|
|
});
|