Add Kitchelin Star gold bonus and free specific upgrades - #102
Conversation
- 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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughWalkthroughGold 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
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)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 2/3 reviews remaining, refill in 20 minutes. Comment |
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
app/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/main/java/com/messark/hawker/ui/components/UpgradeOverlay.ktapp/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>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt (1)
121-121:⚠️ Potential issue | 🟡 MinorRounding-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
📒 Files selected for processing (1)
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 deterministic unit tests for bonus and free upgrade logic. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt (1)
119-155:⚠️ Potential issue | 🟡 Minor
testGoldBonusRoundingDowninput 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. SinceMainViewModel.ktuses.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
📒 Files selected for processing (1)
app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt
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
Tests