From 3ed80de330b13b416c82c5dceb64bc9d86c763d9 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 22 Feb 2024 16:30:55 -0500 Subject: [PATCH] Type immunity abilities only affect attack and status moves --- src/data/ability.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 4a82044ef20..5a62775ab13 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -8,7 +8,7 @@ import { Weather, WeatherType } from "./weather"; import { BattlerTag } from "./battler-tags"; import { BattlerTagType } from "./enums/battler-tag-type"; import { StatusEffect, getStatusEffectDescriptor } from "./status-effect"; -import Move, { MoveCategory, MoveFlags, RecoilAttr } from "./move"; +import Move, { AttackMove, MoveCategory, MoveFlags, RecoilAttr, StatusEffectAttr } from "./move"; import { ArenaTagType } from "./enums/arena-tag-type"; import { Stat } from "./pokemon-stat"; import { PokemonHeldItemModifier } from "../modifier/modifier"; @@ -191,7 +191,7 @@ export class TypeImmunityAbAttr extends PreDefendAbAttr { } applyPreDefend(pokemon: Pokemon, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (move.getMove().type === this.immuneType) { + if ((move instanceof AttackMove || move.getMove().getAttrs(StatusEffectAttr).length) && move.getMove().type === this.immuneType) { (args[0] as Utils.NumberHolder).value = 0; return true; }