Adds grip claw and multi lens tests

This commit is contained in:
Christopher Schmidt 2025-03-29 11:02:18 -04:00
parent a97710dc6a
commit 194f352dda
2 changed files with 42 additions and 0 deletions

View File

@ -98,6 +98,31 @@ describe("Items - Grip Claw", () => {
expect(enemy1HeldItemCountsAfter).toBe(enemy1HeldItemCount);
expect(enemy2HeldItemCountsAfter).toBe(enemy2HeldItemCount);
});
it("should not allow Pollen Puff to steal items when healing ally", async () => {
game.override
.battleType("double")
.moveset([Moves.POLLEN_PUFF, Moves.ENDURE])
.startingHeldItems([
{ name: "GRIP_CLAW", count: 1 },
{ name: "BERRY", type: BerryType.LUM, count: 1 },
]);
await game.classicMode.startBattle([Species.BULBASAUR, Species.OMANYTE]);
const [leftPokemon, rightPokemon] = game.scene.getPlayerField();
const gripClaw = leftPokemon.getHeldItems()[0] as ContactHeldItemTransferChanceModifier;
vi.spyOn(gripClaw, "chance", "get").mockReturnValue(100);
const heldItemCountBefore = getHeldItemCount(rightPokemon);
game.move.select(Moves.POLLEN_PUFF, 0, BattlerIndex.PLAYER_2);
game.move.select(Moves.ENDURE, 1);
await game.toNextTurn();
expect(getHeldItemCount(rightPokemon)).toBe(heldItemCountBefore);
});
});
/*

View File

@ -211,4 +211,21 @@ describe("Items - Multi Lens", () => {
// TODO: Update hit count to 1 once Future Sight is fixed to not activate held items 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);
});
});