From a97710dc6a3de51947e2a3ad985fb44cb3df0da3 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Sat, 29 Mar 2025 10:30:36 -0400 Subject: [PATCH] Adds parental bond test --- test/abilities/parental_bond.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/abilities/parental_bond.test.ts b/test/abilities/parental_bond.test.ts index 2aa24e78d6e..d4bf544e8c7 100644 --- a/test/abilities/parental_bond.test.ts +++ b/test/abilities/parental_bond.test.ts @@ -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); + }); });