diff --git a/src/data/mystery-encounters/encounters/shady-vitamin-dealer.ts b/src/data/mystery-encounters/encounters/shady-vitamin-dealer.ts index 4c99bfb3d96..83d6da4a616 100644 --- a/src/data/mystery-encounters/encounters/shady-vitamin-dealer.ts +++ b/src/data/mystery-encounters/encounters/shady-vitamin-dealer.ts @@ -16,9 +16,7 @@ import BattleScene from "../../../battle-scene"; import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter"; import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option"; import { - HealthRatioRequirement, - MoneyRequirement, - StatusEffectRequirement + MoneyRequirement } from "../mystery-encounter-requirements"; export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBuilder @@ -42,8 +40,8 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBui } ]) .withSceneWaveRangeRequirement(10, 180) - .withPrimaryPokemonRequirement(new StatusEffectRequirement([StatusEffect.NONE])) // Pokemon must not have status - .withPrimaryPokemonRequirement(new HealthRatioRequirement([0.34, 1])) // Pokemon must have above 1/3rd HP + .withPrimaryPokemonStatusEffectRequirement([StatusEffect.NONE]) // Pokemon must not have status + .withPrimaryPokemonHealthRatioRequirement([0.34, 1]) // Pokemon must have above 1/3rd HP .withOption(new MysteryEncounterOptionBuilder() .withSceneRequirement(new MoneyRequirement(0, 2)) // Wave scaling multiplier of 2 for cost .withPreOptionPhase(async (scene: BattleScene): Promise => { diff --git a/src/data/mystery-encounters/mystery-encounter.ts b/src/data/mystery-encounters/mystery-encounter.ts index 99e58b7e3a1..87b80aba321 100644 --- a/src/data/mystery-encounters/mystery-encounter.ts +++ b/src/data/mystery-encounters/mystery-encounter.ts @@ -1,6 +1,11 @@ +import { EnemyPartyConfig } from "#app/data/mystery-encounters/mystery-encounter-utils"; +import Pokemon, { PlayerPokemon } from "#app/field/pokemon"; +import { isNullOrUndefined } from "#app/utils"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import BattleScene from "../../battle-scene"; import MysteryEncounterIntroVisuals, { MysteryEncounterSpriteConfig } from "../../field/mystery-encounter-intro"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import * as Utils from "../../utils"; +import { StatusEffect } from "../status-effect"; import MysteryEncounterDialogue, { allMysteryEncounterDialogue } from "./mystery-encounter-dialogue"; @@ -8,13 +13,11 @@ import MysteryEncounterOption, { MysteryEncounterOptionBuilder, OptionPhaseCallb import { EncounterPokemonRequirement, EncounterSceneRequirement, + HealthRatioRequirement, PartySizeRequirement, + StatusEffectRequirement, WaveRangeRequirement } from "./mystery-encounter-requirements"; -import * as Utils from "../../utils"; -import { EnemyPartyConfig } from "#app/data/mystery-encounters/mystery-encounter-utils"; -import Pokemon, { PlayerPokemon } from "#app/field/pokemon"; -import { isNullOrUndefined } from "#app/utils"; export enum MysteryEncounterVariant { DEFAULT, @@ -470,6 +473,14 @@ export class MysteryEncounterBuilder implements Partial { return Object.assign(this, { primaryPokemonRequirements: this.primaryPokemonRequirements }); } + withPrimaryPokemonStatusEffectRequirement(statusEffect: StatusEffect | StatusEffect[], minNumberOfPokemon: number = 1, invertQuery: boolean = false): this & Required> { + return this.withPrimaryPokemonRequirement(new StatusEffectRequirement(statusEffect, minNumberOfPokemon, invertQuery)); + } + + withPrimaryPokemonHealthRatioRequirement(requiredHealthRange: [number, number], minNumberOfPokemon: number = 1, invertQuery: boolean = false): this & Required> { + return this.withPrimaryPokemonRequirement(new HealthRatioRequirement(requiredHealthRange, minNumberOfPokemon, invertQuery)); + } + // TODO: Maybe add an optional parameter for excluding primary pokemon from the support cast? // ex. if your only grass type pokemon, a snivy, is chosen as primary, if the support pokemon requires a grass type, the event won't trigger because // it's already been