From 89f46e2b1276ffeb2f22be8a87bd4af6fdb282b3 Mon Sep 17 00:00:00 2001 From: Julian Tabel Date: Mon, 9 Feb 2026 10:16:13 +0100 Subject: [PATCH] Add HoF team selection and genlocke retirement integration beans The current retireHoF logic retires all alive Pokemon instead of just the HoF team. Add beans to track the fix: a general HoF team selection feature for all runs, and a follow-up task to integrate it into genlocke retirement logic. Co-Authored-By: Claude Opus 4.6 --- ...w9s--gauntlet-rule-option-for-genlockes.md | 4 +- ...m-for-genlocke-retirement-instead-of-al.md | 40 ++++++++++++++++ ...ke-tracker-x4p6--genlocke-overview-page.md | 5 +- ...acker-xbxv--hall-of-fame-team-selection.md | 46 +++++++++++++++++++ 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 .beans/nuzlocke-tracker-h3fw--use-hof-team-for-genlocke-retirement-instead-of-al.md create mode 100644 .beans/nuzlocke-tracker-xbxv--hall-of-fame-team-selection.md diff --git a/.beans/nuzlocke-tracker-8w9s--gauntlet-rule-option-for-genlockes.md b/.beans/nuzlocke-tracker-8w9s--gauntlet-rule-option-for-genlockes.md index e3d3ecd..dd1a058 100644 --- a/.beans/nuzlocke-tracker-8w9s--gauntlet-rule-option-for-genlockes.md +++ b/.beans/nuzlocke-tracker-8w9s--gauntlet-rule-option-for-genlockes.md @@ -1,11 +1,11 @@ --- # nuzlocke-tracker-8w9s title: Gauntlet rule option for genlockes -status: in-progress +status: completed type: feature priority: normal created_at: 2026-02-08T19:15:43Z -updated_at: 2026-02-09T08:56:55Z +updated_at: 2026-02-09T09:05:12Z parent: nuzlocke-tracker-25mh --- diff --git a/.beans/nuzlocke-tracker-h3fw--use-hof-team-for-genlocke-retirement-instead-of-al.md b/.beans/nuzlocke-tracker-h3fw--use-hof-team-for-genlocke-retirement-instead-of-al.md new file mode 100644 index 0000000..8a4f004 --- /dev/null +++ b/.beans/nuzlocke-tracker-h3fw--use-hof-team-for-genlocke-retirement-instead-of-al.md @@ -0,0 +1,40 @@ +--- +# nuzlocke-tracker-h3fw +title: Use HoF team for genlocke retirement instead of all alive Pokemon +status: todo +type: task +priority: normal +created_at: 2026-02-09T09:15:00Z +updated_at: 2026-02-09T09:15:03Z +parent: nuzlocke-tracker-8w9s +blocking: + - nuzlocke-tracker-25mh +--- + +The current retireHoF implementation in `advance_leg()` retires ALL alive, non-shiny, caught Pokemon from the completed run. This is incorrect — only the Hall of Fame team (up to 6 Pokemon selected by the player) should be retired. + +## Current behavior +```python +# genlockes.py — retires everything alive +select(Encounter.pokemon_id).where( + Encounter.run_id == current_leg.run_id, + Encounter.status == "caught", + Encounter.faint_level.is_(None), + Encounter.is_shiny.is_(False), +) +``` + +## Desired behavior +- If the run has `hof_encounter_ids` set, use those encounter IDs to determine which Pokemon to retire +- If `hof_encounter_ids` is not set (legacy/skipped), fall back to the current "all alive" behavior for backwards compatibility +- Only the HoF team members and their evolutionary families get added to the retired list + +## Changes needed +- Update `advance_leg()` in `backend/src/app/api/genlockes.py` to check `current_run.hof_encounter_ids` first +- If present, query only those encounters for retirement +- If absent, keep the current fallback query +- Update the frontend `RunEncounters.tsx` to also scope `retiredPokemonIds` correctly (no change needed — it reads from the backend response) + +## Checklist +- [ ] Update `advance_leg()` to prefer `hof_encounter_ids` over all-alive query +- [ ] Verify backwards compatibility when `hof_encounter_ids` is null \ No newline at end of file diff --git a/.beans/nuzlocke-tracker-x4p6--genlocke-overview-page.md b/.beans/nuzlocke-tracker-x4p6--genlocke-overview-page.md index 906dc88..54793aa 100644 --- a/.beans/nuzlocke-tracker-x4p6--genlocke-overview-page.md +++ b/.beans/nuzlocke-tracker-x4p6--genlocke-overview-page.md @@ -5,8 +5,11 @@ status: todo type: feature priority: normal created_at: 2026-02-09T07:42:19Z -updated_at: 2026-02-09T07:45:45Z +updated_at: 2026-02-09T09:07:40Z parent: nuzlocke-tracker-25mh +blocking: + - nuzlocke-tracker-lsc2 + - nuzlocke-tracker-lsdy --- A dedicated dashboard page for a genlocke, showing progress, configuration, and cumulative stats across all legs. diff --git a/.beans/nuzlocke-tracker-xbxv--hall-of-fame-team-selection.md b/.beans/nuzlocke-tracker-xbxv--hall-of-fame-team-selection.md new file mode 100644 index 0000000..5094a31 --- /dev/null +++ b/.beans/nuzlocke-tracker-xbxv--hall-of-fame-team-selection.md @@ -0,0 +1,46 @@ +--- +# nuzlocke-tracker-xbxv +title: Hall of Fame team selection +status: todo +type: feature +priority: normal +created_at: 2026-02-09T09:14:44Z +updated_at: 2026-02-09T09:15:08Z +blocking: + - nuzlocke-tracker-25mh + - nuzlocke-tracker-h3fw +--- + +When a nuzlocke run is completed (status → completed), prompt the player to select which Pokemon were in their Hall of Fame team — the party of up to 6 that beat the Elite Four and Champion. + +This is a general nuzlocke feature (not genlocke-specific) and provides value on its own: +- Interesting stats: which Pokemon enter the HoF most often across runs +- Run summary: display the HoF team prominently on the completed run page +- Foundation for genlocke retireHoF logic (only retire HoF team, not all alive Pokemon) + +## Behavior +- After marking a run as completed, show a modal/step asking the player to pick their HoF team from all alive Pokemon +- Max 6 Pokemon can be selected +- Store the selection as a list of encounter IDs on the run (or a join table) +- The HoF team should be displayed prominently on the completed run page (e.g. in the victory banner) +- Selection is optional — if skipped, all alive Pokemon are assumed to be in the HoF (backwards-compatible) + +## Backend +- Add `hof_team` JSONB column (array of encounter IDs) to `nuzlocke_runs`, or a `hof_encounters` join table +- New endpoint or extend `PATCH /runs/{id}` to accept HoF team selection +- Include HoF team data in `GET /runs/{id}` response + +## Frontend +- After the EndRunModal confirms "completed", show a HoF team selection step +- Display alive Pokemon as selectable cards (max 6) +- Show the selected HoF team in the victory banner on the completed run page +- Allow editing the HoF team after the fact (in case the player forgot or made a mistake) + +## Checklist +- [ ] Add `hof_encounter_ids` JSONB column to `nuzlocke_runs` (nullable array of ints) +- [ ] Migration for the new column +- [ ] Update `RunResponse` / `RunDetailResponse` schemas to include `hofEncounterIds` +- [ ] Extend `PATCH /runs/{id}` to accept `hofEncounterIds` (validate they belong to the run and are alive) +- [ ] Build HoF team selection modal (shown after completing a run) +- [ ] Display HoF team in the victory banner on completed run pages +- [ ] Allow editing HoF team selection on completed runs \ No newline at end of file