mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-24 08:19:33 +02:00
Add test for Serene Grace interaction
This commit is contained in:
parent
9a3bb635a1
commit
6fede7d55c
@ -9,6 +9,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite
|
|||||||
describe("Moves - Triple Arrows", () => {
|
describe("Moves - Triple Arrows", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
let game: GameManager;
|
let game: GameManager;
|
||||||
|
const tripleArrows = allMoves[Moves.TRIPLE_ARROWS];
|
||||||
|
const flinchAttr = tripleArrows.getAttrs(FlinchAttr)[0];
|
||||||
|
const defDropAttr = tripleArrows.getAttrs(StatStageChangeAttr)[0];
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
phaserGame = new Phaser.Game({
|
phaserGame = new Phaser.Game({
|
||||||
@ -27,16 +30,14 @@ describe("Moves - Triple Arrows", () => {
|
|||||||
.moveset([Moves.TRIPLE_ARROWS])
|
.moveset([Moves.TRIPLE_ARROWS])
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.STURDY)
|
||||||
.enemyMoveset(Moves.SPLASH);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
|
vi.spyOn(flinchAttr, "getMoveChance");
|
||||||
|
vi.spyOn(defDropAttr, "getMoveChance");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has a 30% flinch chance and 50% defense drop chance", async () => {
|
it("has a 30% flinch chance and 50% defense drop chance", async () => {
|
||||||
const tripleArrows = allMoves[Moves.TRIPLE_ARROWS];
|
|
||||||
const flinchAttr = tripleArrows.getAttrs(FlinchAttr)[0];
|
|
||||||
const defDropAttr = tripleArrows.getAttrs(StatStageChangeAttr)[0];
|
|
||||||
vi.spyOn(flinchAttr, "getMoveChance");
|
|
||||||
vi.spyOn(defDropAttr, "getMoveChance");
|
|
||||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(Moves.TRIPLE_ARROWS);
|
game.move.select(Moves.TRIPLE_ARROWS);
|
||||||
@ -45,4 +46,15 @@ describe("Moves - Triple Arrows", () => {
|
|||||||
expect(flinchAttr.getMoveChance).toHaveReturnedWith(30);
|
expect(flinchAttr.getMoveChance).toHaveReturnedWith(30);
|
||||||
expect(defDropAttr.getMoveChance).toHaveReturnedWith(50);
|
expect(defDropAttr.getMoveChance).toHaveReturnedWith(50);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("is affected normally by Serene Grace", async () => {
|
||||||
|
game.override.ability(Abilities.SERENE_GRACE);
|
||||||
|
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||||
|
|
||||||
|
game.move.select(Moves.TRIPLE_ARROWS);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
|
expect(flinchAttr.getMoveChance).toHaveReturnedWith(60);
|
||||||
|
expect(defDropAttr.getMoveChance).toHaveReturnedWith(100);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user