Show the fleet, voyage and export record on the career ledger - #183
Merged
Conversation
totalHaulingContracts and totalTransportRuns were written to every save file and never incremented, so both were permanently zero while piracy had its raidDays recorded. _runHonestDay now counts the day under its own role, the way _runPiracyDay already does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Eleven lifetime totals were tracked and persisted but shown nowhere, so progress toward the plunder, export, boat-count and voyage milestones was invisible behind an unticked box. See Stats (and the retirement summary that reuses it) now carries a Fleet block and an Exports block, each gated on the lifetime totals rather than on what the player owns today, plus the drunken losses beside the gambling line. Total Money Made and the export gross are rendered with cents: an export market pays a fractional multiplier, so both are floats and %d was quietly truncating them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The new Fleet block is gated on the lifetime totals, but the business block above it was gated on owning a boat today - so a player who sold off their fleet saw its takings without the wages those takings were earned against. Gate the business block on ever having run a business instead. A player who never bought a boat still sees neither. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Restores the source half of the previous commit, which was reverted by a stray checkout while verifying that its test fails without it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The See Stats screen had never been documented, and it now carries the fleet and export record as well as the milestone checklist. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
Self-reviewScored adversarially against the diff and against command output, not against intent. Universal rubric
Repo-specific rubric
Findings raised and acted on during the review
Judgment calls left standing, disclosed rather than silently taken
This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Thirteen lifetime totals were being tracked on
Statsand written into every save file, while two of them were never produced and eleven were never shown. This PR closes both ends of that gap in the one subsystem.The two dead totals are now recorded.
totalHaulingContractsandtotalTransportRunshad no assignment anywhere insrc/— permanently zero — even thoughrunDailyProductionalready routes a piracy boat through_runPiracyDay(which fillsraidDays) and a freight or passenger boat through_runHonestDay(which recorded nothing role-specific)._runHonestDaynow counts the day under its own role, so freight and passenger work leave the same record piracy already did. Populating the fields was preferred over deleting them precisely because deletion would have meant touchingschemas/stats.jsonand a*JsonReaderWriter— save-file-compatibility-sensitive paths this change deliberately avoids.The ledger now shows what the boats did.
Home._statsLines()— reached via See Stats, and reused by the retirement summary — is the only career ledger in the game, and it named gambling and bank interest while leaving exporting, captaining and piracy invisible. A Fleet: block and an Exports: block have been added, plus the drunken losses beside the existing gambling line. Four milestones are thresholds on totals that were previously unshown (Scourge of the Coast,Coastal Trader,A Fleet in Truth,Old Hand at the Wheel), so progress toward them was readable only as an unticked box.Both blocks are gated on the lifetime totals rather than on what the player owns today, so a career that ended in a sold-off fleet still shows the fleet's record; a zero entry is dropped and a block with nothing left in it is omitted entirely, which is how the existing business and investment blocks behave. A brand-new game's ledger is therefore unchanged.
Two money lines now keep their cents. An export market pays a fractional multiplier (
1.2/1.5/2.0), sogross— and with ittotalMoneyMadeandtotalMoneyFromExports— is a float.%dwas silently truncating it, leaving the ledger permanently disagreeing with the$%.2fthe status header shows. The other%dmoney lines in the ledger were each traced to integer-only sources and left alone.Test plan
python3 -m pytestunder the dummy SDL drivers: 843 passed, up from 829 onmain(14 new tests, 0 failures)python3 -m compileall -q srcclean_runHonestDaychange stashed, and to pass with it restored_statsLineschange stashed, and to pass with it restoredblackrun against the four changed files only; no unrelated file was reformattedschemas/*.jsonand both*JsonReaderWriters are untouched, so existing saves load exactly as beforeCloses #180
Closes #181
Closes #182
Deferred this cycle
No other issue was open at triage; all three closed here were filed during this cycle's scan. One candidate examined and rejected rather than filed: the tavern's
Current Bet: $%dlooked like the same float-truncation bug, butchangeBetforces the bet integral withself.amount = int(amount)(src/location/tavern.py:286), so the display is correct as written.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson