Added TODO tests for roost

This commit is contained in:
Bertie690 2025-07-30 12:16:01 -04:00
parent 0a5f9c2df9
commit 1df4be9b9a

View File

@ -26,8 +26,8 @@ describe("Moves - Roost", () => {
game = new GameManager(phaserGame);
game.override
.battleStyle("single")
.enemySpecies(SpeciesId.RELICANTH)
.ability(AbilityId.TRIAGE)
.enemySpecies(SpeciesId.SHUCKLE)
.ability(AbilityId.BALL_FETCH)
.startingLevel(100)
.enemyLevel(100)
.enemyMoveset(MoveId.SPLASH);
@ -68,19 +68,19 @@ describe("Moves - Roost", () => {
expect(mew.isGrounded()).toBe(true);
});
it("should not override the user's Tera Type", async () => {
it("should not remove the user's Tera Type", async () => {
await game.classicMode.startBattle([SpeciesId.PIDGEOT]);
const pidgeot = game.field.getPlayerPokemon();
pidgeot.hp = 1;
pidgeot.teraType = PokemonType.FIGHTING;
pidgeot.teraType = PokemonType.FLYING;
game.move.use(MoveId.ROOST, BattlerIndex.PLAYER, undefined, true);
await game.toEndOfTurn(false);
// Should remain flying type
expect(pidgeot.getTypes(true)).toEqual([PokemonType.FLYING]);
expect(pidgeot.isGrounded()).toBe(true);
expect(pidgeot).toHaveTypes([PokemonType.FLYING], { args: [true] });
expect(pidgeot.isGrounded()).toBe(false);
});
it("should convert pure Flying types into normal types", async () => {
@ -128,7 +128,7 @@ describe("Moves - Roost", () => {
expect(player.isGrounded()).toBe(false);
});
it("should consider the user's current types when transforming", async () => {
it("should consider the user's current types when transformed", async () => {
game.override.ability(AbilityId.IMPOSTER).enemySpecies(SpeciesId.CORVIKNIGHT);
await game.classicMode.startBattle([SpeciesId.DITTO]);
@ -139,6 +139,7 @@ describe("Moves - Roost", () => {
expect(ditto).toHaveTypes([PokemonType.STEEL, PokemonType.FLYING]);
game.move.use(MoveId.ROOST);
await game.move.forceEnemyMove(MoveId.TRICK_OR_TREAT);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to("MoveEffectPhase"); // Roost
@ -175,22 +176,26 @@ describe("Moves - Roost", () => {
expect(tornadus).toHaveTypes([PokemonType.STEEL, PokemonType.FLYING, PokemonType.GHOST]);
});
it("should revert to 3 types when affected by Forest's Curse or Trick-or-Treat", async () => {
await game.classicMode.startBattle([SpeciesId.MOLTRES]);
it.each<{ name: string; move: MoveId; type: PokemonType }>([
{ name: "Trick-or-Treat", move: MoveId.TRICK_OR_TREAT, type: PokemonType.GHOST },
{ name: "Forest's Curse", move: MoveId.FORESTS_CURSE, type: PokemonType.GRASS },
])("should ignore added types from $name when changing Flying to Normal type", async ({ move, type }) => {
await game.classicMode.startBattle([SpeciesId.TORNADUS]);
const moltres = game.field.getPlayerPokemon();
moltres.hp = 1;
const tornadus = game.field.getPlayerPokemon();
tornadus.hp = 1;
game.move.use(MoveId.ROOST);
await game.move.forceEnemyMove(MoveId.TRICK_OR_TREAT);
await game.move.forceEnemyMove(move);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toEndOfTurn(false);
expect(moltres).toHaveTypes([PokemonType.FIRE, PokemonType.GHOST]);
expect(moltres.isGrounded()).toBe(true);
expect(tornadus).toHaveTypes([PokemonType.NORMAL, type]);
expect(tornadus.isGrounded()).toBe(true);
await game.toNextTurn();
expect(moltres).toHaveTypes([PokemonType.FIRE, PokemonType.FLYING, PokemonType.GHOST]);
expect(moltres.isGrounded()).toBe(false);
expect(tornadus).toHaveTypes([PokemonType.FIRE, PokemonType.FLYING, PokemonType.GHOST]);
expect(tornadus.isGrounded()).toBe(false);
});
});