[Test] Fix throat chop and gorilla tactics tests (#4140)

This commit is contained in:
Adrian T. 2024-09-10 04:03:29 +08:00 committed by GitHub
parent d9a8448c6e
commit e959595471
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View File

@ -30,7 +30,7 @@ describe("Abilities - Gorilla Tactics", () => {
.enemyMoveset([Moves.SPLASH, Moves.DISABLE])
.enemySpecies(Species.MAGIKARP)
.enemyLevel(30)
.moveset([Moves.SPLASH, Moves.TACKLE])
.moveset([Moves.SPLASH, Moves.TACKLE, Moves.GROWL])
.ability(Abilities.GORILLA_TACTICS);
});
@ -57,22 +57,21 @@ describe("Abilities - Gorilla Tactics", () => {
const darmanitan = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!;
game.move.select(Moves.SPLASH);
// First turn, lock move to Growl
game.move.select(Moves.GROWL);
await game.forceEnemyMove(Moves.SPLASH);
await game.phaseInterceptor.to("TurnEndPhase");
// Turn where Tackle is interrupted by Disable
// Second turn, Growl is interrupted by Disable
await game.toNextTurn();
game.move.select(Moves.SPLASH);
game.move.select(Moves.GROWL);
await game.forceEnemyMove(Moves.DISABLE);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("TurnEndPhase");
expect(enemy.hp).toBe(enemy.getMaxHp());
expect(enemy.getStatStage(Stat.ATK)).toBe(-1); // Only the effect of the first Growl should be applied
// Turn where Struggle is used
// Third turn, Struggle is used
await game.toNextTurn();
game.move.select(Moves.TACKLE);

View File

@ -36,12 +36,14 @@ describe("Moves - Throat Chop", () => {
it("prevents the target from using sound-based moves for two turns", async () => {
await game.classicMode.startBattle([Species.MAGIKARP]);
const enemy = game.scene.getEnemyPokemon()!;
game.move.select(Moves.GROWL);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
// First turn, move is interrupted
await game.phaseInterceptor.to("TurnEndPhase");
expect(game.scene.getPlayerPokemon()?.getStatStage(Stat.ATK)).toBe(0);
expect(enemy.getStatStage(Stat.ATK)).toBe(0);
// Second turn, struggle if no valid moves
await game.toNextTurn();
@ -50,6 +52,6 @@ describe("Moves - Throat Chop", () => {
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to("MoveEndPhase");
expect(game.scene.getEnemyPokemon()!.isFullHp()).toBe(false);
expect(enemy.isFullHp()).toBe(false);
}, TIMEOUT);
});