Add a way to sell the fishing boat#114
Conversation
…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
left a comment
There was a problem hiding this comment.
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.
Summary
Every other major asset in the game can be sold back for cash (home tiers via
moveHome, investment properties viasellProperty), but the fishing boat was a one-way purchase with no resale path.resaleValue(70% of cost, matching the existing housing/investments ratio) to eachBOAT_TIERSentry insrc/business/business.pybusiness.sellBoat(player), refunding the current tier's resale value and clearinghasBoat/boatTier/workers(any remaining crew is dismissed since they'd have nowhere to work)Docks.manageBusiness()(src/location/docks.py), next to the existing "Dismiss a Worker" action, always available once a boat is ownedmanageBusinessmenu-index tests intests/location/test_docks.pyto account for the new menu option, and added dedicated tests forsellBoat(direct) and the menu actionCloses #108
Test plan
python3 -m compileall -q src testsSDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest --verbose -vv --cov=src --cov-report=term-missing --cov-report=xml:cov.xml— 335 passedDocks.manageBusiness()'s sharedBaseUserInterface.showOptionscall, so console/pygame/web all get it automatically (same pattern the recent Retire-option PR used)