mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-15 12:52:20 +02:00
Further fixes for TurnMove refactor
This commit is contained in:
parent
364e4cdb1b
commit
bfef09ecb3
@ -164,7 +164,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Record a failed move so Abilities like Truant don't trigger next turn and soft-lock
|
// Record a failed move so Abilities like Truant don't trigger next turn and soft-lock
|
||||||
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
|
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL, targets: this.targets });
|
||||||
|
|
||||||
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); // Remove any tags from moves like Fly/Dive/etc.
|
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); // Remove any tags from moves like Fly/Dive/etc.
|
||||||
moveQueue.shift(); // Remove the second turn of charge moves
|
moveQueue.shift(); // Remove the second turn of charge moves
|
||||||
@ -183,7 +183,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
this.cancel();
|
this.cancel();
|
||||||
|
|
||||||
// Record a failed move so Abilities like Truant don't trigger next turn and soft-lock
|
// Record a failed move so Abilities like Truant don't trigger next turn and soft-lock
|
||||||
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
|
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL, targets: [] });
|
||||||
|
|
||||||
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); // Remove any tags from moves like Fly/Dive/etc.
|
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); // Remove any tags from moves like Fly/Dive/etc.
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
game.move.select(Moves.SPIT_UP);
|
game.move.select(Moves.SPIT_UP);
|
||||||
await game.phaseInterceptor.to(TurnInitPhase);
|
await game.phaseInterceptor.to(TurnInitPhase);
|
||||||
|
|
||||||
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SPIT_UP, result: MoveResult.FAIL });
|
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SPIT_UP, result: MoveResult.FAIL, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ] });
|
||||||
|
|
||||||
expect(spitUp.calculateBattlePower).not.toHaveBeenCalled();
|
expect(spitUp.calculateBattlePower).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
@ -148,7 +148,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
|
|
||||||
await game.phaseInterceptor.to(TurnInitPhase);
|
await game.phaseInterceptor.to(TurnInitPhase);
|
||||||
|
|
||||||
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS });
|
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ] });
|
||||||
|
|
||||||
expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce();
|
expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce();
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
game.move.select(Moves.SPIT_UP);
|
game.move.select(Moves.SPIT_UP);
|
||||||
await game.phaseInterceptor.to(TurnInitPhase);
|
await game.phaseInterceptor.to(TurnInitPhase);
|
||||||
|
|
||||||
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS });
|
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS, targets: [ game.scene.getEnemyPokemon()!.getBattlerIndex() ] });
|
||||||
|
|
||||||
expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce();
|
expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce();
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ describe("Moves - Stockpile", () => {
|
|||||||
expect(user.getStatStage(Stat.SPDEF)).toBe(3);
|
expect(user.getStatStage(Stat.SPDEF)).toBe(3);
|
||||||
expect(stockpilingTag).toBeDefined();
|
expect(stockpilingTag).toBeDefined();
|
||||||
expect(stockpilingTag.stockpiledCount).toBe(3);
|
expect(stockpilingTag.stockpiledCount).toBe(3);
|
||||||
expect(user.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ result: MoveResult.FAIL, move: Moves.STOCKPILE });
|
expect(user.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ result: MoveResult.FAIL, move: Moves.STOCKPILE, targets: [ user.getBattlerIndex() ] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -183,7 +183,7 @@ describe("Moves - Swallow", () => {
|
|||||||
|
|
||||||
await game.phaseInterceptor.to(TurnInitPhase);
|
await game.phaseInterceptor.to(TurnInitPhase);
|
||||||
|
|
||||||
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SWALLOW, result: MoveResult.SUCCESS });
|
expect(pokemon.getMoveHistory().at(-1)).toMatchObject<TurnMove>({ move: Moves.SWALLOW, result: MoveResult.SUCCESS, targets: [ pokemon.getBattlerIndex() ] });
|
||||||
|
|
||||||
expect(pokemon.getStatStage(Stat.DEF)).toBe(1);
|
expect(pokemon.getStatStage(Stat.DEF)).toBe(1);
|
||||||
expect(pokemon.getStatStage(Stat.SPDEF)).toBe(-2);
|
expect(pokemon.getStatStage(Stat.SPDEF)).toBe(-2);
|
||||||
|
Loading…
Reference in New Issue
Block a user