[Test] Fix Gorilla Tactics tests

This commit is contained in:
NightKev 2025-06-24 18:40:15 -07:00
parent 3b490e7ab4
commit ecdaac20fa

View File

@ -28,8 +28,10 @@ describe("Abilities - Gorilla Tactics", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("single") .battleStyle("single")
.criticalHits(false)
.enemyAbility(AbilityId.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemySpecies(SpeciesId.MAGIKARP) .enemySpecies(SpeciesId.MAGIKARP)
.enemyMoveset(MoveId.SPLASH)
.enemyLevel(30) .enemyLevel(30)
.moveset([MoveId.SPLASH, MoveId.TACKLE, MoveId.GROWL, MoveId.METRONOME]) .moveset([MoveId.SPLASH, MoveId.TACKLE, MoveId.GROWL, MoveId.METRONOME])
.ability(AbilityId.GORILLA_TACTICS); .ability(AbilityId.GORILLA_TACTICS);
@ -42,7 +44,6 @@ describe("Abilities - Gorilla Tactics", () => {
const initialAtkStat = darmanitan.getStat(Stat.ATK); const initialAtkStat = darmanitan.getStat(Stat.ATK);
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(MoveId.SPLASH);
await game.toEndOfTurn(); await game.toEndOfTurn();
expect(darmanitan.getStat(Stat.ATK, false)).toBeCloseTo(initialAtkStat * 1.5); expect(darmanitan.getStat(Stat.ATK, false)).toBeCloseTo(initialAtkStat * 1.5);
@ -59,7 +60,6 @@ describe("Abilities - Gorilla Tactics", () => {
// First turn, lock move to Growl // First turn, lock move to Growl
game.move.select(MoveId.GROWL); game.move.select(MoveId.GROWL);
await game.move.forceEnemyMove(MoveId.SPLASH);
await game.toNextTurn(); await game.toNextTurn();
// Second turn, Growl is interrupted by Disable // Second turn, Growl is interrupted by Disable
@ -72,7 +72,7 @@ describe("Abilities - Gorilla Tactics", () => {
// Third turn, Struggle is used // Third turn, Struggle is used
game.move.select(MoveId.TACKLE); game.move.select(MoveId.TACKLE);
await game.move.forceEnemyMove(MoveId.SPLASH); //prevent protect from being used by the enemy await game.move.forceEnemyMove(MoveId.SPLASH); // prevent disable from being used by the enemy
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to("MoveEndPhase"); await game.phaseInterceptor.to("MoveEndPhase");
@ -106,11 +106,13 @@ describe("Abilities - Gorilla Tactics", () => {
const darmanitan = game.field.getPlayerPokemon(); const darmanitan = game.field.getPlayerPokemon();
game.move.select(MoveId.TACKLE); game.move.select(MoveId.TACKLE);
await game.move.selectEnemyMove(MoveId.PROTECT); await game.move.forceEnemyMove(MoveId.PROTECT);
await game.toEndOfTurn(); await game.toEndOfTurn();
expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true); expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true);
expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false); expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false);
const enemy = game.field.getEnemyPokemon();
expect(enemy.hp).toBe(enemy.getMaxHp());
}); });
it("should activate when a move is succesfully executed but misses", async () => { it("should activate when a move is succesfully executed but misses", async () => {
@ -119,7 +121,6 @@ describe("Abilities - Gorilla Tactics", () => {
const darmanitan = game.field.getPlayerPokemon(); const darmanitan = game.field.getPlayerPokemon();
game.move.select(MoveId.TACKLE); game.move.select(MoveId.TACKLE);
await game.move.selectEnemyMove(MoveId.SPLASH);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.move.forceMiss(); await game.move.forceMiss();
await game.toEndOfTurn(); await game.toEndOfTurn();