mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-10 01:19:29 +02:00
Update mirror_move.test.ts
This commit is contained in:
parent
c56ed1d564
commit
adf892bb4e
@ -25,7 +25,6 @@ describe("Moves - Mirror Move", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([MoveId.MIRROR_MOVE, MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.criticalHits(false)
|
||||
@ -34,49 +33,40 @@ describe("Moves - Mirror Move", () => {
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
});
|
||||
|
||||
it("should use the last move that the target used on the user", async () => {
|
||||
game.override.battleStyle("double").enemyMoveset([MoveId.TACKLE, MoveId.GROWL]);
|
||||
it("should use the last move that the target used against any pokemon", async () => {
|
||||
game.override.battleStyle("double");
|
||||
await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]);
|
||||
|
||||
game.move.select(MoveId.MIRROR_MOVE, 0, BattlerIndex.ENEMY); // target's last move is Tackle, enemy should receive damage from Mirror Move copying Tackle
|
||||
game.move.select(MoveId.SPLASH, 1);
|
||||
await game.move.selectEnemyMove(MoveId.TACKLE, BattlerIndex.PLAYER_2);
|
||||
await game.move.selectEnemyMove(MoveId.GROWL, BattlerIndex.PLAYER_2);
|
||||
game.move.use(MoveId.MIRROR_MOVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
|
||||
game.move.use(MoveId.SWORDS_DANCE, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2);
|
||||
await game.move.forceEnemyMove(MoveId.TACKLE, BattlerIndex.PLAYER_2);
|
||||
await game.move.forceEnemyMove(MoveId.SWORDS_DANCE);
|
||||
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER]);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(game.scene.getEnemyField()[0].isFullHp()).toBeFalsy();
|
||||
const [feebas, magikarp] = game.scene.getPlayerField();
|
||||
expect(feebas.getLastXMoves()[0].move).toBe(MoveId.TACKLE);
|
||||
expect(magikarp.getLastXMoves()[0].move).toBe(MoveId.SWORDS_DANCE);
|
||||
});
|
||||
|
||||
it("should apply secondary effects of a move", async () => {
|
||||
game.override.enemyMoveset(MoveId.ACID_SPRAY);
|
||||
it("should apply secondary effects of the called move", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||
|
||||
game.move.select(MoveId.MIRROR_MOVE);
|
||||
game.move.use(MoveId.MIRROR_MOVE);
|
||||
await game.move.forceEnemyMove(MoveId.ACID_SPRAY);
|
||||
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.SPDEF)).toBe(-2);
|
||||
});
|
||||
|
||||
it("should be able to copy status moves", async () => {
|
||||
game.override.enemyMoveset(MoveId.GROWL);
|
||||
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||
|
||||
game.move.select(MoveId.MIRROR_MOVE);
|
||||
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.ATK)).toBe(-1);
|
||||
expect(game.field.getEnemyPokemon().getStatStage(Stat.SPDEF)).toBe(-2);
|
||||
});
|
||||
|
||||
it("should fail if the target has not used any moves", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||
|
||||
game.move.select(MoveId.MIRROR_MOVE);
|
||||
game.move.use(MoveId.MIRROR_MOVE);
|
||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
||||
expect(game.field.getPlayerPokemon().getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user