mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 13:59:27 +02:00
Adds unit test for ally targeting with Aromatic Mist
This commit is contained in:
parent
3206fa8e65
commit
3c209f32b1
@ -1,5 +1,6 @@
|
|||||||
import { SemiInvulnerableTag } from "#app/data/battler-tags";
|
import { SemiInvulnerableTag } from "#app/data/battler-tags";
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
|
import { Stat } from "#app/enums/stat";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
@ -23,9 +24,10 @@ describe("Moves - Metronome", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.moveset([Moves.METRONOME])
|
.moveset([Moves.METRONOME, Moves.SPLASH])
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
|
.starterSpecies(Species.REGIELEKI)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.enemySpecies(Species.SHUCKLE)
|
.enemySpecies(Species.SHUCKLE)
|
||||||
.enemyMoveset(Moves.SPLASH)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
@ -33,7 +35,7 @@ describe("Moves - Metronome", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should have one semi-invulnerable turn and deal damage on the second turn when a semi-invulnerable move is called", async () => {
|
it("should have one semi-invulnerable turn and deal damage on the second turn when a semi-invulnerable move is called", async () => {
|
||||||
await game.classicMode.startBattle([Species.REGIELEKI]);
|
await game.classicMode.startBattle();
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
vi.spyOn(player, "randSeedInt").mockReturnValue(Moves.DIVE);
|
vi.spyOn(player, "randSeedInt").mockReturnValue(Moves.DIVE);
|
||||||
@ -51,7 +53,7 @@ describe("Moves - Metronome", () => {
|
|||||||
|
|
||||||
// THESE FAIL UNTIL KEV'S MOVE PHASE REFACTOR IS PUT IN
|
// THESE FAIL UNTIL KEV'S MOVE PHASE REFACTOR IS PUT IN
|
||||||
// it("should apply secondary effects of a move", async () => {
|
// it("should apply secondary effects of a move", async () => {
|
||||||
// await game.classicMode.startBattle([Species.REGIELEKI]);
|
// await game.classicMode.startBattle();
|
||||||
// const player = game.scene.getPlayerPokemon()!;
|
// const player = game.scene.getPlayerPokemon()!;
|
||||||
// vi.spyOn(player, "randSeedInt").mockReturnValue(Moves.WOOD_HAMMER);
|
// vi.spyOn(player, "randSeedInt").mockReturnValue(Moves.WOOD_HAMMER);
|
||||||
|
|
||||||
@ -64,7 +66,7 @@ describe("Moves - Metronome", () => {
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
// it("should recharge after using recharge move", async () => {
|
// it("should recharge after using recharge move", async () => {
|
||||||
// await game.classicMode.startBattle([Species.REGIELEKI]);
|
// await game.classicMode.startBattle();
|
||||||
// const player = game.scene.getPlayerPokemon()!;
|
// const player = game.scene.getPlayerPokemon()!;
|
||||||
// vi.spyOn(player, "randSeedInt").mockReturnValue(Moves.HYPER_BEAM);
|
// vi.spyOn(player, "randSeedInt").mockReturnValue(Moves.HYPER_BEAM);
|
||||||
|
|
||||||
@ -75,4 +77,22 @@ describe("Moves - Metronome", () => {
|
|||||||
|
|
||||||
// expect(player.getTag(RechargingTag)).toBeTruthy();
|
// expect(player.getTag(RechargingTag)).toBeTruthy();
|
||||||
// })
|
// })
|
||||||
|
|
||||||
|
it("should only target ally for Aromatic Mist", async () => {
|
||||||
|
game.override.battleType("double");
|
||||||
|
await game.classicMode.startBattle([Species.REGIELEKI, Species.RATTATA]);
|
||||||
|
const [ leftPlayer, rightPlayer ] = game.scene.getPlayerField();
|
||||||
|
const [ leftOpp, rightOpp ] = game.scene.getEnemyField();
|
||||||
|
vi.spyOn(leftPlayer, "randSeedInt").mockReturnValue(Moves.AROMATIC_MIST);
|
||||||
|
|
||||||
|
game.move.select(Moves.METRONOME);
|
||||||
|
game.move.select(Moves.SPLASH, 1);
|
||||||
|
await game.phaseInterceptor.to("MoveEffectPhase");
|
||||||
|
await game.move.forceHit();
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
|
expect(rightPlayer.getStatStage(Stat.SPDEF)).toBe(1);
|
||||||
|
expect(leftOpp.getStatStage(Stat.SPDEF)).toBe(0);
|
||||||
|
expect(rightOpp.getStatStage(Stat.SPDEF)).toBe(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user