diff --git a/src/data/mystery-encounters/encounters/dark-deal.ts b/src/data/mystery-encounters/encounters/dark-deal.ts index 95757c901ab..3a6d3ec273a 100644 --- a/src/data/mystery-encounters/encounters/dark-deal.ts +++ b/src/data/mystery-encounters/encounters/dark-deal.ts @@ -9,7 +9,6 @@ import { PokeballType } from "../../pokeball"; import { getPokemonSpecies } from "../../pokemon-species"; import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter"; import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option"; -import { PartySizeRequirement } from "../mystery-encounter-requirements"; import { EnemyPartyConfig, EnemyPokemonConfig, getRandomPlayerPokemon, @@ -84,7 +83,7 @@ export const DarkDealEncounter: MysteryEncounter = MysteryEncounterBuilder } ]) .withSceneWaveRangeRequirement(30, 180) // waves 30 to 180 - .withSceneRequirement(new PartySizeRequirement([2, 6])) // Must have at least 2 pokemon in party + .withScenePartySizeRequirement(2, 6) // Must have at least 2 pokemon in party .withCatchAllowed(true) .withOption(new MysteryEncounterOptionBuilder() .withPreOptionPhase(async (scene: BattleScene) => { diff --git a/src/data/mystery-encounters/mystery-encounter.ts b/src/data/mystery-encounters/mystery-encounter.ts index 37038af684c..0f2cd05870e 100644 --- a/src/data/mystery-encounters/mystery-encounter.ts +++ b/src/data/mystery-encounters/mystery-encounter.ts @@ -8,6 +8,7 @@ import MysteryEncounterOption from "./mystery-encounter-option"; import { EncounterPokemonRequirement, EncounterSceneRequirement, + PartySizeRequirement, WaveRangeRequirement } from "./mystery-encounter-requirements"; import * as Utils from "../../utils"; @@ -442,6 +443,17 @@ export class MysteryEncounterBuilder implements Partial { return this.withSceneRequirement(new WaveRangeRequirement([min, max ?? min])); } + /** + * Specifies a party size requirement for an encounter. + * + * @param min min wave (or exact size if only min is given) + * @param max optional max size. If not given, defaults to min => exact wave + * @returns + */ + withScenePartySizeRequirement(min: number, max?: number) { + return this.withSceneRequirement(new PartySizeRequirement([min, max ?? min])); + } + withPrimaryPokemonRequirement(requirement: EncounterPokemonRequirement): this & Required> { this.primaryPokemonRequirements.push(requirement); return Object.assign(this, { primaryPokemonRequirements: this.primaryPokemonRequirements });