Sync develop with main and resolve merge conflicts#54
Sync develop with main and resolve merge conflicts#54
develop with main and resolve merge conflicts#54Conversation
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…umes 10 per hour, sleep restores full energy Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…44c1-4436-af95-28a92b47c66b Implement Energy System - Player energy depletes when fishing and restores when sleeping
…20a9-4a51-9e54-ce58430cdf33 Fix recursive gambling issue causing multiple "Go Back" selections - resolves #22
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…d705-44d8-9b09-eff13cb14b98 Fix player being informed they won $0 when winning dice rolls at the Tavern
…143c-46e3-9d11-04ae22aa78a7 Allow decimal values for bank deposits and withdrawals
…a9f6-4aa1-ae17-c4129e6f261c Create Config class to hold configuration options
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…ests Expand unit test coverage and add CI workflow for automated testing
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…ace, improve tests Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…ckgrounds Add named NPCs with backstories and dialogue system
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…interactive Add interactive timing minigame to fishing activity
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
… coverage Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…ue-options Add interactive dialogue system for NPC tutorials
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…dd migration Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…save-files-support Add multiple save file support with save slot management
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
develop with main and resolve merge conflicts
There was a problem hiding this comment.
Pull request overview
This PR syncs develop with main and resolves merge conflicts while integrating main’s latest gameplay/state changes (multi-slot saves, energy, NPC dialogue) plus updated unit tests and CI.
Changes:
- Introduces multi-slot save management (migration from legacy
data/*.json, slot selection, deletion) and updates persistence paths accordingly. - Adds/extends gameplay features (player energy, interactive fishing minigame, NPC dialogue interactions across locations) and updates UI implementation/tests.
- Adds GitHub Actions workflow to run pytest with coverage reporting.
Reviewed changes
Copilot reviewed 30 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/world/test_timeServiceJsonReaderWriter.py | Adds read/write-to-file tests for TimeService JSON IO. |
| tests/ui/test_userInterface.py | Updates UI tests to new UserInterface implementation and adds dialogue/menu coverage. |
| tests/test_saveFileManager.py | Adds comprehensive tests for new SaveFileManager. |
| tests/test_fishE.py | Updates FishE initialization tests for new save/UI wiring. |
| tests/stats/test_statsJsonReaderWriter.py | Updates stats JSON RW tests and adds file IO tests (but drops coverage for one stat field). |
| tests/prompt/test_prompt.py | Adds basic tests for Prompt. |
| tests/player/test_playerJsonReaderWriter.py | Adds energy to player JSON tests and adds file IO tests + backward-compat test. |
| tests/player/test_player.py | Asserts default energy initialization. |
| tests/npc/test_npc.py | Adds tests for new NPC model and dialogue helpers. |
| tests/location/test_tavern.py | Updates tavern tests for NPC interaction and gamble/bet flow changes. |
| tests/location/test_shop.py | Updates shop tests for NPC interaction and revised shop behavior. |
| tests/location/test_home.py | Updates sleep tests to assert energy restoration. |
| tests/location/test_docks.py | Updates docks tests for NPC interaction, energy gating, and interactive fishing behavior. |
| tests/location/test_bank.py | Updates bank tests and adds decimal deposit/withdraw tests. |
| tests/config/test_config.py | Adds tests for new Config defaults. |
| src/ui/userInterface.py | Replaces backward-compat alias with a concrete UserInterface including interactive NPC dialogue UI. |
| src/saveFileManager.py | Adds SaveFileManager to manage multiple save slots + legacy migration. |
| src/player/playerJsonReaderWriter.py | Persists energy and supports backward-compatible loads. |
| src/player/player.py | Adds energy attribute to Player. |
| src/npc/npc.py | Adds NPC model with dialogue options/responses. |
| src/npc/init.py | Package marker for NPC module. |
| src/location/tavern.py | Adds tavern NPC interaction; fixes gamble win message; removes recursive bet-change behavior. |
| src/location/shop.py | Adds shop NPC interaction; adjusts menu/options and sell/buy logic. |
| src/location/home.py | Restores player energy on sleep and updates prompt text. |
| src/location/docks.py | Adds docks NPC interaction; adds energy gating and interactive fishing success-rate mechanic. |
| src/location/bank.py | Adds bank NPC interaction; changes deposit/withdraw to accept decimal amounts. |
| src/fishE.py | Integrates SaveFileManager, save-slot selection UI, and updates save/load paths; removes UI factory/CLI arg handling. |
| src/config/config.py | Adds Config class for save paths and initial player defaults. |
| src/config/init.py | Package marker for config module. |
| schemas/player.json | Adds energy to player schema and marks it required. |
| README.md | Updates README (adds CI badge; documents multiple save slots; removes UI-type instructions). |
| .gitignore | Ignores data/ directory and __pycache__/. |
| .github/workflows/test.yml | Adds CI workflow running pytest + coverage and uploading report. |
Comments suppressed due to low confidence (1)
src/location/shop.py:103
sellFish()no longer handles thefishCount == 0case. As written, a player with zero fish will still see "You sold all of your fish!" (and the method will run all the bookkeeping), which is misleading and diverges from the prior behavior/tests. Add an early return with an appropriate prompt when there are no fish to sell.
def sellFish(self):
moneyToAdd = self.player.fishCount * random.randint(3, 5)
self.player.money += moneyToAdd
self.stats.totalMoneyMade += moneyToAdd
self.player.fishCount = 0
self.currentPrompt.text = "You sold all of your fish!"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.divider() | ||
| print(" Day %d" % self.timeService.day) | ||
| print(" | " + self.times[self.timeService.time]) | ||
| print(" | Money: $%d" % self.player.money) |
There was a problem hiding this comment.
showOptions formats self.player.money with %d, but player.money can become a float (e.g., Bank.deposit/withdraw now parses amounts as float). This will raise a TypeError the next time the menu renders. Update money formatting to handle decimals consistently (e.g., %.2f) or ensure money is always stored as an int (cents).
| print(" | Money: $%d" % self.player.money) | |
| print(" | Money: $%.2f" % self.player.money) |
| def run(self): | ||
| li = [ | ||
| "Sell Fish", | ||
| "Buy Better Bait ( $%d )" % self.player.priceForBait, |
There was a problem hiding this comment.
The menu label uses $%d to format self.player.priceForBait, but buyBetterBait() multiplies it by 1.25, turning it into a float (e.g., 62.5). On the next run() call this %d formatting will throw TypeError. Use a float-safe format (e.g., %.2f) or round/cast the price back to an int when updating it.
| "Buy Better Bait ( $%d )" % self.player.priceForBait, | |
| "Buy Better Bait ( $%.2f )" % self.player.priceForBait, |
| def test_createStatsFromJson(): | ||
| statsJsonReaderWriter = createStatsJsonReaderWriter() | ||
| statsJson = { | ||
| "totalFishCaught": 2, | ||
| "totalMoneyMade": 2, | ||
| "hoursSpentFishing": 2, | ||
| "moneyMadeFromInterest": 2, | ||
| "timesGottenDrunk": 2, | ||
| "moneyLostFromGambling": 2, | ||
| "moneyLostWhileDrunk": 5, | ||
| } | ||
|
|
||
| # validate | ||
| statsSchema = getStatsSchema() | ||
| validate(statsJson, statsSchema) | ||
|
|
||
| statsFromJson = statsJsonReaderWriter.createStatsFromJson(statsJson) | ||
| assert statsFromJson != None | ||
| assert statsFromJson.totalFishCaught == 2 | ||
| assert statsFromJson.totalMoneyMade == 2 | ||
| assert statsFromJson.hoursSpentFishing == 2 | ||
| assert statsFromJson.moneyMadeFromInterest == 2 | ||
| assert statsFromJson.timesGottenDrunk == 2 | ||
| assert statsFromJson.moneyLostFromGambling == 2 | ||
| assert statsFromJson.moneyLostWhileDrunk == 5 | ||
|
|
There was a problem hiding this comment.
test_createStatsFromJson no longer includes/asserts moneyLostWhileDrunk, even though Stats and StatsJsonReaderWriter still support this field (and the schema defines it). This leaves the parsing behavior for moneyLostWhileDrunk untested and makes it easier to accidentally break save compatibility. Consider restoring the field in the fixture and asserting it is populated correctly (and/or keeping a backward-compat test for the default behavior).
| FishE = FishE() | ||
| FishE.play() |
There was a problem hiding this comment.
In the __main__ block the class name is reassigned to an instance (FishE = FishE()), which shadows the class and makes debugging/importing harder. Use a lower-cased instance variable name (e.g., game = FishE()) and call game.play().
| FishE = FishE() | |
| FishE.play() | |
| game = FishE() | |
| game.play() |
This PR updates the stacked branch to perform the requested
main→developsync and resolves the merge conflicts blocking integration. The resulting branch preservesmain’s latest feature/test set while restoring a clean merge path intodevelop.Merge direction and base correction
developand applied a non-fast-forward merge frommain.Conflict resolution across diverged areas
README.mdsrc/fishE.pysrc/location/shop.pysrc/ui/userInterface.pytests/location/test_shop.pytests/location/test_tavern.pytests/stats/test_statsJsonReaderWriter.pytests/test_fishE.pytests/ui/test_userInterface.pyResulting integrated state
developnow receives the full set ofmainupdates in one merge path, including save-file system changes, config additions, NPC/dialogue updates, and corresponding test coverage updates.