mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 15:22:19 +02:00
Fixed logic to allow mons with no forms
This commit is contained in:
parent
a9ed02d45d
commit
aceb922073
@ -1299,31 +1299,29 @@ export function checkStarterValidForChallenge(species: PokemonSpecies, props: De
|
|||||||
* @returns True if the species is considered valid.
|
* @returns True if the species is considered valid.
|
||||||
*/
|
*/
|
||||||
function checkSpeciesValidForChallenge(species: PokemonSpecies, props: DexAttrProps, soft: boolean) {
|
function checkSpeciesValidForChallenge(species: PokemonSpecies, props: DexAttrProps, soft: boolean) {
|
||||||
if (!soft) {
|
if (!soft || !pokemonFormChanges.hasOwnProperty(species.speciesId)) {
|
||||||
const isValidForChallenge = new Utils.BooleanHolder(true);
|
const isValidForChallenge = new Utils.BooleanHolder(true);
|
||||||
applyChallenges(globalScene.gameMode, ChallengeType.STARTER_CHOICE, species, isValidForChallenge, props);
|
applyChallenges(globalScene.gameMode, ChallengeType.STARTER_CHOICE, species, isValidForChallenge, props);
|
||||||
return isValidForChallenge.value;
|
return isValidForChallenge.value;
|
||||||
}
|
}
|
||||||
if (pokemonFormChanges.hasOwnProperty(species.speciesId)) {
|
pokemonFormChanges[species.speciesId].forEach(f1 => {
|
||||||
pokemonFormChanges[species.speciesId].forEach(f1 => {
|
species.forms.forEach((f2, formIndex) => {
|
||||||
species.forms.forEach((f2, formIndex) => {
|
if (f1.formKey === f2.formKey) {
|
||||||
if (f1.formKey === f2.formKey) {
|
const formProps = { ...props };
|
||||||
const formProps = { ...props };
|
formProps.formIndex = formIndex;
|
||||||
formProps.formIndex = formIndex;
|
const isFormValidForChallenge = new Utils.BooleanHolder(true);
|
||||||
const isFormValidForChallenge = new Utils.BooleanHolder(true);
|
applyChallenges(
|
||||||
applyChallenges(
|
globalScene.gameMode,
|
||||||
globalScene.gameMode,
|
ChallengeType.STARTER_CHOICE,
|
||||||
ChallengeType.STARTER_CHOICE,
|
species,
|
||||||
species,
|
isFormValidForChallenge,
|
||||||
isFormValidForChallenge,
|
formProps,
|
||||||
formProps,
|
);
|
||||||
);
|
if (isFormValidForChallenge.value) {
|
||||||
if (isFormValidForChallenge.value) {
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user