Skip to content

Add "Wet Outdoors" Kitchelin star action#147

Merged
candour merged 6 commits into
mainfrom
feature/wet-outdoors-star-action-8369291482759398106
May 11, 2026
Merged

Add "Wet Outdoors" Kitchelin star action#147
candour merged 6 commits into
mainfrom
feature/wet-outdoors-star-action-8369291482759398106

Conversation

@candour
Copy link
Copy Markdown
Owner

@candour candour commented May 11, 2026

I have implemented the new "Wet Outdoors" Kitchelin star action as requested.

Key features:

  • Cost: Exactly 2 Kitchelin stars.
  • Selection Mode: Activated via the Star Action Overlay. While active, the player sees a cyan highlight when hovering over a valid starting perimeter tile, showing the 4-tile chain that will be affected.
  • Validation: Only standard floor tiles on the board's perimeter that are currently empty (no stalls, pillars, or drains) can be selected.
  • Gameplay Effect: Enemies passing through these tiles are slowed by the same amount as a standard Teh Tarik puddle. This effect is permanent unless a stall is placed on the tile.
  • Visuals: Each of the 4 tiles is decorated with a puddle graphic.

I've verified that the code compiles successfully and the core logic is sound.


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

Summary by CodeRabbit

  • New Features

    • Added "Wet Outdoors" star action (2 stars) to permanently wet 4 perimeter floor tiles and slow customers.
    • Visual preview highlights selected outdoor puddle tiles; tap-to-cancel while selecting.
  • Gameplay

    • Placing a stall removes permanent wetness from that tile.
    • Enemies slowed when crossing permanently wet tiles.
  • Documentation

    • README and agent docs updated with Wet Outdoors details.

Review Change Stack

- Implement 'Wet Outdoors' action costing 2 Kitchelin stars.
- Add `isPermanentlyWet` to `HexTile` and selection mode state to `GameState`.
- Add chain detection logic for 4 consecutive perimeter floor tiles in `MainViewModel`.
- Update `StarActionOverlay` with the new action button.
- Enhance `GameBoard` to render permanent puddles and provide a cyan hover highlight during selection.
- Update enemy movement logic to apply slow effects on permanently wet tiles.
- Ensure building a stall on a wet tile clears the wetness.

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.

@github-actions
Copy link
Copy Markdown

Build Successful! 🚀

Download APK

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

@candour
Copy link
Copy Markdown
Owner Author

candour commented May 11, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@candour
Copy link
Copy Markdown
Owner Author

candour commented May 11, 2026

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Full review triggered.

- Implement 'Wet Outdoors' action costing 2 Kitchelin stars.
- Add `isPermanentlyWet` to `HexTile` and selection mode state to `GameState`.
- Add perimeter chain detection for 4 consecutive tiles in `MainViewModel`.
- Update `StarActionOverlay` UI and `GameBoard` rendering with hover highlight.
- Update enemy movement to apply slow effects on permanently wet tiles.
- Building a stall on a wet tile clears the wetness.
- Update README with the new star action.

Co-authored-by: candour <4670475+candour@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Warning

Rate limit exceeded

@candour has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 37 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62da1d17-a03b-4d1f-b6ff-3396a48689e9

📥 Commits

Reviewing files that changed from the base of the PR and between e4305ee and 5e575da.

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

Walkthrough

This PR introduces an "Outdoor Puddle" feature that lets players spend 2 Kitchelin stars to permanently wet a chain of four perimeter floor tiles, slowing enemy movement through those tiles. Implementation touches data models, core logic, UI previews and wiring, activity overlays, and docs.

Changes

Outdoor Puddle Feature

Layer / File(s) Summary
Data Models
app/src/main/java/com/messark/hawker/model/GameModels.kt
HexTile gains isPermanentlyWet: Boolean; GameState gains isOutdoorPuddleModeActive: Boolean.
Puddle Chain Validation & Application
app/src/main/java/com/messark/hawker/MainViewModel.kt
getOutdoorPuddleChain() computes/validates a 4-tile perimeter floor chain and rejects occupied/pre-wet tiles. applyOutdoorPuddles() marks tiles permanently wet, deducts 2 stars if available, deactivates mode, and triggers haptics.
Enemy Movement Integration
app/src/main/java/com/messark/hawker/MainViewModel.kt
Enemy movement now applies puddle slow multiplier when the enemy's rounded hex is isPermanentlyWet.
Cell Click & Mode Control
app/src/main/java/com/messark/hawker/MainViewModel.kt
onCellClick routes to puddle placement when mode is active. enterOutdoorPuddleMode() and exitOutdoorPuddleMode() toggle the mode and related overlay visibility.
Stall Placement Cleanup
app/src/main/java/com/messark/hawker/MainViewModel.kt
Placing a stall on FLOOR/DRAIN clears isPermanentlyWet on that tile when assigning the stall.
GameBoard Hover Preview
app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt
Receives getOutdoorPuddleChain and isOutdoorPuddleModeActive; adds hoveredChain state, conditional pointer-event handling for hover previews, and cyan overlay rendering for hovered chains.
Star Action Button
app/src/main/java/com/messark/hawker/ui/components/StarActionOverlay.kt
Adds onChooseOutdoorPuddles callback and renders "Wet Outdoors (2 Stars)" button, enabled when kitchelinStars >= 2.
Activity Wiring & Overlay
app/src/main/java/com/messark/hawker/MainActivity.kt
Wires viewModel.getOutdoorPuddleChain() to GameBoard, passes viewModel.enterOutdoorPuddleMode() to StarActionOverlay, and shows an outdoor-puddle mode overlay with a cancel button that calls exitOutdoorPuddleMode().
Documentation
README.md, AGENTS.md
Adds "Wet Outdoors" star action description and clarifies stall-selling behavior with permanently-wet tiles.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • candour/towerpower#104: Modifies StarActionOverlay and MainViewModel star-action wiring; related to adding a new star action and overlay integration.
  • candour/towerpower#145: Changes MainViewModel onCellClick and stall-placement logic; overlaps with stall/wetness handling here.
  • candour/towerpower#129: Adds new star-driven UI/ViewModel actions; related to the Kitchelin star action flow extended by this PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% 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 pull request title accurately summarizes the main change: introducing a new "Wet Outdoors" Kitchelin star action, which is the primary feature implemented across all modified files.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/wet-outdoors-star-action-8369291482759398106

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
README.md (1)

49-49: ⚡ Quick win

Consider clarifying the tile quantity for accuracy.

The description "make perimeter floor tiles permanently wet" could be read as affecting all perimeter tiles, when the feature actually creates a chain of 4 consecutive perimeter tiles selected by the player. While the README maintains appropriate brevity and the in-game UI shows the selection preview, adding "a chain of 4" would align the description more closely with the actual gameplay behavior without sacrificing conciseness.

📝 Optional clarification
-- **Wet Outdoors:** Spend 2 stars to make perimeter floor tiles permanently wet, slowing down any customers who dare pass through. Outdoors is always more *shiok*!
+- **Wet Outdoors:** Spend 2 stars to make a chain of 4 perimeter floor tiles permanently wet, slowing down any customers who dare pass through. Outdoors is always more *shiok*!
app/src/main/java/com/messark/hawker/MainViewModel.kt (1)

512-517: 💤 Low value

Permanent puddle slow can be overridden (not stacked) by overlapping temporary puddles.

speedMultiplier is assigned (not multiplied) here, and the temporary-puddle loop at Lines 518–527 also assigns rather than multiplies. Since getPuddleSlowMultiplier returns the same value in both branches the visible behavior is currently identical, but the structure makes the semantics fragile: if a future change makes the permanent puddle slow stronger/weaker than getPuddleSlowMultiplier, an enemy standing on a permanent puddle that also happens to overlap a temporary puddle's 0.8-radius would silently lose the permanent slow. Consider combining via minOf (strongest slow wins) to preserve the intended behavior even under future tuning.

-            var speedMultiplier = 1.0f
-            // Permanent Outdoor Puddles
-            val currentHex = GridUtils.hexRound(enemy.position.q, enemy.position.r)
-            if (state.hexes[currentHex]?.isPermanentlyWet == true) {
-                speedMultiplier = enemyDef.getPuddleSlowMultiplier(enemy.type)
-            }
-
-            state.puddles.forEach { puddle ->
-                if (GridUtils.axialDistance(enemy.position, puddle.position) < 0.8) {
-                    speedMultiplier = enemyDef.getPuddleSlowMultiplier(enemy.type)
+            var speedMultiplier = 1.0f
+            // Permanent Outdoor Puddles
+            val currentHex = GridUtils.hexRound(enemy.position.q, enemy.position.r)
+            if (state.hexes[currentHex]?.isPermanentlyWet == true) {
+                speedMultiplier = minOf(speedMultiplier, enemyDef.getPuddleSlowMultiplier(enemy.type))
+            }
+
+            state.puddles.forEach { puddle ->
+                if (GridUtils.axialDistance(enemy.position, puddle.position) < 0.8) {
+                    speedMultiplier = minOf(speedMultiplier, enemyDef.getPuddleSlowMultiplier(enemy.type))
app/src/main/java/com/messark/hawker/MainActivity.kt (1)

697-731: ⚖️ Poor tradeoff

Overlay mirrors the Remove Pillar pattern — but inherits its style-guide deviations.

This block faithfully replicates the isRemovePillarModeActive overlay above, which is good for consistency. Worth noting per the project's UI conventions:

  • The Cancel button uses Material3 Button instead of SpriteButton (coding guidelines specify SpriteButton with buttons.png for action buttons).
  • Colors are hardcoded (Color.Black, Color.Cyan, Color.Red, Color.White) rather than sourced from MaterialTheme.colorScheme.

Since the same pattern already exists for the remove-pillar overlay, addressing this is best done as a follow-up that updates both overlays together rather than diverging here.

As per coding guidelines: "Use SpriteButton for all action buttons and reference buttons.png" and "Avoid hardcoding colors in UI components; always prefer MaterialTheme.colorScheme (e.g., onSurface, surface, primary) to support both light and dark themes".


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 04824d5b-bca2-41c6-ba85-2c8901ce1a7a

📥 Commits

Reviewing files that changed from the base of the PR and between e7d5797 and d4ba7be.

📒 Files selected for processing (6)
  • README.md
  • app/src/main/java/com/messark/hawker/MainActivity.kt
  • 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/ui/components/GameBoard.kt
  • app/src/main/java/com/messark/hawker/ui/components/StarActionOverlay.kt

Comment thread app/src/main/java/com/messark/hawker/MainViewModel.kt
Comment thread app/src/main/java/com/messark/hawker/MainViewModel.kt
Comment thread app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt Outdated
Comment thread app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt
- Implement 'Wet Outdoors' action costing 2 Kitchelin stars.
- Add `isPermanentlyWet` to `HexTile` and selection mode state to `GameState`.
- Add perimeter chain detection for 4 consecutive tiles in `MainViewModel`.
- Update `StarActionOverlay` UI and `GameBoard` rendering with hover highlight.
- Update enemy movement to apply slow effects on permanently wet tiles.
- Building a stall on a wet tile clears the wetness.
- Update README and AGENTS.md with the new star action.

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.

@candour
Copy link
Copy Markdown
Owner Author

candour commented May 11, 2026

getOutdoorPuddleChain uses getNeighbors(current).find { ... } and commits to the first matching neighbor at each step, with no backtracking. If the starting tile has multiple valid perimeter neighbors and the first one picked leads to a dead-end before reaching length 4, the function returns emptyList() even though a valid chain exists via another neighbor. The order of getNeighbors is also deterministic, so the same legitimate start tile can be permanently un-selectable for the user (and the cyan hover preview will not appear, making it look like that tile is invalid).

A small DFS / backtracking search will avoid this

@google-labs-jules
Copy link
Copy Markdown
Contributor

getOutdoorPuddleChain uses getNeighbors(current).find { ... } and commits to the first matching neighbor at each step, with no backtracking. If the starting tile has multiple valid perimeter neighbors and the first one picked leads to a dead-end before reaching length 4, the function returns emptyList() even though a valid chain exists via another neighbor. The order of getNeighbors is also deterministic, so the same legitimate start tile can be permanently un-selectable for the user (and the cyan hover preview will not appear, making it look like that tile is invalid).

A small DFS / backtracking search will avoid this

Good catch! I've updated getOutdoorPuddleChain to use a recursive backtracking search. This ensures that it correctly identifies valid 4-tile perimeter chains even when a simple greedy approach would hit a dead end.

- Refactor `getOutdoorPuddleChain` in `MainViewModel.kt` to use recursive backtracking instead of a greedy search.
- This ensures all valid 4-tile perimeter chains are discoverable even if the initial direction choice leads to a dead end.

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.

@candour
Copy link
Copy Markdown
Owner Author

candour commented May 11, 2026

Haptic fires even when the puddle action is rejected.

When kitchelinStars < 2, _gameState.update returns the state unchanged but triggerHaptic() still runs unconditionally at Line 1176.

@google-labs-jules
Copy link
Copy Markdown
Contributor

Haptic fires even when the puddle action is rejected.

When kitchelinStars < 2, _gameState.update returns the state unchanged but triggerHaptic() still runs unconditionally at Line 1176.

Good catch. I've updated applyOutdoorPuddles to only trigger haptic feedback if the action was successful (i.e., the player has enough Kitchelin stars).

- Only trigger haptic feedback if the outdoor puddle action was successfully applied.
- This prevents haptic feedback when the action is rejected due to insufficient stars.

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.

@candour
Copy link
Copy Markdown
Owner Author

candour commented May 11, 2026

Duplicate tap-detection branches; the isOutdoorPuddleModeActive conditional is a no-op.

Both the if and else branches of this pointerInput run exactly the same detectTapGestures block (compute fr/fq, hex-round, and call onCellClick). The conditional only causes the modifier to tear down and rebuild every time isOutdoorPuddleModeActive flips, without changing behavior. Collapse to a single branch.

@google-labs-jules
Copy link
Copy Markdown
Contributor

Duplicate tap-detection branches; the isOutdoorPuddleModeActive conditional is a no-op.

Both the if and else branches of this pointerInput run exactly the same detectTapGestures block (compute fr/fq, hex-round, and call onCellClick). The conditional only causes the modifier to tear down and rebuild every time isOutdoorPuddleModeActive flips, without changing behavior. Collapse to a single branch.

Good observation. I've collapsed the duplicate tap-detection branches into a single pointerInput(Unit) block to avoid unnecessary teardowns and rebuilds.

- Collapse redundant tap-detection branches in GameBoard.kt.
- Ensure haptic feedback only triggers on successful star action application.
- All feedback from the latest PR review addressed.

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.

@candour candour enabled auto-merge (squash) May 11, 2026 11:27
@candour
Copy link
Copy Markdown
Owner Author

candour commented May 11, 2026

@coderabbitai resolve

@candour candour merged commit 4bde9b9 into main May 11, 2026
3 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Comments resolved and changes approved.

@candour candour deleted the feature/wet-outdoors-star-action-8369291482759398106 branch May 11, 2026 11:28
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