From fa844952f4d3ec82616d1cddca3c52ed01740c80 Mon Sep 17 00:00:00 2001 From: Ishan Patel Date: Mon, 15 Apr 2024 19:10:57 -0400 Subject: [PATCH] Cleaned up GROUNDED code --- src/field/pokemon.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f5be97da76d..adb9ba686cb 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -28,7 +28,7 @@ import { Biome } from "../data/enums/biome"; import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs } from '../data/ability'; import { Abilities } from "#app/data/enums/abilities"; import PokemonData from '../system/pokemon-data'; -import { BattlerIndex } from '../battle'; +import Battle, { BattlerIndex } from '../battle'; import { BattleSpec } from "../enums/battle-spec"; import { Mode } from '../ui/ui'; import PartyUiHandler, { PartyOption, PartyUiMode } from '../ui/party-ui-handler'; @@ -692,13 +692,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } - if (forDefend && (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY))) { - const flyingIndex = types.indexOf(Type.FLYING); - if (flyingIndex > -1) - types.splice(flyingIndex, 1); - } - - if (forDefend && (this.getTag(BattlerTagType.GROUNDED) || this.scene.arena.getTag(ArenaTagType.GRAVITY))) { + 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);