Add "Wet Outdoors" Kitchelin star action#147
Conversation
- 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>
|
👋 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. |
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull 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>
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis 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. ChangesOutdoor Puddle Feature
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 unit tests (beta)
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. Comment |
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
README.md (1)
49-49: ⚡ Quick winConsider 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 valuePermanent puddle slow can be overridden (not stacked) by overlapping temporary puddles.
speedMultiplieris assigned (not multiplied) here, and the temporary-puddle loop at Lines 518–527 also assigns rather than multiplies. SincegetPuddleSlowMultiplierreturns 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 thangetPuddleSlowMultiplier, 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 viaminOf(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 tradeoffOverlay mirrors the Remove Pillar pattern — but inherits its style-guide deviations.
This block faithfully replicates the
isRemovePillarModeActiveoverlay above, which is good for consistency. Worth noting per the project's UI conventions:
- The Cancel button uses Material3
Buttoninstead ofSpriteButton(coding guidelines specify SpriteButton withbuttons.pngfor action buttons).- Colors are hardcoded (
Color.Black,Color.Cyan,Color.Red,Color.White) rather than sourced fromMaterialTheme.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
📒 Files selected for processing (6)
README.mdapp/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/StarActionOverlay.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>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
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 |
- 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>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
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 |
- 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>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
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 |
- 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>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
@coderabbitai resolve |
✅ Actions performedComments resolved and changes approved. |
I have implemented the new "Wet Outdoors" Kitchelin star action as requested.
Key features:
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
Gameplay
Documentation