From 07ff22e53dee86a467e91a0958ce5959f7c8c49a Mon Sep 17 00:00:00 2001 From: spongario Date: Thu, 11 Apr 2024 23:04:17 -0400 Subject: [PATCH] fix for Psychic Terrain blocking Protect Moves --- src/data/terrain.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/data/terrain.ts b/src/data/terrain.ts index c5af86240bd..606a3914bc5 100644 --- a/src/data/terrain.ts +++ b/src/data/terrain.ts @@ -3,6 +3,7 @@ import Move from "./move"; import { Type } from "./type"; import * as Utils from "../utils"; import { IncrementMovePriorityAbAttr, applyAbAttrs } from "./ability"; +import { ProtectAttr } from "./move"; export enum TerrainType { NONE, @@ -50,9 +51,12 @@ export class Terrain { isMoveTerrainCancelled(user: Pokemon, move: Move): boolean { switch (this.terrainType) { case TerrainType.PSYCHIC: - const priority = new Utils.IntegerHolder(move.priority); - applyAbAttrs(IncrementMovePriorityAbAttr, user, null, move, priority); - return priority.value > 0; + if (!move.getAttrs(ProtectAttr).length ) + { + const priority = new Utils.IntegerHolder(move.priority); + applyAbAttrs(IncrementMovePriorityAbAttr, user, null, move, priority); + return priority.value > 0; + } } return false;