Add a daily weather system that modifies fishing yield - #116
Merged
Conversation
Closes #72's deferred stretch goal: weather now rolls once per day (clear/rainy/stormy) alongside the existing time-of-day modifier, combining with it in Docks.fish() to give rain a catch bonus and storms a penalty. Persisted via TimeServiceJsonReaderWriter/schemas/timeService.json and surfaced in the docks descriptor and catch report. Closes #110 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
|
Self-review: implementation matches the issue's suggested design closely. Verified all three front-ends (console/pygame/web) treat the docks descriptor and currentPrompt.text as opaque strings passed through showOptions/prompt rendering, so no front-end-specific code was needed for this change - it only adds text through existing shared primitives. Schema and reader-writer stay in sync (weather round-trips and is validated against the new enum, with a test for an out-of-enum value raising ValidationError). No logic errors or missed edge cases found. (Posted as a plain PR comment rather than a formal GitHub review since gh pr review / the pulls reviews API were blocked as requiring interactive approval in this headless session.) |
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
weatherfield toTimeService, rolled once perincreaseDay()call from["clear", "rainy", "stormy"]— the deferred stretch half of Make time-of-day (and optionally weather) affect fishing #72, alongside the already-shipped time-of-day modifier.Docks.getWeatherModifier(weather)(same(factor, label)shape asgetTimeOfDayModifier) and combines it into thefishToAddcalculation inDocks.fish(): rain gives a catch bonus, storms a penalty, clear is neutral.Docks._weatherDescriptor) and in the catch report label after a fishing trip.weatherviaTimeServiceJsonReaderWriterand extendsschemas/timeService.jsonwith an enum so save validation stays in sync.Test plan
python3 -m compileall -q src testspython3 -m pytest --cov=src --cov-report=term-missing --cov-report=xml:cov.xml— 351 passedrandom.choicepatched for determinism), schema validation (valid + out-of-enum-value rejection), reader/writer round-trip,getWeatherModifier's three branches, the fishing-yield effect, the catch-report label, and the docks descriptor textshowOptions/prompt-text primitives already shared by all three front-ends (console/pygame/web) — no new UI primitive was needed, so no front-end-specific change was requiredCloses #110