Add ATM stall for passive income - #105
Conversation
- Implemented ATM stall type ($1000 cost) that provides $100 gold at the end of each wave. - Reused Tray Return Uncle sprite for the ATM. - Added MONEY_SPRAY visual effect to show income collection. - Updated StallConsole to display "Pays: $100" and disable upgrades for ATM. - Updated STALL_STATS.md with ATM details. - Ensured exhaustive when expressions in UI components to handle the new StallType. 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 new ATM stall type that passively awards $100 per wave, registers it with cost $1000 and zero combat stats, collects ATM income on wave completion and spawns MONEY_SPRAY visual effects, and updates UI to display ATM-specific stats and disable ATM upgrades. Changes
Sequence DiagramsequenceDiagram
participant UI as UI Layer
participant VM as MainViewModel
participant Board as GameBoard State
participant Registry as StallRegistry
participant Renderer as Rendering Engine
UI->>VM: Wave completion event
VM->>Board: Query updated hexes / stalls
Board-->>VM: List of stall tiles (with types & positions)
VM->>Registry: Lookup stall definitions (passiveIncome)
Registry-->>VM: StallDefinition(s)
VM->>VM: Sum passiveIncome → atmGold
VM->>VM: Create MONEY_SPRAY effects at ATM positions
VM->>Board: Update state (gold += atmGold, append effects)
Board-->>UI: New state with effects
UI->>Renderer: Render MONEY_SPRAY effects
Renderer->>Renderer: Seed RNG per effect, draw radial "$" glyphs (opacity/progress)
Renderer-->>UI: Animated money spray visuals
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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: 2
🧹 Nitpick comments (1)
app/src/main/java/com/messark/hawker/ui/components/StallConsole.kt (1)
133-133: Use an explicit locale for numeric formatting.
String.format(...)without an explicit locale parameter uses the system default, which can render decimals inconsistently across regions (period vs. comma separator). All three instances on lines 133, 136, and 139 needLocale.USspecified.Proposed fix
+import java.util.Locale ... -StatLine(label = buildInlinedLabel(stall, "Range", "Range"), value = String.format("%.1f", stall.range)) +StatLine(label = buildInlinedLabel(stall, "Range", "Range"), value = String.format(Locale.US, "%.1f", stall.range)) -StatLine(label = buildInlinedLabel(stall, "Rate", rateCategory), value = String.format("%.1fs", stall.fireRateMs / 1000f)) +StatLine(label = buildInlinedLabel(stall, "Rate", rateCategory), value = String.format(Locale.US, "%.1fs", stall.fireRateMs / 1000f)) -StatLine(label = buildInlinedLabel(stall, "Area", "Radius"), value = String.format("%.1f", stall.aoeRadius)) +StatLine(label = buildInlinedLabel(stall, "Area", "Radius"), value = String.format(Locale.US, "%.1f", stall.aoeRadius))
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 26a934a9-8f01-46b9-9673-0afbd6855a6c
📒 Files selected for processing (7)
STALL_STATS.mdapp/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/main/java/com/messark/hawker/model/GameModels.ktapp/src/main/java/com/messark/hawker/registry/Registry.ktapp/src/main/java/com/messark/hawker/ui/components/GameBoard.ktapp/src/main/java/com/messark/hawker/ui/components/StallConsole.ktapp/src/main/java/com/messark/hawker/ui/components/UpgradeOverlay.kt
- Implemented ATM stall ($1000 cost) providing $100 gold per wave completion. - Reused Tray Return Uncle sprite for the ATM. - Added MONEY_SPRAY visual effect with randomized dollar sign movement and fading. - Optimized performance by gating target scanning on fireRateMs > 0 in MainViewModel. - Refactored StallConsole and GameBoard to use MaterialTheme colorScheme for consistent theming. - Updated STALL_STATS.md and handled exhaustive enum checks in UI overlays. 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/MainViewModel.kt (1)
338-343: ⚡ Quick winCentralize ATM payout value to prevent cross-file drift.
100is now embedded in game logic, and the same value is also presented in UI. A shared constant (or stat field) would keep behavior and display aligned when this value changes.♻️ Suggested refactor
+ private companion object { + const val ATM_PAYOUT_PER_WAVE = 100 + } ... - atmGold += 100 + atmGold += ATM_PAYOUT_PER_WAVE
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 804432cf-ba8c-4947-aca6-57b66b2b8c7f
📒 Files selected for processing (3)
app/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/main/java/com/messark/hawker/ui/components/GameBoard.ktapp/src/main/java/com/messark/hawker/ui/components/StallConsole.kt
- Implemented ATM stall ($1000 cost) with $100 passive income per wave. - Encoded passive income value in `StallDefinition` within `Registry.kt`. - Added `MONEY_SPRAY` visual effect for income collection. - Optimized performance by gating target scanning on `fireRateMs > 0` in `MainViewModel`. - Refactored `StallConsole` and `StatLine` to use `MaterialTheme.colorScheme` for better consistency. - Updated `STALL_STATS.md` with ATM details. - Ensured exhaustive enum handling in `UpgradeOverlay`. 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/main/java/com/messark/hawker/ui/components/StallConsole.kt (1)
135-135:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMake numeric formatting locale-explicit.
String.formathere still relies on implicit default locale, which keeps the detekt warning active and can vary across devices.🌐 Suggested patch
+import java.util.Locale ... - StatLine(label = buildInlinedLabel(stall, "Range", "Range"), value = String.format("%.1f", stall.range)) + StatLine(label = buildInlinedLabel(stall, "Range", "Range"), value = String.format(Locale.getDefault(), "%.1f", stall.range)) ... - StatLine(label = buildInlinedLabel(stall, "Rate", rateCategory), value = String.format("%.1fs", stall.fireRateMs / 1000f)) + StatLine(label = buildInlinedLabel(stall, "Rate", rateCategory), value = String.format(Locale.getDefault(), "%.1fs", stall.fireRateMs / 1000f)) ... - StatLine(label = buildInlinedLabel(stall, "Area", "Radius"), value = String.format("%.1f", stall.aoeRadius)) + StatLine(label = buildInlinedLabel(stall, "Area", "Radius"), value = String.format(Locale.getDefault(), "%.1f", stall.aoeRadius))Also applies to: 138-138, 141-141
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b2722c0a-cf04-48e6-85ec-1e23097acfdf
📒 Files selected for processing (3)
app/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/main/java/com/messark/hawker/registry/Registry.ktapp/src/main/java/com/messark/hawker/ui/components/StallConsole.kt
✅ Files skipped from review due to trivial changes (1)
- app/src/main/java/com/messark/hawker/MainViewModel.kt
|
@coderabbitai resolve |
✅ Actions performedComments resolved and changes approved. |
This change adds a new stall type called "ATM" to Hawker Rush. The ATM is a utility stall that costs $1000 and provides $100 gold to the player at the end of every wave. It uses the same sprite as the Tray Return Uncle. A visual "money spray" effect (exploding dollar signs) is triggered at each ATM's location when the income is awarded. The UI has been updated to show the ATM's income stat and disable its upgrade button. Documentation in STALL_STATS.md has also been updated.
PR created automatically by Jules for task 14108179511752848232 started by @candour
Summary by CodeRabbit
New Features
UI
Bug Fixes
Documentation