diff --git a/src/data/mystery-encounters/encounters/berries-abound-encounter.ts b/src/data/mystery-encounters/encounters/berries-abound-encounter.ts index 786ca3e8fc0..090653e7ca9 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 { ModifierTypeOption, modifierTypes, regenerateModifierPoolThresholds, } from "#app/modifier/modifier-type"; -import { randSeedInt } from "#app/utils"; +import { randSeedInt, randSeedItem } from "#app/utils"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import BattleScene from "#app/battle-scene"; @@ -31,6 +31,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/game-mode"; +import PokemonSpecies, { allSpecies } from "#app/data/pokemon-species"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/berriesAbound"; @@ -58,7 +59,14 @@ export const BerriesAboundEncounter: MysteryEncounter = // Calculate boss mon const level = getEncounterPokemonLevelForWave(scene, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER); - const bossSpecies = scene.arena.randomSpecies(scene.currentBattle.waveIndex, level, 0, getPartyLuckValue(scene.getPlayerParty()), true); + let bossSpecies: PokemonSpecies; + if (scene.eventManager.isEventActive() && scene.eventManager.activeEvent()?.uncommonBreedEncounters && randSeedInt(2) === 1) { + const eventEncounter = randSeedItem(scene.eventManager.activeEvent()!.uncommonBreedEncounters!); + bossSpecies = allSpecies[eventEncounter.species]; + bossSpecies.speciesId = bossSpecies.getSpeciesForLevel(level, eventEncounter.allowEvolution); + } else { + bossSpecies = scene.arena.randomSpecies(scene.currentBattle.waveIndex, level, 0, getPartyLuckValue(scene.getPlayerParty()), true); + } const bossPokemon = new EnemyPokemon(scene, bossSpecies, level, TrainerSlot.NONE, true); encounter.setDialogueToken("enemyPokemon", getPokemonNameWithAffix(bossPokemon)); const config: EnemyPartyConfig = { diff --git a/src/data/mystery-encounters/encounters/delibirdy-encounter.ts b/src/data/mystery-encounters/encounters/delibirdy-encounter.ts index e3f60dee404..1df87a3d17f 100644 --- a/src/data/mystery-encounters/encounters/delibirdy-encounter.ts +++ b/src/data/mystery-encounters/encounters/delibirdy-encounter.ts @@ -34,7 +34,7 @@ const OPTION_3_DISALLOWED_MODIFIERS = [ "PokemonBaseStatTotalModifier" ]; -const DELIBIRDY_MONEY_PRICE_MULTIPLIER = 2; +const DELIBIRDY_MONEY_PRICE_MULTIPLIER = 1.5; const doEventReward = (scene: BattleScene) => { const event_buff = scene.eventManager.activeEvent()?.delibirdyBuff ?? []; 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 3533e10df29..07e7a15c65c 100644 --- a/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts +++ b/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts @@ -26,9 +26,10 @@ import { getEncounterPokemonLevelForWave, getSpriteKeysFromPokemon, STANDARD_ENC import PokemonData from "#app/system/pokemon-data"; import { BattlerTagType } from "#enums/battler-tag-type"; import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { randSeedInt } from "#app/utils"; +import { randSeedInt, randSeedItem } from "#app/utils"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; +import PokemonSpecies, { allSpecies } from "#app/data/pokemon-species"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/fightOrFlight"; @@ -56,7 +57,14 @@ export const FightOrFlightEncounter: MysteryEncounter = // Calculate boss mon const level = getEncounterPokemonLevelForWave(scene, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER); - const bossSpecies = scene.arena.randomSpecies(scene.currentBattle.waveIndex, level, 0, getPartyLuckValue(scene.getPlayerParty()), true); + let bossSpecies: PokemonSpecies; + if (scene.eventManager.isEventActive() && scene.eventManager.activeEvent()?.uncommonBreedEncounters && randSeedInt(2) === 1) { + const eventEncounter = randSeedItem(scene.eventManager.activeEvent()!.uncommonBreedEncounters!); + bossSpecies = allSpecies[eventEncounter.species]; + bossSpecies.speciesId = bossSpecies.getSpeciesForLevel(level, eventEncounter.allowEvolution); + } else { + bossSpecies = scene.arena.randomSpecies(scene.currentBattle.waveIndex, level, 0, getPartyLuckValue(scene.getPlayerParty()), true); + } const bossPokemon = new EnemyPokemon(scene, bossSpecies, level, TrainerSlot.NONE, true); encounter.setDialogueToken("enemyPokemon", bossPokemon.getNameToRender()); const config: EnemyPartyConfig = { diff --git a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts index f07820bb973..15f7bce8945 100644 --- a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts +++ b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts @@ -35,7 +35,6 @@ const namespace = "mysteryEncounters/uncommonBreed"; */ export const UncommonBreedEncounter: MysteryEncounter = MysteryEncounterBuilder.withEncounterType(MysteryEncounterType.UNCOMMON_BREED) - .withMaxAllowedEncounters(4) .withEncounterTier(MysteryEncounterTier.COMMON) .withSceneWaveRangeRequirement(...CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES) .withCatchAllowed(true) diff --git a/src/data/mystery-encounters/mystery-encounters.ts b/src/data/mystery-encounters/mystery-encounters.ts index 8c1c3bf6de4..8a747cd4cd4 100644 --- a/src/data/mystery-encounters/mystery-encounters.ts +++ b/src/data/mystery-encounters/mystery-encounters.ts @@ -177,7 +177,7 @@ export const allMysteryEncounters: { [encounterType: number]: MysteryEncounter } const extremeBiomeEncounters: MysteryEncounterType[] = []; const nonExtremeBiomeEncounters: MysteryEncounterType[] = [ - MysteryEncounterType.FIELD_TRIP, + // MysteryEncounterType.FIELD_TRIP, Disabled for holiday event MysteryEncounterType.DANCING_LESSONS, // Is also in BADLANDS, DESERT, VOLCANO, WASTELAND, ABYSS ]; @@ -185,14 +185,14 @@ const humanTransitableBiomeEncounters: MysteryEncounterType[] = [ MysteryEncounterType.MYSTERIOUS_CHALLENGERS, MysteryEncounterType.SHADY_VITAMIN_DEALER, MysteryEncounterType.THE_POKEMON_SALESMAN, - MysteryEncounterType.AN_OFFER_YOU_CANT_REFUSE, + // MysteryEncounterType.AN_OFFER_YOU_CANT_REFUSE, Disabled for holiday event MysteryEncounterType.THE_WINSTRATE_CHALLENGE, MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER ]; const civilizationBiomeEncounters: MysteryEncounterType[] = [ - MysteryEncounterType.DEPARTMENT_STORE_SALE, - MysteryEncounterType.PART_TIMER, + // MysteryEncounterType.DEPARTMENT_STORE_SALE, Disabled for holiday event + // MysteryEncounterType.PART_TIMER, Disabled for holiday event MysteryEncounterType.FUN_AND_GAMES, MysteryEncounterType.GLOBAL_TRADE_SYSTEM ]; diff --git a/src/data/weather.ts b/src/data/weather.ts index 0a76a015402..19092716353 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -242,7 +242,7 @@ export function getTerrainBlockMessage(pokemon: Pokemon, terrainType: TerrainTyp return i18next.t("terrain:defaultBlockMessage", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), terrainName: getTerrainName(terrainType) }); } -interface WeatherPoolEntry { +export interface WeatherPoolEntry { weatherType: WeatherType; weight: integer; } @@ -373,6 +373,10 @@ export function getRandomWeatherType(arena: any /* Importing from arena causes a break; } + if (arena.scene.eventManager.isEventActive() && arena.scene.eventManager.activeEvent()?.weather?.length > 0) { + arena.scene.eventManager.activeEvent().weather.map(w => weatherPool.push(w)); + } + if (weatherPool.length > 1) { let totalWeight = 0; weatherPool.forEach(w => totalWeight += w.weight); diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index 059abc094a4..db370e0711f 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -2,7 +2,9 @@ import BattleScene from "#app/battle-scene"; import { TextStyle, addTextObject } from "#app/ui/text"; import { nil } from "#app/utils"; import i18next from "i18next"; -import { Species } from "./enums/species"; +import { Species } from "#enums/species"; +import { WeatherPoolEntry } from "#app/data/weather"; +import { WeatherType } from "#enums/weather-type"; export enum EventType { SHINY, @@ -31,6 +33,7 @@ interface TimedEvent extends EventBanner { endDate: Date; uncommonBreedEncounters?: EventEncounter[]; delibirdyBuff?: string[]; + weather?: WeatherPoolEntry[]; } const timedEvents: TimedEvent[] = [ @@ -48,22 +51,25 @@ const timedEvents: TimedEvent[] = [ { species: Species.GIMMIGHOUL }, { species: Species.DELIBIRD }, { species: Species.STANTLER }, - { species: Species.LITWICK, allowEvolution: true }, - { species: Species.SNOVER, allowEvolution: true }, - { species: Species.ROLYCOLY, allowEvolution: true }, - { species: Species.BALTOY, allowEvolution: true }, - { species: Species.SMOLIV, allowEvolution: true }, - { species: Species.CHESPIN, allowEvolution: true }, - { species: Species.PIPLUP, allowEvolution: true }, { species: Species.CYNDAQUIL, allowEvolution: true }, - { species: Species.GALAR_DARUMAKA, allowEvolution: true }, - { species: Species.MILCERY, allowEvolution: true }, - { species: Species.ALOLA_VULPIX, allowEvolution: true }, + { species: Species.PIPLUP, allowEvolution: true }, + { species: Species.CHESPIN, allowEvolution: true }, + { species: Species.BALTOY, allowEvolution: true }, + { species: Species.SNOVER, allowEvolution: true }, { species: Species.CHINGLING, allowEvolution: true }, + { species: Species.LITWICK, allowEvolution: true }, + { species: Species.CUBCHOO, allowEvolution: true }, { species: Species.SWIRLIX, allowEvolution: true }, - { species: Species.MUDBRAY, allowEvolution: true } + { species: Species.AMAURA, allowEvolution: true }, + { species: Species.MUDBRAY, allowEvolution: true }, + { species: Species.ROLYCOLY, allowEvolution: true }, + { species: Species.MILCERY, allowEvolution: true }, + { species: Species.SMOLIV, allowEvolution: true }, + { species: Species.ALOLA_VULPIX, allowEvolution: true }, + { species: Species.GALAR_DARUMAKA, allowEvolution: true } ], - delibirdyBuff: [ "CATCHING_CHARM", "SHINY_CHARM", "ABILITY_CHARM", "EXP_CHARM", "SUPER_EXP_CHARM", "HEALING_CHARM" ] + delibirdyBuff: [ "CATCHING_CHARM", "SHINY_CHARM", "ABILITY_CHARM", "EXP_CHARM", "SUPER_EXP_CHARM", "HEALING_CHARM" ], + weather: [{ weatherType: WeatherType.SNOW, weight: 1 }] } ];