Skip to content

Add Kitchelin Star gold bonus and free specific upgrades - #102

Merged
candour merged 3 commits into
mainfrom
kitchelin-star-bonuses-5681612224709128139
Apr 29, 2026
Merged

Add Kitchelin Star gold bonus and free specific upgrades#102
candour merged 3 commits into
mainfrom
kitchelin-star-bonuses-5681612224709128139

Conversation

@candour

@candour candour commented Apr 29, 2026

Copy link
Copy Markdown
Owner

This change implements a 5% gold bonus per Kitchelin Star when defeating enemies and makes specific upgrades free when a Kitchelin Star is available. It also ensures the UI reflects these changes.


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

Summary by CodeRabbit

  • New Features

    • Kitchelin stars grant bonus gold on enemy defeat: +5% per star (bonus is rounded down).
    • When you have Kitchelin stars, specific stall upgrades cost no gold and consume one star on use; otherwise specific upgrades retain their higher cost.
  • Tests

    • Added tests verifying Kitchelin star gold bonuses, rounding behavior, and free specific-upgrade consumption.

- Implement 5% additive gold bonus per Kitchelin Star on enemy defeats.
- Make specific stall upgrades free if a Kitchelin Star is available.
- Update UpgradeOverlay UI to show $0 cost when stars are available.
- Add unit tests for bonus and free upgrade logic.

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

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Gold rewards on enemy death now include a kitchelin-star scaled bonus (5% per star, integer-rounded). Specific stall upgrades become free (cost = 0) when the player has >0 kitchelinStars; otherwise they keep the doubled cost. Tests for these behaviors were added.

Changes

Cohort / File(s) Summary
ViewModel logic
app/src/main/java/com/messark/hawker/MainViewModel.kt
Enemy gold reward now adds a kitchelin-star bonus (5% per star, floored integer). Specific-stall upgrade cost set to 0 when state.kitchelinStars > 0; else previous doubled cost applies.
UI: Upgrade overlay
app/src/main/java/com/messark/hawker/ui/components/UpgradeOverlay.kt
Specific-upgrade button cost & enabled state now reflect kitchelinStars (cost shown as $0 and enabled without gold when stars > 0); otherwise cost remains double base.
Tests
app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt
New JUnit suite exercising: gold bonus on enemy kill, rounding-down behavior of bonus, and free specific-upgrade consumption of one kitchelin star without spending gold. Uses coroutine test dispatcher and mocked repos.

Sequence Diagram(s)

(Skipped — changes are localized ViewModel/UI logic and tests; no multi-component sequential flow requiring visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% 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 accurately summarizes the main changes: adding a Kitchelin Star gold bonus on enemy kills and making specific upgrades free when stars are available.
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 kitchelin-star-bonuses-5681612224709128139

Review rate limit: 2/3 reviews remaining, refill in 20 minutes.

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

@github-actions

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e6d9a5f8-0351-4a1a-9d9a-38ea95c04732

📥 Commits

Reviewing files that changed from the base of the PR and between 53b4e52 and eece538.

📒 Files selected for processing (3)
  • app/src/main/java/com/messark/hawker/MainViewModel.kt
  • app/src/main/java/com/messark/hawker/ui/components/UpgradeOverlay.kt
  • app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt

Comment thread app/src/main/java/com/messark/hawker/MainViewModel.kt
Comment thread app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt
Comment thread app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt
- Implement 5% additive gold bonus per Kitchelin Star on enemy defeats.
- Make specific stall upgrades free if a Kitchelin Star is available.
- Update UpgradeOverlay UI to show $0 cost when stars are available.
- Add unit tests for bonus and free upgrade logic, including proper dispatcher cleanup.

Co-authored-by: candour <4670475+candour@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt (1)

121-121: ⚠️ Potential issue | 🟡 Minor

Rounding-down test input still does not distinguish truncation vs rounding.

Line 129 uses reward = 25, which won’t fail if bonus math changes from truncation to rounding. Use a value where outcomes diverge.

Suggested change
-        // Reward 25, 1 star = 5% of 25 = 1.25 -> 1
+        // Reward 10, 1 star = 5% of 10 = 0.5 -> 0 with truncation/floor
@@
-            reward = 25,
+            reward = 10,
@@
-        // Reward 25 + floor(25 * 0.05) = 25 + 1 = 26
-        assertEquals(26, viewModel.gameState.value.gold)
+        // Reward 10 + floor(10 * 0.05) = 10 + 0 = 10
+        assertEquals(10, viewModel.gameState.value.gold)

Also applies to: 129-129, 153-154


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e5742dee-80ce-4071-a108-3b5c79c4095e

📥 Commits

Reviewing files that changed from the base of the PR and between eece538 and a03571f.

📒 Files selected for processing (1)
  • app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt

Comment thread app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt Outdated
- Implement 5% additive gold bonus per Kitchelin Star on enemy defeats.
- Make specific stall upgrades free if a Kitchelin Star is available.
- Update UpgradeOverlay UI to show $0 cost when stars are available.
- Add deterministic unit tests for bonus and free upgrade logic.

Co-authored-by: candour <4670475+candour@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt (1)

119-155: ⚠️ Potential issue | 🟡 Minor

testGoldBonusRoundingDown input does not prove truncation behavior.

With Line 129 reward = 25, both truncation and nearest-rounding produce +1, so this test can pass with incorrect rounding logic. Since MainViewModel.kt uses .toInt() truncation in the bonus calculation (Line 750-760), use an input where truncation and rounding differ.

Suggested test adjustment
-        // Reward 25, 1 star = 5% of 25 = 1.25 -> 1
+        // Reward 30, 1 star = 5% of 30 = 1.5 -> truncates to 1
@@
-            reward = 25,
+            reward = 30,
@@
-        // Reward 25 + floor(25 * 0.05) = 25 + 1 = 26
-        assertEquals(26, viewModel.gameState.value.gold)
+        // Reward 30 + trunc(30 * 0.05) = 30 + 1 = 31
+        assertEquals(31, viewModel.gameState.value.gold)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b3f6abd-789f-41f2-a5e2-62953256b5c7

📥 Commits

Reviewing files that changed from the base of the PR and between a03571f and 1ed88b2.

📒 Files selected for processing (1)
  • app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt

@candour
candour merged commit 6033318 into main Apr 29, 2026
3 checks passed
@candour
candour deleted the kitchelin-star-bonuses-5681612224709128139 branch April 29, 2026 09:33
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