mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-18 14:22:19 +02:00
Adds parental bond test
This commit is contained in:
parent
dcff60b54c
commit
a97710dc6a
@ -9,6 +9,7 @@ import { StatusEffect } from "#enums/status-effect";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
|
||||
describe("Abilities - Parental Bond", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -426,4 +427,21 @@ describe("Abilities - Parental Bond", () => {
|
||||
// TODO: Update hit count to 1 once Future Sight is fixed to not activate abilities if user is off the field
|
||||
expect(enemyPokemon.damageAndUpdate).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it("should not allow Pollen Puff to heal ally more than once", async () => {
|
||||
game.override.battleType("double").moveset([Moves.POLLEN_PUFF, Moves.ENDURE]);
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.OMANYTE]);
|
||||
|
||||
const [, rightPokemon] = game.scene.getPlayerField();
|
||||
|
||||
rightPokemon.damageAndUpdate(rightPokemon.hp - 1);
|
||||
|
||||
game.move.select(Moves.POLLEN_PUFF, 0, BattlerIndex.PLAYER_2);
|
||||
game.move.select(Moves.ENDURE, 1);
|
||||
|
||||
await game.toNextTurn();
|
||||
|
||||
// Pollen Puff heals with a ratio of 0.5, as long as Pollen Puff triggers only once the pokemon will always be <= (0.5 * Max HP) + 1
|
||||
expect(rightPokemon.hp).toBeLessThanOrEqual(0.5 * rightPokemon.getMaxHp() + 1);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user