From 933309cd000b43923f2865fd69a1effa5bf47a2b Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Thu, 26 Sep 2024 21:48:57 -0700 Subject: [PATCH] Fix Meloetta-related bugs in mono-type challenges (#4460) Remove Meloetta from the `TYPE_OVERRIDES` array so wrong-form Meloetta can't be sent into battle. This was missed when Meloetta was changed in a previous PR Also disallow Meloetta from being added to the party in starter select if it's in the wrong form for the current mono-type challenge --- src/data/challenge.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 1afbfc932dc..4cdaef7b1b3 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -527,18 +527,19 @@ interface monotypeOverride { */ export class SingleTypeChallenge extends Challenge { private static TYPE_OVERRIDES: monotypeOverride[] = [ - {species: Species.MELOETTA, type: Type.PSYCHIC, fusion: true}, {species: Species.CASTFORM, type: Type.NORMAL, fusion: false}, ]; + // TODO: Find a solution for all Pokemon with this ssui issue, including Basculin and Burmy + private static SPECIES_OVERRIDES: Species[] = [Species.MELOETTA]; constructor() { super(Challenges.SINGLE_TYPE, 18); } - applyStarterChoice(pokemon: PokemonSpecies, valid: Utils.BooleanHolder, dexAttr: DexAttrProps, soft: boolean = false): boolean { + override applyStarterChoice(pokemon: PokemonSpecies, valid: Utils.BooleanHolder, dexAttr: DexAttrProps, soft: boolean = false): boolean { const speciesForm = getPokemonSpeciesForm(pokemon.speciesId, dexAttr.formIndex); const types = [speciesForm.type1, speciesForm.type2]; - if (soft) { + if (soft && !SingleTypeChallenge.SPECIES_OVERRIDES.includes(pokemon.speciesId)) { const speciesToCheck = [pokemon.speciesId]; while (speciesToCheck.length) { const checking = speciesToCheck.pop();