Skip to content

Commit

Permalink
Fix Meloetta-related bugs in mono-type challenges (#4460)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DayKev authored Sep 27, 2024
1 parent c7f00d0 commit 933309c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/data/challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 933309c

Please sign in to comment.