Apply small fixes from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Tiago Rodrigues 2025-06-06 13:09:36 +01:00 committed by GitHub
parent c75ced6c12
commit 1d8f06b240
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View File

@ -1698,8 +1698,7 @@ export class GorillaTacticsAbAttr extends ExecutedMoveAbAttr {
}
override canApplyExecutedMove(pokemon: Pokemon, simulated: boolean): boolean {
return super.canApplyExecutedMove(pokemon, simulated) &&
simulated || !pokemon.getTag(BattlerTagType.GORILLA_TACTICS);
return simulated || !pokemon.getTag(BattlerTagType.GORILLA_TACTICS);
}
override applyExecutedMove(pokemon: Pokemon, simulated: boolean): void {

View File

@ -73,7 +73,7 @@ describe("Abilities - Gorilla Tactics", () => {
await game.toNextTurn();
game.move.select(MoveId.TACKLE);
await game.selectTarget(MoveId.SPLASH); //prevent protect from being used by the enemy
await game.move.forceEnemyMove(MoveId.SPLASH); //prevent protect from being used by the enemy
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to("MoveEndPhase");
@ -83,12 +83,12 @@ describe("Abilities - Gorilla Tactics", () => {
it("should activate when the opponenet protects", async () => {
await game.classicMode.startBattle([SpeciesId.GALAR_DARMANITAN]);
const darmanitan = game.scene.getPlayerPokemon()!;
const darmanitan = game.field.getPlayerPokemon();
game.move.select(MoveId.TACKLE);
await game.move.selectEnemyMove(MoveId.PROTECT);
await game.phaseInterceptor.to("TurnEndPhase");
await game.toEndOfTurn();
expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true);
expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false);
});
@ -96,13 +96,13 @@ describe("Abilities - Gorilla Tactics", () => {
it("should activate when a move is succesfully executed but misses", async () => {
await game.classicMode.startBattle([SpeciesId.GALAR_DARMANITAN]);
const darmanitan = game.scene.getPlayerPokemon()!;
const darmanitan = game.field.getPlayerPokemon();
game.move.select(MoveId.TACKLE);
await game.move.selectEnemyMove(MoveId.SPLASH);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.move.forceMiss();
await game.phaseInterceptor.to("TurnEndPhase");
await game.toEndOfTurn();
expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true);
expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false);