mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 08:16:04 +00:00
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
This commit is contained in:
parent
c7f00d0a4d
commit
933309cd00
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user