Skip to content

Add a way to sell the fishing boat#114

Merged
dmccoystephenson merged 3 commits into
mainfrom
feature/sell-boat
Jul 18, 2026
Merged

Add a way to sell the fishing boat#114
dmccoystephenson merged 3 commits into
mainfrom
feature/sell-boat

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Every other major asset in the game can be sold back for cash (home tiers via moveHome, investment properties via sellProperty), but the fishing boat was a one-way purchase with no resale path.

  • Add resaleValue (70% of cost, matching the existing housing/investments ratio) to each BOAT_TIERS entry in src/business/business.py
  • Add business.sellBoat(player), refunding the current tier's resale value and clearing hasBoat/boatTier/workers (any remaining crew is dismissed since they'd have nowhere to work)
  • Wire a "Sell the Boat" action into Docks.manageBusiness() (src/location/docks.py), next to the existing "Dismiss a Worker" action, always available once a boat is owned
  • Updated existing manageBusiness menu-index tests in tests/location/test_docks.py to account for the new menu option, and added dedicated tests for sellBoat (direct) and the menu action

Closes #108

Test plan

  • python3 -m compileall -q src tests
  • SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest --verbose -vv --cov=src --cov-report=term-missing --cov-report=xml:cov.xml — 335 passed
  • No front-end-specific code touched — this flows entirely through Docks.manageBusiness()'s shared BaseUserInterface.showOptions call, so console/pygame/web all get it automatically (same pattern the recent Retire-option PR used)

dmccoystephenson and others added 3 commits July 18, 2026 19:46
…erns

Every other major asset (home tiers, investment properties) can be sold
back for cash, but the boat was a one-way purchase with no resale path.

- Add resaleValue (70% of cost, matching housing/investments) to each
  BOAT_TIERS entry
- Add business.sellBoat(player), refunding resale value and clearing
  hasBoat/boatTier/workers (dismissing any remaining crew)
- Wire a "Sell the Boat" action into Docks.manageBusiness(), next to
  the existing "Dismiss a Worker" action
- Add tests covering sellBoat directly and via the manageBusiness menu

Closes #108

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

@dmccoystephenson dmccoystephenson left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Self-review: implementation matches the issue's suggested fix closely (70% resale value matching housing/investments, sellBoat() mirrors sellProperty()'s shape, dismisses remaining crew since they'd have nowhere to work). Caught and fixed two things during review: (1) inserting the new menu option unconditionally shifted every subsequent option index in Docks.manageBusiness(), which required updating 8 existing test side_effect sequences to keep them passing rather than just adding new tests; (2) a stray unrelated autoflake edit (dead-code removal in an unrelated test) got picked up while running the repo's formatter and was reverted before pushing, to keep the diff scoped to issue #108. Also updated the README's Fishing Business section, which described buying/hiring but not the new sell option, matching how Home Ownership/Investment Properties already document their resale paths. Full suite (335 tests) passes after each change. No front-end-specific code was touched, since this flows through the shared BaseUserInterface.showOptions abstraction Docks.manageBusiness() already uses, so console/pygame/web all pick it up automatically.

@dmccoystephenson
dmccoystephenson merged commit a3496fd into main Jul 18, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feature/sell-boat branch July 18, 2026 22:36
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 a way to sell or downgrade the fishing boat, matching the housing and investments patterns

1 participant