Bak Kut Teh Revamp and UI Improvements#150
Conversation
… displays - Implement randomized Bak Kut Teh buffs (Meaty/Herbal) at wave start. - Reduce Bak Kut Teh boost scaling to 10% base and increment. - Add "Undo!" button for recently sold stalls in the control panel. - Hide upgrade count icons for stalls with no available upgrades. - Ensure stall console displays total boosted stats (damage/rate/durations). - Update unit tests to reflect new Bak Kut Teh scaling. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds MEATY and HERBAL BKT buff variants, threads buff selection and toast through waves, refactors boost results into damage/rate multipliers, adds an undo-sell flow and UI wiring (toast, UNDO button, multipliers), and reduces base BKT boost from 20% to 10%. ChangesBKT Dual-Buff System with Undo Mechanic
Sequence Diagram: sequenceDiagram
participant Player
participant GameScreen
participant MainViewModel
participant GameBoard
participant GameControlPanel
participant StallConsole
Player->>GameScreen: open/play screen / select stall
GameScreen->>MainViewModel: startWave() / selectStall()
MainViewModel->>MainViewModel: choose bktBuffType, set bktToastMessage, clear lastSoldStall
GameScreen->>MainViewModel: calculateStatBoost(coord, hexes, bktBuffType)
MainViewModel-->>GameScreen: BoostResult(damageMultiplier, rateMultiplier)
GameScreen->>GameBoard: render(bktToastMessage)
GameScreen->>GameControlPanel: render(onUndoSell, damageMultiplier, rateMultiplier, bktBuffType, lastSoldStall)
GameControlPanel->>StallConsole: forward multipliers / buff type
StallConsole-->>GameControlPanel: display adjusted stats
🎯 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)
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: 3
🧹 Nitpick comments (1)
app/src/main/java/com/messark/hawker/MainActivity.kt (1)
793-793: ⚡ Quick winMemoize the boost calculation to avoid unnecessary recomputations.
The
boostResultcalculation runs on every recomposition ofGameScreen, even when its dependencies (selectedBoardStall,hexes,bktBuffType) haven't changed. SincegameStateis a composite object, changes to unrelated properties (likegold,health, orscore) will trigger unnecessary recalculations. For smooth game performance, memoization is recommended.⚡ Proposed fix to memoize the calculation
-val boostResult = gameState.selectedBoardStall?.let { viewModel.calculateStatBoost(it, gameState.hexes, gameState.bktBuffType) } +val boostResult = remember(gameState.selectedBoardStall, gameState.hexes, gameState.bktBuffType) { + gameState.selectedBoardStall?.let { viewModel.calculateStatBoost(it, gameState.hexes, gameState.bktBuffType) } +}
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a969cbbe-8b60-42a5-a388-5991269b784f
📒 Files selected for processing (9)
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/registry/Registry.ktapp/src/main/java/com/messark/hawker/ui/components/GameBoard.ktapp/src/main/java/com/messark/hawker/ui/components/GameControlPanel.ktapp/src/main/java/com/messark/hawker/ui/components/StallConsole.ktapp/src/main/java/com/messark/hawker/utils/StallUpgradeManager.ktapp/src/test/java/com/messark/hawker/BakKutTehSameTickTest.kt
|
Guard undo-sell against insufficient gold to prevent negative balance. Line 1158 subtracts refund without checking available gold. If the refunded gold was spent before undo, this can push gold below zero. |
Good catch! I've added a gold balance check to |
Co-authored-by: candour <4670475+candour@users.noreply.github.com>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
Co-authored-by: candour <4670475+candour@users.noreply.github.com>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
This change introduces a more dynamic Bak Kut Teh stall mechanic, where it randomly buffs either Damage or Fire Rate/Duration at the start of each wave. The buff scaling has been tuned down to 10% per level.
On the UI side, a new "Undo!" button appears after selling a stall, allowing players to reverse accidental sales. The stall console now correctly displays the final effective stats (including active buffs) to the player. Additionally, stalls that cannot be upgraded (like the ATM) no longer show a redundant upgrade count icon on the board.
PR created automatically by Jules for task 6163497663483847708 started by @candour
Summary by CodeRabbit
New Features
Balance Changes
Improvements
Tests