From 6dbf99cc72d4bb03d3368899173326b478df9153 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Tue, 4 Jun 2024 13:03:02 -0500 Subject: [PATCH] [Bug] Fix Circular Dependency with BerryType (#1802) * Fix Potential Circular Dependency with BerryType * remove .js --- src/data/berry.ts | 15 +-------------- src/data/enums/berry-type.ts | 14 ++++++++++++++ src/field/pokemon.ts | 2 +- src/modifier/modifier-type.ts | 3 ++- src/modifier/modifier.ts | 3 ++- src/overrides.ts | 2 +- 6 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 src/data/enums/berry-type.ts diff --git a/src/data/berry.ts b/src/data/berry.ts index e832ab0a43e..f5bcd5e4be8 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -7,20 +7,7 @@ import { getStatusEffectHealText } from "./status-effect"; import * as Utils from "../utils"; import { DoubleBerryEffectAbAttr, ReduceBerryUseThresholdAbAttr, applyAbAttrs } from "./ability"; import i18next from "../plugins/i18n"; - -export enum BerryType { - SITRUS, - LUM, - ENIGMA, - LIECHI, - GANLON, - PETAYA, - APICOT, - SALAC, - LANSAT, - STARF, - LEPPA -} +import { BerryType } from "./enums/berry-type"; export function getBerryName(berryType: BerryType): string { return i18next.t(`berry:${BerryType[berryType]}.name`); diff --git a/src/data/enums/berry-type.ts b/src/data/enums/berry-type.ts new file mode 100644 index 00000000000..8b7aab16010 --- /dev/null +++ b/src/data/enums/berry-type.ts @@ -0,0 +1,14 @@ + +export enum BerryType { + SITRUS, + LUM, + ENIGMA, + LIECHI, + GANLON, + PETAYA, + APICOT, + SALAC, + LANSAT, + STARF, + LEPPA +} diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 8065b4633b7..2b8f28c4826 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -44,7 +44,7 @@ import { SpeciesFormChange, SpeciesFormChangeActiveTrigger, SpeciesFormChangeMov import { TerrainType } from "../data/terrain"; import { TrainerSlot } from "../data/trainer-config"; import * as Overrides from "../overrides"; -import { BerryType } from "../data/berry"; +import { BerryType } from "../data/enums/berry-type"; import i18next from "../plugins/i18n"; import { speciesEggMoves } from "../data/egg-moves"; import { ModifierTier } from "../modifier/modifier-tier"; diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 5705ee43f16..59185811590 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -11,7 +11,8 @@ import { Type } from "../data/type"; import PartyUiHandler, { PokemonMoveSelectFilter, PokemonSelectFilter } from "../ui/party-ui-handler"; import * as Utils from "../utils"; import { TempBattleStat, getTempBattleStatBoosterItemName, getTempBattleStatName } from "../data/temp-battle-stat"; -import { BerryType, getBerryEffectDescription, getBerryName } from "../data/berry"; +import { getBerryEffectDescription, getBerryName } from "../data/berry"; +import { BerryType } from "../data/enums/berry-type"; import { Unlockables } from "../system/unlockables"; import { StatusEffect, getStatusEffectDescriptor } from "../data/status-effect"; import { SpeciesFormKey } from "../data/pokemon-species"; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 8b965cb4ddc..975420ab528 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -12,7 +12,8 @@ import { FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions } fr import { getPokemonMessage } from "../messages"; import * as Utils from "../utils"; import { TempBattleStat } from "../data/temp-battle-stat"; -import { BerryType, getBerryEffectFunc, getBerryPredicate } from "../data/berry"; +import { getBerryEffectFunc, getBerryPredicate } from "../data/berry"; +import { BerryType } from "../data/enums/berry-type"; import { StatusEffect, getStatusEffectHealText } from "../data/status-effect"; import { achvs } from "../system/achv"; import { VoucherType } from "../system/voucher"; diff --git a/src/overrides.ts b/src/overrides.ts index 8f5d4978be3..661f2d14253 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -4,7 +4,7 @@ import { Biome } from "./data/enums/biome"; import { Moves } from "./data/enums/moves"; import { WeatherType } from "./data/weather"; import { Variant } from "./data/variant"; -import { BerryType } from "./data/berry"; +import { BerryType } from "./data/enums/berry-type"; import { TempBattleStat } from "./data/temp-battle-stat"; import { Nature } from "./data/nature"; import { Type } from "./data/type";