Skip to content

Kitchelin Star Improvements and Health Action - #129

Merged
candour merged 1 commit into
mainfrom
kitchelin-star-improvements-16498074718452147401
May 7, 2026
Merged

Kitchelin Star Improvements and Health Action#129
candour merged 1 commit into
mainfrom
kitchelin-star-improvements-16498074718452147401

Conversation

@candour

@candour candour commented May 7, 2026

Copy link
Copy Markdown
Owner

This change enhances the Kitchelin Star system by adding a passive gold bonus for each star held, increasing the potency of the Budget Bonus action, and introducing a new health restoration option. Logic was added to MainViewModel to handle these bonuses and actions, and the StarActionOverlay UI was updated to support the new functionality. Tests verify the correctness of the cumulative bonus calculations and health restoration.


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

Summary by CodeRabbit

  • New Features

    • Added health restoration action: spend a star to restore 1 health (capped at 10).
    • Added passive gold bonus: earn 1% extra gold per held Kitchelin Star each wave.
  • Gameplay Balance

    • Budget Bonus reward increased from 10% to 100%.
  • Documentation

    • Updated gameplay mechanics guide with new star action details and bonus calculations.

- Add 1% passive gold bonus per Kitchelin Star (cumulative).
- Buff Budget Bonus action from 10% to 100%.
- Add "Restore Health" action to spend a star for +1 health (max 10).
- Update UI to include the new action and updated descriptions.
- Add unit tests for new and updated bonus logic.
- Update AGENTS.md with new mechanics.

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 May 7, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR implements a new Kitchelin Star action system: players can restore health by spending stars, the Budget Bonus formula is recalculated to offer 100% next-round gold (cumulative with a new 1% passive per-star bonus), and UI components are updated to display and handle the health restoration option.

Changes

Kitchelin Star Action System & Bonus Recalculation

Layer / File(s) Summary
Specification & Documentation
AGENTS.md
Documents new between-waves star actions: 1% passive gold per held star on goldEarnedThisWave, Budget Bonus as 100% deferred gold (cumulative), free upgrade access, and conditional health restoration up to max 10.
Core Logic & State Management
app/src/main/java/com/messark/hawker/MainViewModel.kt
Wave completion now separates star increment and bonus-budget calculation into preNewStarCount / nextStars / bonusBudget flow with new formula incorporating goldEarnedThisWave and activeBudgetBonuses. Added restoreHealth() method that consumes a star, increments health up to 10, and dismisses the overlay.
UI Components & Interactions
app/src/main/java/com/messark/hawker/ui/components/StarActionOverlay.kt
StarActionOverlay accepts new health parameter and onRestoreHealth callback. StarActionButton gains enabled flag with conditional styling (gray when disabled) and click handling. New "Restore Health" button added, enabled only when health < 10. Budget Bonus description updated to 100%.
Activity Wiring
app/src/main/java/com/messark/hawker/MainActivity.kt
GameScreen wires onRestoreHealth = { viewModel.restoreHealth() } callback into StarActionOverlay alongside existing handlers.
Tests & Validation
app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt
Updated testBudgetBonusFromStarAction expected gold to 700. Added testPassiveBonusPerStar (verifies per-star percentage), testCombinedCumulativeBonus (validates interaction between active and passive bonuses), and testRestoreHealthAction (confirms star consumption and health capping). Removed testStackedBudgetBonuses.

Sequence Diagram

sequenceDiagram
    actor Player
    participant MainActivity
    participant StarActionOverlay
    participant MainViewModel
    Player->>StarActionOverlay: Click "Restore Health" button
    StarActionOverlay->>MainViewModel: onRestoreHealth() callback
    MainViewModel->>MainViewModel: Consume 1 kitchelinStar
    MainViewModel->>MainViewModel: Increment health by 1 (max 10)
    MainViewModel->>MainViewModel: Dismiss showStarActionOverlay
    MainViewModel-->>MainActivity: State update (health, stars, overlay)
    MainActivity-->>StarActionOverlay: Recompose with updated state
    StarActionOverlay-->>Player: Close overlay, display new health
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • candour/towerpower#100: Modifies MainViewModel's wave-completion logic around Kitchelin star awarding alongside state flag changes.
  • candour/towerpower#104: Updates the Kitchelin star action system across StarActionOverlay, MainViewModel, MainActivity, and tests.
  • candour/towerpower#102: Changes Kitchelin star gameplay mechanics including gold bonus calculations and upgrade handling in MainViewModel.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% 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 clearly and concisely summarizes the main changes: adding a passive bonus per Kitchelin Star and introducing a new health restoration action.
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 kitchelin-star-improvements-16498074718452147401

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

github-actions Bot commented May 7, 2026

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/ui/components/StarActionOverlay.kt (1)

124-124: ⚡ Quick win

Avoid hardcoded button colors

Color(0xFFFFD700) and Color.Gray should come from MaterialTheme.colorScheme so this stays correct in both light/dark themes.

Proposed theme-based adjustment
-        color = if (enabled) Color(0xFFFFD700) else Color.Gray, // Gold or Gray
+        color = if (enabled) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.surfaceVariant,

As per coding guidelines: "/*.kt: Always prefer MaterialTheme.colorScheme ... instead of hardcoding colors in UI components".


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 37fedd94-adfc-46d3-9f25-f9a3fc86bee3

📥 Commits

Reviewing files that changed from the base of the PR and between 142f5d4 and 8d032c6.

📒 Files selected for processing (5)
  • AGENTS.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/ui/components/StarActionOverlay.kt
  • app/src/test/java/com/messark/hawker/KitchelinBonusTest.kt

@candour
candour enabled auto-merge (squash) May 7, 2026 03:19
@candour
candour merged commit b5af060 into main May 7, 2026
3 checks passed
@candour
candour deleted the kitchelin-star-improvements-16498074718452147401 branch May 7, 2026 03:20
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