Skip to content

Sync develop with main and resolve merge conflicts#54

Draft
Copilot wants to merge 48 commits intodevelopfrom
copilot/sub-pr-53
Draft

Sync develop with main and resolve merge conflicts#54
Copilot wants to merge 48 commits intodevelopfrom
copilot/sub-pr-53

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

This PR updates the stacked branch to perform the requested maindevelop sync and resolves the merge conflicts blocking integration. The resulting branch preserves main’s latest feature/test set while restoring a clean merge path into develop.

  • Merge direction and base correction

    • Rebased the working PR context onto develop and applied a non-fast-forward merge from main.
    • Produced a merge commit that represents the explicit branch sync requested in review comments.
  • Conflict resolution across diverged areas

    • Resolved content conflicts in docs, runtime modules, and tests where both branches had diverged.
    • Conflict files included:
      • README.md
      • src/fishE.py
      • src/location/shop.py
      • src/ui/userInterface.py
      • tests/location/test_shop.py
      • tests/location/test_tavern.py
      • tests/stats/test_statsJsonReaderWriter.py
      • tests/test_fishE.py
      • tests/ui/test_userInterface.py
  • Resulting integrated state

    • develop now receives the full set of main updates in one merge path, including save-file system changes, config additions, NPC/dialogue updates, and corresponding test coverage updates.
# Effective sync represented by this PR
git checkout develop
git merge --no-ff main
# (conflicts resolved in files listed above)

Copilot AI and others added 30 commits September 21, 2025 15:25
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>
dmccoystephenson and others added 16 commits February 1, 2026 17:28
…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
Copilot AI and others added 2 commits April 19, 2026 19:09
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Copilot AI changed the title [WIP] Sync develop with main Sync develop with main and resolve merge conflicts Apr 19, 2026
Copilot AI requested a review from dmccoystephenson April 19, 2026 19:11
@dmccoystephenson dmccoystephenson changed the base branch from main to develop April 19, 2026 19:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 the fishCount == 0 case. 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.

Comment thread src/ui/userInterface.py
self.divider()
print(" Day %d" % self.timeService.day)
print(" | " + self.times[self.timeService.time])
print(" | Money: $%d" % self.player.money)
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
print(" | Money: $%d" % self.player.money)
print(" | Money: $%.2f" % self.player.money)

Copilot uses AI. Check for mistakes.
Comment thread src/location/shop.py
def run(self):
li = [
"Sell Fish",
"Buy Better Bait ( $%d )" % self.player.priceForBait,
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"Buy Better Bait ( $%d )" % self.player.priceForBait,
"Buy Better Bait ( $%.2f )" % self.player.priceForBait,

Copilot uses AI. Check for mistakes.
Comment on lines 37 to 60
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

Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment thread src/fishE.py
Comment on lines +258 to +259
FishE = FishE()
FishE.play()
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

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().

Suggested change
FishE = FishE()
FishE.play()
game = FishE()
game.play()

Copilot uses AI. Check for mistakes.
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.

3 participants