From 78d3bf77795b6d5ed92619b64967d78092265b11 Mon Sep 17 00:00:00 2001 From: contra1337 Date: Mon, 6 May 2024 19:13:35 -0500 Subject: [PATCH] simplify logic for ignoretypeimmunityabattr --- src/data/ability.ts | 2 +- src/field/pokemon.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 377c0971d97..1fc46e046ea 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2483,7 +2483,7 @@ export class IgnoreTypeImmunityAbAttr extends AbAttr { } apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (this.defenderType === (args[1] as Type) && this.allowedMoveTypes.some(type => type === (args[0] as Type))) { + if (this.defenderType === (args[1] as Type) && this.allowedMoveTypes.includes(args[0] as Type)) { cancelled.value = true; return true; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 75d19d1755f..10bd57dfa7b 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -902,7 +902,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const types = this.getTypes(true, true); let multiplier = types.map(defType => { - if (source && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) { + if (source) { const ignoreImmunity = new Utils.BooleanHolder(false); applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType); if (ignoreImmunity.value)