[Bug][Challenge][UI/UX] Exclude invalid starters when combining challenges #5509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed version of #5463
Why am I making these changes?
Until now, some edge cases were not handled properly. For example, Scyther can never be valid in a gen 2 mono-flying challenge: its base form is gen 1 although flying, while its evolution is gen 2 but not flying.
Other similar reports are on discord: here and here
With the current setup, the code first checks if Scyther or any evolutions are valid for the Gen 2 challenge, then it checks if Scyther or any evolutions are valid for the mono-flying challenge. Since the answer to both questions is "yes", Scyther is marked as a selectable starter.
What are the changes from a developer perspective?
Moving some logic from challenges.ts to the starter select screen. Instead of letting each challenge check the validity of evolutions and forms, now it is the starter select screen which checks, for each evolution and form, whether it is valid in all challenges.
This includes cutting down code in the
applyStarterChoice
of the mono-gen and mono-type challenges, and also removing thesoft
parameter altogether. This parameter decides whether the validity of the starter should include its evolutions and battle forms. Since it was only used in the starter select screen, it is now handled there.Screenshots/Videos
Scyther does not show up in Gen 2 mono-flying

Eevee does not show up in Gen 4 mono-fairy

Snorunt does not show up in Gen 3 mono-ghost

Rowlet does not show up in Gen 7 mono-fighting

How to test the changes?
Try out various combinations of challenges.
Checklist
beta
as my base branchnpm run test
)npm run create-test
) or updated existing tests related to the PR's changes?