mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-18 14:22:19 +02:00
Adds grip claw and multi lens tests
This commit is contained in:
parent
a97710dc6a
commit
194f352dda
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user