Kitchelin Stars and Manual Upgrade System#98
Conversation
- Earn Kitchelin Stars every 10 waves. - Display up to 5 stars in the top-left of the game screen. - Added UpgradeOverlay for manual stall upgrades between waves. - Specific upgrades cost 2x and disable the stall for one wave unless a star is used. - Visualize disabled stalls with an orange cone sprite. - Persist Kitchelin Star count in gamestate.json. 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. |
📝 WalkthroughWalkthroughAdds a between-wave upgrade overlay (random or specific stat upgrades) and a Kitchelin star system; stalls gain a Changes
Sequence DiagramsequenceDiagram
participant User
participant UI as MainActivity / UpgradeOverlay
participant VM as MainViewModel
participant GS as GameState / Repo
participant Board as GameBoard
User->>UI: Open upgrade (select stall)
UI->>VM: request upgrade (upgradeStall)
alt waveActive == true
VM->>VM: applyUpgrade(isSpecific=false/true)
VM->>GS: mutate stall, gold, stars, disabledWaves
VM->>Board: updated stall state (disabledWaves affects rendering)
VM->>UI: close overlay
else between-waves
VM->>GS: set showUpgradeOverlay = true
GS->>UI: render UpgradeOverlay with stall + gold + kitchelinStars
User->>UI: click Random/Specific
UI->>VM: onUpgradeRandom / onUpgradeSpecific(stat)
VM->>VM: applyUpgrade(...)
VM->>GS: persist changes (gold, stars, stall.disabledWaves)
VM->>GS: set showUpgradeOverlay = false
GS->>UI: dismiss overlay
end
Note over VM,GS: Wave completion path\n(every 10 waves -> kitchelinStars++, all stalls disabledWaves--)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 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)
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/messark/hawker/MainViewModel.kt (1)
913-1168:⚠️ Potential issue | 🟠 MajorPersist successful manual upgrades immediately.
applyUpgrade()now mutates persisted progression state between waves (gold,kitchelinStars,disabledWaves, upgrade levels,totalInvestment), but the only save in this file still happens on wave completion. If the app is backgrounded or killed after a manual upgrade and before the next wave ends, the player resumes from the pre-upgrade save and effectively rolls back the purchase. Save the updatedGameStateright after a successful between-wave upgrade.Based on learnings, "Use GameStateRepository to manage gamestate.json via GSON for auto-saving after each wave".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 58923aae-4f8e-4ffc-b78b-3625b0f8a74c
📒 Files selected for processing (6)
app/src/main/java/com/messark/hawker/MainActivity.ktapp/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/main/java/com/messark/hawker/model/GameModels.ktapp/src/main/java/com/messark/hawker/ui/components/GameBoard.ktapp/src/main/java/com/messark/hawker/ui/components/UpgradeOverlay.ktapp/src/main/java/com/messark/hawker/utils/GameStateRepository.kt
|
@jules please deal with the two PR comments |
- Use Icons.Default.Star for Kitchelin Stars display to avoid issues with missing emoji support in the app's font/environment. - Centralize orange cone sprite coordinates in SpriteConstants. 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
🧹 Nitpick comments (1)
app/src/main/java/com/messark/hawker/MainActivity.kt (1)
682-697: Derive a singlecanShowUpgradeOverlayguard.Consider enforcing all UI preconditions (
showUpgradeOverlay, selected stall exists, and wave inactive) in one derived boolean before rendering the overlay. It keeps the “between waves” invariant explicit at the UI boundary.♻️ Suggested refactor
- if (gameState.showUpgradeOverlay) { - gameState.selectedBoardStall?.let { coord -> - gameState.hexes[coord]?.stall?.let { stall -> - UpgradeOverlay( - stall = stall, - gold = gameState.gold, - kitchelinStars = gameState.kitchelinStars, - onUpgradeRandom = { viewModel.upgradeStallRandomly() }, - onUpgradeSpecific = { viewModel.upgradeStallSpecifically(it) }, - onDismiss = { viewModel.dismissUpgradeOverlay() }, - onTriggerHaptic = { viewModel.triggerHaptic() } - ) - } - } - } + val selectedStall = gameState.selectedBoardStall?.let { coord -> gameState.hexes[coord]?.stall } + val canShowUpgradeOverlay = + gameState.showUpgradeOverlay && !gameState.waveActive && selectedStall != null + + if (canShowUpgradeOverlay) { + UpgradeOverlay( + stall = selectedStall!!, + gold = gameState.gold, + kitchelinStars = gameState.kitchelinStars, + onUpgradeRandom = { viewModel.upgradeStallRandomly() }, + onUpgradeSpecific = { viewModel.upgradeStallSpecifically(it) }, + onDismiss = { viewModel.dismissUpgradeOverlay() }, + onTriggerHaptic = { viewModel.triggerHaptic() } + ) + }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9270a2b3-675c-4aec-91d5-941dbb414bef
📒 Files selected for processing (3)
app/src/main/java/com/messark/hawker/MainActivity.ktapp/src/main/java/com/messark/hawker/ui/components/GameBoard.ktapp/src/main/java/com/messark/hawker/ui/constants/SpriteConstants.kt
✅ Files skipped from review due to trivial changes (1)
- app/src/main/java/com/messark/hawker/ui/constants/SpriteConstants.kt
I have implemented the Kitchelin Star currency and the manual upgrade system as requested.
Key Changes:
GameStateRepository, ensuring players don't lose their stars between sessions.PR created automatically by Jules for task 2981389049891829714 started by @candour
Summary by CodeRabbit
New Features
Style