mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +02:00
[Bug][UI/UX] Make sure forms and evolutions are counted in challenges again (#5617)
Making sure to actually count forms...
This commit is contained in:
parent
a7394130a7
commit
db7ed43ad7
@ -1272,23 +1272,22 @@ function checkSpeciesValidForChallenge(species: PokemonSpecies, props: DexAttrPr
|
|||||||
if (soft && isValidForChallenge.value) {
|
if (soft && isValidForChallenge.value) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
pokemonFormChanges[species.speciesId].forEach(f1 => {
|
|
||||||
// Exclude form changes that require the mon to be on the field to begin with,
|
const result = pokemonFormChanges[species.speciesId].some(f1 => {
|
||||||
// such as Castform
|
// Exclude form changes that require the mon to be on the field to begin with
|
||||||
if (!("item" in f1)) {
|
if (!("item" in f1.trigger)) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
species.forms.forEach((f2, formIndex) => {
|
|
||||||
|
return species.forms.some((f2, formIndex) => {
|
||||||
if (f1.formKey === f2.formKey) {
|
if (f1.formKey === f2.formKey) {
|
||||||
const formProps = { ...props };
|
const formProps = { ...props, formIndex };
|
||||||
formProps.formIndex = formIndex;
|
|
||||||
const isFormValidForChallenge = new Utils.BooleanHolder(true);
|
const isFormValidForChallenge = new Utils.BooleanHolder(true);
|
||||||
applyChallenges(ChallengeType.STARTER_CHOICE, species, isFormValidForChallenge, formProps);
|
applyChallenges(ChallengeType.STARTER_CHOICE, species, isFormValidForChallenge, formProps);
|
||||||
if (isFormValidForChallenge.value) {
|
return isFormValidForChallenge.value;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return false;
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user