Skip to content

Add the promised Retire option to the Home menu#112

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/retire-option
Jul 18, 2026
Merged

Add the promised Retire option to the Home menu#112
dmccoystephenson merged 1 commit into
mainfrom
feature/retire-option

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • The README and the in-game victory message both promise a "retire from the Home menu" flow once the $10,000 wealth goal is reached, but no such option existed anywhere in the code.
  • Home.run() now offers a Retire option, inserted before Quit, once achievements.GOAL_MILESTONE_NAME is present in stats.earnedMilestones (the same flag FishE.announceGoalIfReached already sets).
  • Selecting Retire shows a closing career summary (reusing the same stat lines displayStats() already assembles, factored into a shared _statsLines() helper) and ends the run the same way Quit does.
  • Moved the GOAL_AMOUNT/GOAL_MILESTONE_NAME constants from fishE.py into achievements/achievements.py so home.py can read them without a circular import (fishE.py already imports location.home); fishE.py re-imports them so fishE.GOAL_AMOUNT/fishE.GOAL_MILESTONE_NAME still resolve for existing callers/tests.

Test plan

  • python3 -m compileall -q src tests
  • python3 -m pytest -q --cov=src --cov-report=term-missing --cov-report=xml:cov.xml — 329 passed, home.py at 99% coverage
  • Added tests in tests/location/test_home.py: Retire hidden before the goal is reached, Retire appears and is selectable right before Quit after the goal is reached, Quit still works once the option list has shifted, and the retire summary includes the stat lines
  • Manually drove the flow end-to-end (mocked UI) to confirm the option list and dialogue content before/after the goal
  • Front-end parity: Home only calls the generic showOptions/showDialogue primitives (no per-frontend helper methods), which all three front-ends (console, pygame, web) already implement generically for any option list/dialogue text — no per-frontend changes were needed
  • No schemas/*.json changes needed — no new persisted fields were added, this only reuses the existing earnedMilestones list already covered by schemas/stats.json

Closes #107

… is reached

The README and in-game victory message both tell players they can retire
from the Home menu once they hit the $10,000 wealth goal, but no such
option existed. Retire now appears in the Home menu once the goal
milestone is earned, shows a closing career summary, and ends the run.

Closes #107

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

{
"body": "Self-review: no issues found. Verified the Retire option only appears once achievements.GOAL_MILESTONE_NAME is in stats.earnedMilestones, that Quit still resolves correctly whether it's option "5" or "6" depending on whether Retire is shown, that the constant move (fishE.py -> achievements.py) avoids a circular import between fishE.py and location/home.py while keeping fishE.GOAL_AMOUNT/fishE.GOAL_MILESTONE_NAME resolvable for existing tests, and that no per-frontend UI changes were needed since Home only calls the generic showOptions/showDialogue primitives already implemented by all three front-ends. Full suite (329 tests) passes; manually drove the flow end-to-end with a mocked UI to confirm the option list and dialogue content before/after the goal.",
"event": "COMMENT",
"comments": []
}

@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review: no issues found.

(Correcting the previous comment — that one accidentally posted the raw JSON body meant for the reviews API instead of its text.)

Verified:

  • The Retire option only appears once achievements.GOAL_MILESTONE_NAME is in stats.earnedMilestones.
  • Quit still resolves correctly whether it's option "5" or "6" depending on whether Retire is shown.
  • The constant move (fishE.py -> achievements.py) avoids a circular import between fishE.py and location/home.py, while keeping fishE.GOAL_AMOUNT/fishE.GOAL_MILESTONE_NAME resolvable for existing tests.
  • No per-frontend UI changes were needed since Home only calls the generic showOptions/showDialogue primitives already implemented by all three front-ends.
  • Full suite (329 tests) passes; manually drove the flow end-to-end with a mocked UI to confirm the option list and dialogue content before/after the goal.

@dmccoystephenson
dmccoystephenson requested a review from Copilot July 18, 2026 18:07
@dmccoystephenson
dmccoystephenson merged commit 328f865 into main Jul 18, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/retire-option branch July 18, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing “Retire from the Home menu” flow that is promised by the README and the in-game goal message, unlocking it only after the wealth-goal milestone has been earned.

Changes:

  • Adds a goal-gated Retire option to the Home menu and a retirement summary dialogue that ends the run.
  • Refactors Home stats rendering by factoring stat-line assembly into a shared helper used by both Stats and Retire flows.
  • Moves GOAL_AMOUNT / GOAL_MILESTONE_NAME constants into achievements/achievements.py and re-exports them from fishE.py; adds Home-menu coverage in tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/location/test_home.py Adds tests for Retire visibility/selection behavior and validates retirement summary content.
src/location/home.py Implements the Retire menu option (gated on earned milestone), adds retire() flow, and refactors stats lines into _statsLines().
src/fishE.py Imports goal constants from achievements to avoid circular imports while keeping fishE.GOAL_* available to callers/tests.
src/achievements/achievements.py Defines goal constants alongside milestone definitions so Home and FishE can share them.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/location/home.py
self.currentPrompt.text = "What would you like to do?"
return LocationType.DOCKS
elif self.input == "5":
elif retireAvailable and self.input == "5":
Comment thread src/location/home.py
self.userInterface.showDialogue("\n".join(self._statsLines()))

def retire(self):
"""Show a closing summary and end the run, reusing displayStats()'s lines."""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the promised Retire option to the Home menu after the wealth goal is reached

2 participants