From 4a9664c04c2d3c77d97c0a92a9f83f66944fc013 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Fri, 17 May 2024 20:20:02 -0500 Subject: [PATCH] Fix Entry Hazard Miss (#984) * Fix Entry Hazard Miss Made Entry Hazards bypass the accuracy check as they cannot miss a target. There's still one more bug to fix with this but it requires way more code changes. This change needed to be done as well, so I'm getting it out early. * Update move.ts --- src/data/move.ts | 1 + src/phases.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index 99ef179ad30..6849a0fe7ce 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -55,6 +55,7 @@ export enum MoveTarget { /** {@link https://bulbapedia.bulbagarden.net/wiki/Category:Moves_that_target_all_Pok%C3%A9mon Moves that target all Pokemon} */ ALL, USER_SIDE, + /** {@link https://bulbapedia.bulbagarden.net/wiki/Category:Entry_hazard-creating_moves Entry hazard-creating moves} */ ENEMY_SIDE, BOTH_SIDES, PARTY diff --git a/src/phases.ts b/src/phases.ts index 1137c85afa6..f70fe9e857a 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2597,7 +2597,8 @@ export class MoveEffectPhase extends PokemonPhase { } hitCheck(target: Pokemon): boolean { - if (this.move.getMove().moveTarget === MoveTarget.USER) + // Moves targeting the user and entry hazards can't miss + if ([MoveTarget.USER, MoveTarget.ENEMY_SIDE].includes(this.move.getMove().moveTarget)) return true; const user = this.getUserPokemon();