Skip to content

Add ATM stall for passive income - #105

Merged
candour merged 3 commits into
mainfrom
feat/atm-stall-14108179511752848232
Apr 30, 2026
Merged

Add ATM stall for passive income#105
candour merged 3 commits into
mainfrom
feat/atm-stall-14108179511752848232

Conversation

@candour

@candour candour commented Apr 30, 2026

Copy link
Copy Markdown
Owner

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

    • Added ATM stall — utility that pays $100 passive income each wave and costs $1,000 to place
    • Money-spray visual effect plays at each ATM payout
  • UI

    • ATM shows a single "Pays $100" stat; upgrade button disabled and labeled "MAXED"
    • Stat text colors updated (affordable = green)
  • Bug Fixes

    • Prevent stalls with zero/invalid fire rate from attempting to fire
  • Documentation

    • Updated stall stats to include ATM entry

- 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>
@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 30, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Docs
STALL_STATS.md
Adds an ATM row documenting $100/wave payout and base cost $1000.
Registry / Definitions
app/src/main/java/com/messark/hawker/registry/Registry.kt
Adds passiveIncome field to StallDefinition and registers StallType.ATM with passiveIncome = 100, cost 1000, and zero combat stats.
Models / Enums
app/src/main/java/com/messark/hawker/model/GameModels.kt
Adds StallType.ATM, treats it as a utility in isUtility, and adds VisualEffectType.MONEY_SPRAY.
Game Logic
app/src/main/java/com/messark/hawker/MainViewModel.kt
On wave completion, sums passiveIncome for ATMs to add atmGold to player gold and appends MONEY_SPRAY effects; also guards stall firing with fireRateMs > 0.
Rendering
app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt
Refactors visual-effect rendering to a when dispatcher and implements MONEY_SPRAY drawing (seeded radial “$” glyphs with progress/opacity control).
UI / Overlays
app/src/main/java/com/messark/hawker/ui/components/StallConsole.kt, app/src/main/java/com/messark/hawker/ui/components/UpgradeOverlay.kt
StallConsole shows Pays: $<passiveIncome> for ATMs, uses green value color, disables ATM upgrades and shows “MAXED”; updates StatLine default colors to MaterialTheme color scheme; UpgradeOverlay hides specific upgrades for ATM.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% 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 'Add ATM stall for passive income' clearly and concisely describes the main change: introducing a new ATM stall type that generates passive income.
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 feat/atm-stall-14108179511752848232

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: 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 need Locale.US specified.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 83bb20e and db3cf85.

📒 Files selected for processing (7)
  • STALL_STATS.md
  • app/src/main/java/com/messark/hawker/MainViewModel.kt
  • app/src/main/java/com/messark/hawker/model/GameModels.kt
  • app/src/main/java/com/messark/hawker/registry/Registry.kt
  • app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt
  • app/src/main/java/com/messark/hawker/ui/components/StallConsole.kt
  • app/src/main/java/com/messark/hawker/ui/components/UpgradeOverlay.kt

Comment thread app/src/main/java/com/messark/hawker/registry/Registry.kt
Comment thread app/src/main/java/com/messark/hawker/ui/components/StallConsole.kt Outdated
- 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>
@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

🧹 Nitpick comments (1)
app/src/main/java/com/messark/hawker/MainViewModel.kt (1)

338-343: ⚡ Quick win

Centralize ATM payout value to prevent cross-file drift.

100 is 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

📥 Commits

Reviewing files that changed from the base of the PR and between db3cf85 and 53aa60c.

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

Comment thread app/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>
@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/main/java/com/messark/hawker/ui/components/StallConsole.kt (1)

135-135: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make numeric formatting locale-explicit.

String.format here 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

📥 Commits

Reviewing files that changed from the base of the PR and between 53aa60c and bcb37ea.

📒 Files selected for processing (3)
  • app/src/main/java/com/messark/hawker/MainViewModel.kt
  • app/src/main/java/com/messark/hawker/registry/Registry.kt
  • app/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

@candour

candour commented Apr 30, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai resolve

@candour
candour enabled auto-merge (squash) April 30, 2026 06:08
@candour
candour merged commit c887729 into main Apr 30, 2026
3 checks passed
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Comments resolved and changes approved.

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