Skip to content

Carry over stats on level graduation#179

Merged
candour merged 1 commit into
mainfrom
carry-over-stats-on-graduation-3004768637858182183
Jun 3, 2026
Merged

Carry over stats on level graduation#179
candour merged 1 commit into
mainfrom
carry-over-stats-on-graduation-3004768637858182183

Conversation

@candour
Copy link
Copy Markdown
Owner

@candour candour commented Jun 3, 2026

Carries over the player's score, Kitchelin Stars, and 10% of their remaining gold when they graduate to a new level, instead of resetting these values.


PR created automatically by Jules for task 3004768637858182183 started by @candour

Summary by CodeRabbit

  • Improvements
    • Level progression now carries over your score and Michelin stars to the next level instead of resetting them.
    • Gold earned is partially preserved when advancing levels: you'll retain 10% of your previous gold plus a base amount, rewarding continued gameplay.

- Updated graduateToNextLevel in MainViewModel to preserve score and kitchelinStars.
- Updated gold calculation to include 10% of remaining gold from the previous level.
- Added GraduationCarryOverTest to verify the changes.

Co-authored-by: candour <4670475+candour@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR modifies the level-graduation mechanic to partially preserve player progression instead of performing a full reset. Gold now carries over 10% of the prior amount plus a base of 500, while score and kitchelinStars are explicitly preserved, maintaining some sense of continuity across level advances.

Changes

Graduation carry-over mechanics

Layer / File(s) Summary
Graduation carry-over implementation
app/src/main/java/com/messark/hawker/MainViewModel.kt
graduateToNextLevel() computes starting gold as 500 + (state.gold * 0.1f).toInt(), carries forward kitchelinStars, and preserves score instead of resetting these values.
Graduation carry-over test coverage
app/src/test/java/com/messark/hawker/GraduationCarryOverTest.kt
New test configures a StandardTestDispatcher, mocks repositories, initializes a MainViewModel, invokes graduateToNextLevel(), and asserts that the level increments while score, kitchelinStars, and computed gold (base + 10% carry-over) are correctly preserved.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Carry over stats on level graduation' directly and clearly summarizes the main change: preserving player stats (score, kitchelinStars, and partial gold) when advancing levels.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch carry-over-stats-on-graduation-3004768637858182183

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Build Successful! 🚀

Download APK

Note: This link will be removed when the PR is closed.

@candour candour merged commit f277f76 into main Jun 3, 2026
2 of 3 checks passed
@candour candour deleted the carry-over-stats-on-graduation-3004768637858182183 branch June 3, 2026 06:37
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.

1 participant