Skip to content

feat: restrict the egg hatch pool to selected regions #469

Open

Description

@YeongHyeon-Kim

Summary

Eggs currently hatch from the whole Gen 1–5 base-species pool. There is no way to say "I only want to raise Pokémon from the generations I actually care about". I'd like a setting that restricts the hatch pool to the regions I pick, while leaving everything else about the balance untouched.

This is the counterpart to #442 / #440: those track what I have collected per generation; this one controls what can hatch in the first place.

Proposal

1. Region selection in Settings

  • A multi-select of the five regions already modelled by PokedexRegion (Kanto · Johto · Hoenn · Sinnoh · Unova), all enabled by default so existing behaviour is unchanged.
  • Candidate base species are filtered to the selected regions in chooseBase(), before the existing capture-rate weighting runs. Rarity weighting, guaranteed-tier eggs, shiny odds, natures and growth thresholds all stay exactly as they are.

2. Guard rails

  • At least one region must stay selected; the UI refuses to clear the last one.
  • If the filtered candidate list ends up empty (for example a guaranteed-tier egg whose tier has no match inside the chosen regions), keep the egg and retry on the next tick instead of silently falling back to the full pool. This mirrors how the existing tier guarantee already behaves.
  • The REST fallback path (chooseBaseViaREST) needs the same filter, otherwise the restriction silently breaks whenever the GraphQL base index is unavailable.

3. Interaction with existing goals

  • Regional dex badges from feat(pokedex): track per-generation dex completion with cosmetic badges #442 for unselected regions become unreachable by hatching. The Settings copy should say so plainly, and the National badge likewise.
  • Species with multiple collectible forms (the PokemonForm catalog, plus the 28 Unown forms) are unaffected: they stay hatchable as long as their own region is selected.

Why

  • Players who care about a specific era get to actually play that era. Picking Gen 1–4 only, or Kanto only, is a common way people enjoy these games.
  • Scope is small. PokedexRegion from feat(pokedex): track per-generation dex completion with cosmetic badges #442 already defines the dex ranges, so no new concept or PokéAPI call is needed; membership is pure arithmetic on the National Dex number.
  • It changes which species are candidates, not the odds among them, so it cannot be used to farm rarity. A player restricting themselves to one region strictly shrinks their own collection ceiling.

Prior art / motivation

I have been running this locally for a while by filtering the cached base-index.json from outside the app and pinning its fetchedAt so the 30-day TTL never refreshes it. It works, but it is a hack: it breaks on the REST fallback path, it has to be re-applied by hand, and it is invisible to the app. A real setting would be far better, and I suspect I am not the only one doing something like this.

Related

Happy to implement this and open a PR with tests if the direction sounds good. I'd want a maintainer's call on two things first: whether the setting belongs in Settings → Companion or alongside the Pokédex goals, and whether changing the selection mid-incubation should discard an already pre-rolled pendingHatchID that now falls outside the selection (I'd lean yes, so the change takes effect immediately).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions