mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-09 00:49:27 +02:00
Added TODO tests for roost
This commit is contained in:
parent
0a5f9c2df9
commit
1df4be9b9a
@ -26,8 +26,8 @@ describe("Moves - Roost", () => {
|
|||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.battleStyle("single")
|
.battleStyle("single")
|
||||||
.enemySpecies(SpeciesId.RELICANTH)
|
.enemySpecies(SpeciesId.SHUCKLE)
|
||||||
.ability(AbilityId.TRIAGE)
|
.ability(AbilityId.BALL_FETCH)
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.enemyMoveset(MoveId.SPLASH);
|
.enemyMoveset(MoveId.SPLASH);
|
||||||
@ -68,19 +68,19 @@ describe("Moves - Roost", () => {
|
|||||||
expect(mew.isGrounded()).toBe(true);
|
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]);
|
await game.classicMode.startBattle([SpeciesId.PIDGEOT]);
|
||||||
|
|
||||||
const pidgeot = game.field.getPlayerPokemon();
|
const pidgeot = game.field.getPlayerPokemon();
|
||||||
pidgeot.hp = 1;
|
pidgeot.hp = 1;
|
||||||
pidgeot.teraType = PokemonType.FIGHTING;
|
pidgeot.teraType = PokemonType.FLYING;
|
||||||
|
|
||||||
game.move.use(MoveId.ROOST, BattlerIndex.PLAYER, undefined, true);
|
game.move.use(MoveId.ROOST, BattlerIndex.PLAYER, undefined, true);
|
||||||
await game.toEndOfTurn(false);
|
await game.toEndOfTurn(false);
|
||||||
|
|
||||||
// Should remain flying type
|
// Should remain flying type
|
||||||
expect(pidgeot.getTypes(true)).toEqual([PokemonType.FLYING]);
|
expect(pidgeot).toHaveTypes([PokemonType.FLYING], { args: [true] });
|
||||||
expect(pidgeot.isGrounded()).toBe(true);
|
expect(pidgeot.isGrounded()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should convert pure Flying types into normal types", async () => {
|
it("should convert pure Flying types into normal types", async () => {
|
||||||
@ -128,7 +128,7 @@ describe("Moves - Roost", () => {
|
|||||||
expect(player.isGrounded()).toBe(false);
|
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);
|
game.override.ability(AbilityId.IMPOSTER).enemySpecies(SpeciesId.CORVIKNIGHT);
|
||||||
await game.classicMode.startBattle([SpeciesId.DITTO]);
|
await game.classicMode.startBattle([SpeciesId.DITTO]);
|
||||||
|
|
||||||
@ -139,6 +139,7 @@ describe("Moves - Roost", () => {
|
|||||||
expect(ditto).toHaveTypes([PokemonType.STEEL, PokemonType.FLYING]);
|
expect(ditto).toHaveTypes([PokemonType.STEEL, PokemonType.FLYING]);
|
||||||
|
|
||||||
game.move.use(MoveId.ROOST);
|
game.move.use(MoveId.ROOST);
|
||||||
|
await game.move.forceEnemyMove(MoveId.TRICK_OR_TREAT);
|
||||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||||
await game.phaseInterceptor.to("MoveEffectPhase"); // Roost
|
await game.phaseInterceptor.to("MoveEffectPhase"); // Roost
|
||||||
|
|
||||||
@ -175,22 +176,26 @@ describe("Moves - Roost", () => {
|
|||||||
expect(tornadus).toHaveTypes([PokemonType.STEEL, PokemonType.FLYING, PokemonType.GHOST]);
|
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 () => {
|
it.each<{ name: string; move: MoveId; type: PokemonType }>([
|
||||||
await game.classicMode.startBattle([SpeciesId.MOLTRES]);
|
{ 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();
|
const tornadus = game.field.getPlayerPokemon();
|
||||||
moltres.hp = 1;
|
tornadus.hp = 1;
|
||||||
|
|
||||||
game.move.use(MoveId.ROOST);
|
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);
|
await game.toEndOfTurn(false);
|
||||||
|
|
||||||
expect(moltres).toHaveTypes([PokemonType.FIRE, PokemonType.GHOST]);
|
expect(tornadus).toHaveTypes([PokemonType.NORMAL, type]);
|
||||||
expect(moltres.isGrounded()).toBe(true);
|
expect(tornadus.isGrounded()).toBe(true);
|
||||||
|
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
expect(moltres).toHaveTypes([PokemonType.FIRE, PokemonType.FLYING, PokemonType.GHOST]);
|
expect(tornadus).toHaveTypes([PokemonType.FIRE, PokemonType.FLYING, PokemonType.GHOST]);
|
||||||
expect(moltres.isGrounded()).toBe(false);
|
expect(tornadus.isGrounded()).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user