From 03a0b429c55d55e85e6723cde386262ef5b45a48 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Thu, 29 May 2025 22:54:41 +0200 Subject: [PATCH] Moving more things around --- src/battle-scene.ts | 2 +- src/data/moves/move.ts | 3 +- .../encounters/berries-abound-encounter.ts | 3 +- .../encounters/clowning-around-encounter.ts | 2 +- .../encounters/fight-or-flight-encounter.ts | 7 +- .../global-trade-system-encounter.ts | 7 +- .../utils/encounter-phase-utils.ts | 2 +- src/modifier/held-item-modifier.ts | 69 ++--------- src/modifier/modifier-pool-type.ts | 7 ++ src/modifier/modifier-pool.ts | 81 ++++++++++--- src/modifier/modifier-type.ts | 108 +++++++----------- src/phases/add-enemy-buff-modifier-phase.ts | 7 +- src/phases/encounter-phase.ts | 6 +- src/phases/select-modifier-phase.ts | 2 +- src/phases/select-starter-phase.ts | 2 +- src/phases/title-phase.ts | 7 +- 16 files changed, 151 insertions(+), 164 deletions(-) create mode 100644 src/modifier/modifier-pool-type.ts diff --git a/src/battle-scene.ts b/src/battle-scene.ts index a1fde7703c6..ee0b83a8714 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -53,7 +53,6 @@ import { getDefaultModifierTypeForTier, getEnemyModifierTypesForWave, getModifierPoolForType, - ModifierPoolType, } from "#app/modifier/modifier-pool"; import { getLuckString, getLuckTextTint, getPartyLuckValue } from "#app/modifier/modifier-utils"; import AbilityBar from "#app/ui/ability-bar"; @@ -185,6 +184,7 @@ import { PokemonIncrementingStatModifier, type TurnHeldItemTransferModifier, } from "./modifier/held-item-modifier"; +import { ModifierPoolType } from "./modifier/modifier-pool-type"; const DEBUG_RNG = false; diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 779b63971e9..83f4bbda1de 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -77,7 +77,7 @@ import { import type { BattlerIndex } from "../../battle"; import { BattleType } from "#enums/battle-type"; import { TerrainType } from "../terrain"; -import { getOrInferTier, ModifierPoolType } from "#app/modifier/modifier-pool"; +import { getOrInferTier } from "#app/modifier/modifier-pool"; import { Command } from "../../ui/command-ui-handler"; import i18next from "i18next"; import type { Localizable } from "#app/interfaces/locales"; @@ -123,6 +123,7 @@ import { MultiHitType } from "#enums/MultiHitType"; import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSleepTalkMoves } from "./invalid-moves"; import { SelectBiomePhase } from "#app/phases/select-biome-phase"; import { PreserveBerryModifier } from "#app/modifier/modifier"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; type MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => boolean; type UserMoveConditionFunc = (user: Pokemon, move: Move) => boolean; diff --git a/src/data/mystery-encounters/encounters/berries-abound-encounter.ts b/src/data/mystery-encounters/encounters/berries-abound-encounter.ts index 5bed26e1d39..56ef2bace2f 100644 --- a/src/data/mystery-encounters/encounters/berries-abound-encounter.ts +++ b/src/data/mystery-encounters/encounters/berries-abound-encounter.ts @@ -13,7 +13,7 @@ import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import type { BerryModifierType, ModifierTypeOption } from "#app/modifier/modifier-type"; import { modifierTypes } from "#app/modifier/modifier-type"; -import { ModifierPoolType, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool"; +import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool"; import { randSeedInt } from "#app/utils/common"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; @@ -38,6 +38,7 @@ import { BerryType } from "#enums/berry-type"; import { PERMANENT_STATS, Stat } from "#enums/stat"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/berriesAbound"; diff --git a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts index 98c36996467..2e21ee6d56f 100644 --- a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts +++ b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts @@ -14,7 +14,7 @@ import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; import { ModifierTier } from "#app/modifier/modifier-tier"; import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; import { modifierTypes } from "#app/modifier/modifier-type"; -import { ModifierPoolType } from "#app/modifier/modifier-pool"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { PartyMemberStrength } from "#enums/party-member-strength"; import { globalScene } from "#app/global-scene"; diff --git a/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts b/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts index a211dc05f2e..c978932f990 100644 --- a/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts +++ b/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts @@ -11,11 +11,7 @@ import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requir import type Pokemon from "#app/field/pokemon"; import { ModifierTier } from "#app/modifier/modifier-tier"; import type { ModifierTypeOption } from "#app/modifier/modifier-type"; -import { - getPlayerModifierTypeOptions, - ModifierPoolType, - regenerateModifierPoolThresholds, -} from "#app/modifier/modifier-pool"; +import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { globalScene } from "#app/global-scene"; import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; @@ -34,6 +30,7 @@ import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encoun import { randSeedInt } from "#app/utils/common"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/fightOrFlight"; diff --git a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts index c06a0813523..bfcb176c4c9 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -7,11 +7,7 @@ import { TrainerSlot } from "#enums/trainer-slot"; import { ModifierTier } from "#app/modifier/modifier-tier"; import { MusicPreference } from "#app/system/settings/settings"; import type { ModifierTypeOption } from "#app/modifier/modifier-type"; -import { - getPlayerModifierTypeOptions, - ModifierPoolType, - regenerateModifierPoolThresholds, -} from "#app/modifier/modifier-pool"; +import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { globalScene } from "#app/global-scene"; import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; @@ -54,6 +50,7 @@ import { doShinySparkleAnim } from "#app/field/anims"; import { TrainerType } from "#enums/trainer-type"; import { timedEventManager } from "#app/global-event-manager"; import { withTierFromPool } from "#app/modifier/modifier-pool"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/globalTradeSystem"; diff --git a/src/data/mystery-encounters/utils/encounter-phase-utils.ts b/src/data/mystery-encounters/utils/encounter-phase-utils.ts index c57839ce62b..633a6f22f20 100644 --- a/src/data/mystery-encounters/utils/encounter-phase-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-phase-utils.ts @@ -19,7 +19,6 @@ import { } from "#app/modifier/modifier-type"; import { type CustomModifierSettings, - ModifierPoolType, regenerateModifierPoolThresholds, withTierFromPool, } from "#app/modifier/modifier-pool"; @@ -70,6 +69,7 @@ import { PokemonType } from "#enums/pokemon-type"; import { getNatureName } from "#app/data/nature"; import { getPokemonNameWithAffix } from "#app/messages"; import { timedEventManager } from "#app/global-event-manager"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; /** * Animates exclamation sprite over trainer's head at start of encounter diff --git a/src/modifier/held-item-modifier.ts b/src/modifier/held-item-modifier.ts index 1313fea8b12..4327d4c5717 100644 --- a/src/modifier/held-item-modifier.ts +++ b/src/modifier/held-item-modifier.ts @@ -31,21 +31,17 @@ import { PreserveBerryModifier, TempExtraModifierModifier, } from "./modifier"; -import { - type FormChangeItemModifierType, - type ModifierOverride, - ModifierTypeGenerator, - modifierTypes, - type PokemonExpBoosterModifierType, - type PokemonFriendshipBoosterModifierType, - PokemonHeldItemModifierType, - type PokemonMoveAccuracyBoosterModifierType, - type PokemonMultiHitModifierType, - type ModifierType, - type PokemonBaseStatTotalModifierType, +import type { + FormChangeItemModifierType, + PokemonExpBoosterModifierType, + PokemonFriendshipBoosterModifierType, + PokemonMoveAccuracyBoosterModifierType, + PokemonMultiHitModifierType, + ModifierType, + PokemonBaseStatTotalModifierType, } from "./modifier-type"; -import { getOrInferTier, ModifierPoolType } from "./modifier-pool"; -import Overrides from "#app/overrides"; +import { getOrInferTier } from "./modifier-pool"; +import { ModifierPoolType } from "./modifier-pool-type"; export abstract class PokemonHeldItemModifier extends PersistentModifier { /** The ID of the {@linkcode Pokemon} that this item belongs to. */ @@ -984,7 +980,7 @@ export class BypassSpeedChanceModifier extends PokemonHeldItemModifier { doBypassSpeed.value = true; const isCommandFight = globalScene.currentBattle.turnCommands[pokemon.getBattlerIndex()]?.command === Command.FIGHT; - const hasQuickClaw = this.type instanceof PokemonHeldItemModifierType && this.type.id === "QUICK_CLAW"; + const hasQuickClaw = this.type.id === "QUICK_CLAW"; if (isCommandFight && hasQuickClaw) { globalScene.queueMessage( @@ -1908,46 +1904,3 @@ export class ContactHeldItemTransferChanceModifier extends HeldItemTransferModif return 5; } } - -/** - * Uses either `HELD_ITEMS_OVERRIDE` in overrides.ts to set {@linkcode PokemonHeldItemModifier}s for either: - * - The first member of the player's team when starting a new game - * - An enemy {@linkcode Pokemon} being spawned in - * @param pokemon {@linkcode Pokemon} whose held items are being overridden - * @param isPlayer {@linkcode boolean} for whether the {@linkcode pokemon} is the player's (`true`) or an enemy (`false`) - */ -export function overrideHeldItems(pokemon: Pokemon, isPlayer = true): void { - const heldItemsOverride: ModifierOverride[] = isPlayer - ? Overrides.STARTING_HELD_ITEMS_OVERRIDE - : Overrides.OPP_HELD_ITEMS_OVERRIDE; - if (!heldItemsOverride || heldItemsOverride.length === 0 || !globalScene) { - return; - } - - if (!isPlayer) { - globalScene.clearEnemyHeldItemModifiers(pokemon); - } - - for (const item of heldItemsOverride) { - const modifierFunc = modifierTypes[item.name]; - let modifierType: ModifierType | null = modifierFunc(); - const qty = item.count || 1; - - if (modifierType instanceof ModifierTypeGenerator) { - const pregenArgs = "type" in item && item.type !== null ? [item.type] : undefined; - modifierType = modifierType.generateType([], pregenArgs); - } - - const heldItemModifier = - modifierType && (modifierType.withIdFromFunc(modifierFunc).newModifier(pokemon) as PokemonHeldItemModifier); - if (heldItemModifier) { - heldItemModifier.pokemonId = pokemon.id; - heldItemModifier.stackCount = qty; - if (isPlayer) { - globalScene.addModifier(heldItemModifier, true, false, false, true); - } else { - globalScene.addEnemyModifier(heldItemModifier, true, true); - } - } - } -} diff --git a/src/modifier/modifier-pool-type.ts b/src/modifier/modifier-pool-type.ts new file mode 100644 index 00000000000..ca3ed3a11c7 --- /dev/null +++ b/src/modifier/modifier-pool-type.ts @@ -0,0 +1,7 @@ +export enum ModifierPoolType { + PLAYER, + WILD, + TRAINER, + ENEMY_BUFF, + DAILY_STARTER, +} diff --git a/src/modifier/modifier-pool.ts b/src/modifier/modifier-pool.ts index f156fe4d563..1674a88cd6e 100644 --- a/src/modifier/modifier-pool.ts +++ b/src/modifier/modifier-pool.ts @@ -11,7 +11,7 @@ import { Moves } from "#enums/moves"; import { PokeballType } from "#enums/pokeball"; import { Species } from "#enums/species"; import { StatusEffect } from "#enums/status-effect"; -import type { EnemyPersistentModifier, PersistentModifier } from "./modifier"; +import { DoubleBattleChanceBoosterModifier, type EnemyPersistentModifier, type PersistentModifier } from "./modifier"; import { BerryModifier, type PokemonHeldItemModifier, @@ -22,7 +22,6 @@ import { ModifierTier } from "./modifier-tier"; import { FormChangeItemModifierType, getModifierType, - lureWeightFunc, type ModifierOverride, type ModifierType, type ModifierTypeFunc, @@ -31,28 +30,84 @@ import { ModifierTypeOption, modifierTypes, PokemonHeldItemModifierType, - skipInClassicAfterWave, - skipInLastClassicWaveOrDefault, - WeightedModifierType, } from "./modifier-type"; import { getPartyLuckValue, hasMaximumBalls } from "./modifier-utils"; import Overrides from "#app/overrides"; +import { ModifierPoolType } from "./modifier-pool-type"; const outputModifierData = false; const useMaxWeightForOutput = false; -export enum ModifierPoolType { - PLAYER, - WILD, - TRAINER, - ENEMY_BUFF, - DAILY_STARTER, -} - interface ModifierPool { [tier: string]: WeightedModifierType[]; } +export class WeightedModifierType { + public modifierType: ModifierType; + public weight: number | WeightedModifierTypeWeightFunc; + public maxWeight: number | WeightedModifierTypeWeightFunc; + + constructor( + modifierTypeFunc: ModifierTypeFunc, + weight: number | WeightedModifierTypeWeightFunc, + maxWeight?: number | WeightedModifierTypeWeightFunc, + ) { + this.modifierType = modifierTypeFunc(); + this.modifierType.id = Object.keys(modifierTypes).find(k => modifierTypes[k] === modifierTypeFunc)!; // TODO: is this bang correct? + this.weight = weight; + this.maxWeight = maxWeight || (!(weight instanceof Function) ? weight : 0); + } + + setTier(tier: ModifierTier) { + this.modifierType.setTier(tier); + } +} + +type WeightedModifierTypeWeightFunc = (party: Pokemon[], rerollCount?: number) => number; + +/** + * High order function that returns a WeightedModifierTypeWeightFunc that will only be applied on + * classic and skip an ModifierType if current wave is greater or equal to the one passed down + * @param wave - Wave where we should stop showing the modifier + * @param defaultWeight - ModifierType default weight + * @returns A WeightedModifierTypeWeightFunc + */ +export function skipInClassicAfterWave(wave: number, defaultWeight: number): WeightedModifierTypeWeightFunc { + return () => { + const gameMode = globalScene.gameMode; + const currentWave = globalScene.currentBattle.waveIndex; + return gameMode.isClassic && currentWave >= wave ? 0 : defaultWeight; + }; +} + +/** + * High order function that returns a WeightedModifierTypeWeightFunc that will only be applied on + * classic and it will skip a ModifierType if it is the last wave pull. + * @param defaultWeight ModifierType default weight + * @returns A WeightedModifierTypeWeightFunc + */ +export function skipInLastClassicWaveOrDefault(defaultWeight: number): WeightedModifierTypeWeightFunc { + return skipInClassicAfterWave(199, defaultWeight); +} + +/** + * High order function that returns a WeightedModifierTypeWeightFunc to ensure Lures don't spawn on Classic 199 + * or if the lure still has over 60% of its duration left + * @param maxBattles The max battles the lure type in question lasts. 10 for green, 15 for Super, 30 for Max + * @param weight The desired weight for the lure when it does spawn + * @returns A WeightedModifierTypeWeightFunc + */ +export function lureWeightFunc(maxBattles: number, weight: number): WeightedModifierTypeWeightFunc { + return () => { + const lures = globalScene.getModifiers(DoubleBattleChanceBoosterModifier); + return !(globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex === 199) && + (lures.length === 0 || + lures.filter(m => m.getMaxBattles() === maxBattles && m.getBattleCount() >= maxBattles * 0.6).length === 0) + ? weight + : 0; + }; +} + const modifierPool: ModifierPool = { [ModifierTier.COMMON]: [ new WeightedModifierType(modifierTypes.POKEBALL, () => (hasMaximumBalls(PokeballType.POKEBALL) ? 0 : 6), 6), diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 7b09b1ca679..34bf2c43eb1 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -104,6 +104,7 @@ import { ModifierTier } from "#app/modifier/modifier-tier"; import { getVoucherTypeIcon, getVoucherTypeName, VoucherType } from "#app/system/voucher"; import type { PokemonMoveSelectFilter, PokemonSelectFilter } from "#app/ui/party-ui-handler"; import PartyUiHandler from "#app/ui/party-ui-handler"; +import Overrides from "#app/overrides"; import { formatMoney, getEnumKeys, getEnumValues, NumberHolder, padInt, randSeedInt } from "#app/utils/common"; import { BattlerTagType } from "#enums/battler-tag-type"; @@ -1689,70 +1690,6 @@ export class EnemyEndureChanceModifierType extends ModifierType { } export type ModifierTypeFunc = () => ModifierType; -type WeightedModifierTypeWeightFunc = (party: Pokemon[], rerollCount?: number) => number; - -/** - * High order function that returns a WeightedModifierTypeWeightFunc that will only be applied on - * classic and skip an ModifierType if current wave is greater or equal to the one passed down - * @param wave - Wave where we should stop showing the modifier - * @param defaultWeight - ModifierType default weight - * @returns A WeightedModifierTypeWeightFunc - */ -export function skipInClassicAfterWave(wave: number, defaultWeight: number): WeightedModifierTypeWeightFunc { - return () => { - const gameMode = globalScene.gameMode; - const currentWave = globalScene.currentBattle.waveIndex; - return gameMode.isClassic && currentWave >= wave ? 0 : defaultWeight; - }; -} - -/** - * High order function that returns a WeightedModifierTypeWeightFunc that will only be applied on - * classic and it will skip a ModifierType if it is the last wave pull. - * @param defaultWeight ModifierType default weight - * @returns A WeightedModifierTypeWeightFunc - */ -export function skipInLastClassicWaveOrDefault(defaultWeight: number): WeightedModifierTypeWeightFunc { - return skipInClassicAfterWave(199, defaultWeight); -} - -/** - * High order function that returns a WeightedModifierTypeWeightFunc to ensure Lures don't spawn on Classic 199 - * or if the lure still has over 60% of its duration left - * @param maxBattles The max battles the lure type in question lasts. 10 for green, 15 for Super, 30 for Max - * @param weight The desired weight for the lure when it does spawn - * @returns A WeightedModifierTypeWeightFunc - */ -export function lureWeightFunc(maxBattles: number, weight: number): WeightedModifierTypeWeightFunc { - return () => { - const lures = globalScene.getModifiers(DoubleBattleChanceBoosterModifier); - return !(globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex === 199) && - (lures.length === 0 || - lures.filter(m => m.getMaxBattles() === maxBattles && m.getBattleCount() >= maxBattles * 0.6).length === 0) - ? weight - : 0; - }; -} -export class WeightedModifierType { - public modifierType: ModifierType; - public weight: number | WeightedModifierTypeWeightFunc; - public maxWeight: number | WeightedModifierTypeWeightFunc; - - constructor( - modifierTypeFunc: ModifierTypeFunc, - weight: number | WeightedModifierTypeWeightFunc, - maxWeight?: number | WeightedModifierTypeWeightFunc, - ) { - this.modifierType = modifierTypeFunc(); - this.modifierType.id = Object.keys(modifierTypes).find(k => modifierTypes[k] === modifierTypeFunc)!; // TODO: is this bang correct? - this.weight = weight; - this.maxWeight = maxWeight || (!(weight instanceof Function) ? weight : 0); - } - - setTier(tier: ModifierTier) { - this.modifierType.setTier(tier); - } -} type BaseModifierOverride = { name: Exclude; @@ -2338,3 +2275,46 @@ export class ModifierTypeOption { export function getModifierTypeFuncById(id: string): ModifierTypeFunc { return modifierTypes[id]; } + +/** + * Uses either `HELD_ITEMS_OVERRIDE` in overrides.ts to set {@linkcode PokemonHeldItemModifier}s for either: + * - The first member of the player's team when starting a new game + * - An enemy {@linkcode Pokemon} being spawned in + * @param pokemon {@linkcode Pokemon} whose held items are being overridden + * @param isPlayer {@linkcode boolean} for whether the {@linkcode pokemon} is the player's (`true`) or an enemy (`false`) + */ +export function overrideHeldItems(pokemon: Pokemon, isPlayer = true): void { + const heldItemsOverride: ModifierOverride[] = isPlayer + ? Overrides.STARTING_HELD_ITEMS_OVERRIDE + : Overrides.OPP_HELD_ITEMS_OVERRIDE; + if (!heldItemsOverride || heldItemsOverride.length === 0 || !globalScene) { + return; + } + + if (!isPlayer) { + globalScene.clearEnemyHeldItemModifiers(pokemon); + } + + for (const item of heldItemsOverride) { + const modifierFunc = modifierTypes[item.name]; + let modifierType: ModifierType | null = modifierFunc(); + const qty = item.count || 1; + + if (modifierType instanceof ModifierTypeGenerator) { + const pregenArgs = "type" in item && item.type !== null ? [item.type] : undefined; + modifierType = modifierType.generateType([], pregenArgs); + } + + const heldItemModifier = + modifierType && (modifierType.withIdFromFunc(modifierFunc).newModifier(pokemon) as PokemonHeldItemModifier); + if (heldItemModifier) { + heldItemModifier.pokemonId = pokemon.id; + heldItemModifier.stackCount = qty; + if (isPlayer) { + globalScene.addModifier(heldItemModifier, true, false, false, true); + } else { + globalScene.addEnemyModifier(heldItemModifier, true, true); + } + } + } +} diff --git a/src/phases/add-enemy-buff-modifier-phase.ts b/src/phases/add-enemy-buff-modifier-phase.ts index 5bc4b02353b..3fd44b144f0 100644 --- a/src/phases/add-enemy-buff-modifier-phase.ts +++ b/src/phases/add-enemy-buff-modifier-phase.ts @@ -1,12 +1,9 @@ import { ModifierTier } from "#app/modifier/modifier-tier"; -import { - regenerateModifierPoolThresholds, - ModifierPoolType, - getEnemyBuffModifierForWave, -} from "#app/modifier/modifier-pool"; +import { regenerateModifierPoolThresholds, getEnemyBuffModifierForWave } from "#app/modifier/modifier-pool"; import { EnemyPersistentModifier } from "#app/modifier/modifier"; import { Phase } from "#app/phase"; import { globalScene } from "#app/global-scene"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; export class AddEnemyBuffModifierPhase extends Phase { start() { diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 873c777098e..f8503cd5352 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -20,7 +20,7 @@ import type Pokemon from "#app/field/pokemon"; import { FieldPosition } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { BoostBugSpawnModifier, IvScannerModifier } from "#app/modifier/modifier"; -import { ModifierPoolType, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool"; +import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool"; import Overrides from "#app/overrides"; import { BattlePhase } from "#app/phases/battle-phase"; import { CheckSwitchPhase } from "#app/phases/check-switch-phase"; @@ -45,7 +45,9 @@ import { overrideModifiers } from "#app/modifier/modifier"; import i18next from "i18next"; import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mystery-encounters"; import { getNatureName } from "#app/data/nature"; -import { overrideHeldItems, TurnHeldItemTransferModifier } from "#app/modifier/held-item-modifier"; +import { TurnHeldItemTransferModifier } from "#app/modifier/held-item-modifier"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; +import { overrideHeldItems } from "#app/modifier/modifier-type"; export class EncounterPhase extends BattlePhase { private loaded: boolean; diff --git a/src/phases/select-modifier-phase.ts b/src/phases/select-modifier-phase.ts index 6c40c162b77..aa88a8d9e4a 100644 --- a/src/phases/select-modifier-phase.ts +++ b/src/phases/select-modifier-phase.ts @@ -13,7 +13,6 @@ import { import { regenerateModifierPoolThresholds, getPlayerShopModifierTypeOptionsForWave, - ModifierPoolType, getPlayerModifierTypeOptions, type CustomModifierSettings, } from "#app/modifier/modifier-pool"; @@ -28,6 +27,7 @@ import { BattlePhase } from "./battle-phase"; import Overrides from "#app/overrides"; import { isNullOrUndefined, NumberHolder } from "#app/utils/common"; import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; export class SelectModifierPhase extends BattlePhase { private rerollCount: number; diff --git a/src/phases/select-starter-phase.ts b/src/phases/select-starter-phase.ts index 91337ce366e..b30e148aa1a 100644 --- a/src/phases/select-starter-phase.ts +++ b/src/phases/select-starter-phase.ts @@ -13,7 +13,7 @@ import { UiMode } from "#enums/ui-mode"; import type { Species } from "#enums/species"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { isNullOrUndefined } from "#app/utils/common"; -import { overrideHeldItems } from "#app/modifier/held-item-modifier"; +import { overrideHeldItems } from "#app/modifier/modifier-type"; export class SelectStarterPhase extends Phase { start() { diff --git a/src/phases/title-phase.ts b/src/phases/title-phase.ts index 5cc5fe4af78..0ec2228d5ce 100644 --- a/src/phases/title-phase.ts +++ b/src/phases/title-phase.ts @@ -6,11 +6,7 @@ import { getBiomeKey } from "#app/field/arena"; import { GameMode, GameModes, getGameMode } from "#app/game-mode"; import type { Modifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; -import { - getDailyRunStarterModifiers, - ModifierPoolType, - regenerateModifierPoolThresholds, -} from "#app/modifier/modifier-pool"; +import { getDailyRunStarterModifiers, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool"; import { Phase } from "#app/phase"; import type { SessionSaveData } from "#app/system/game-data"; import { Unlockables } from "#app/system/unlockables"; @@ -27,6 +23,7 @@ import { SelectStarterPhase } from "./select-starter-phase"; import { SummonPhase } from "./summon-phase"; import { globalScene } from "#app/global-scene"; import Overrides from "#app/overrides"; +import { ModifierPoolType } from "#app/modifier/modifier-pool-type"; export class TitlePhase extends Phase { private loaded = false;