From 1564cc4616a7739f33c07f7b5ecc066d8b19f3e9 Mon Sep 17 00:00:00 2001 From: Tristan D Gant Date: Thu, 9 May 2024 16:27:12 -0500 Subject: [PATCH] Fixed flying type being removed in type effectiveness calculation under gravity --- src/field/pokemon.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 9ac3aec53..71c7bc9df 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -772,12 +772,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } - if (forDefend && (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY) || this.getTag(BattlerTagType.GROUNDED))) { - const flyingIndex = types.indexOf(Type.FLYING); - if (flyingIndex > -1) - types.splice(flyingIndex, 1); - } - if (!types.length) // become UNKNOWN if no types are present types.push(Type.UNKNOWN); @@ -908,6 +902,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return this.isTerastallized() ? 2 : 1; const types = this.getTypes(true, true); + if (moveType === Type.GROUND && (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY) || this.getTag(BattlerTagType.GROUNDED))) { + const flyingIndex = types.indexOf(Type.FLYING); + if (flyingIndex > -1) + types.splice(flyingIndex, 1); + } + const ignorableImmunities = source?.getAbility()?.getAttrs(IgnoreTypeImmunityAbAttr) || []; const cancelled = new Utils.BooleanHolder(false);