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
This commit is contained in:
Benjamin Odom 2024-05-17 20:20:02 -05:00 committed by GitHub
parent f3c4a3838b
commit 4a9664c04c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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();