Skip to content

Fix Tiger Mom re-activation and synchronize base stats#200

Open
candour wants to merge 1 commit into
mainfrom
fix-tiger-mom-reactivation-and-stat-sync-417701321986501448
Open

Fix Tiger Mom re-activation and synchronize base stats#200
candour wants to merge 1 commit into
mainfrom
fix-tiger-mom-reactivation-and-stat-sync-417701321986501448

Conversation

@candour

@candour candour commented Jul 9, 2026

Copy link
Copy Markdown
Owner

I identified and fixed a logic bug where the Tiger Mom enemy type would not re-activate its support behavior after its initial target was removed from the board. I also performed a comprehensive synchronization of base statistics and health scaling factors across the codebase (Registry.kt) and all documentation files (STALL_STATS.md, CUSTOMER_STATS.md, AGENTS.md) to resolve significant discrepancies. Finally, I updated a unit test and recorded the changes in fixes.md.


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

Summary by CodeRabbit

  • Balance Updates

    • Adjusted enemy and stall stats to better match gameplay balance, including higher health for Tiger Mom, lower Chicken Rice damage, and higher Durian damage.
    • Updated health scaling so enemy HP grows slightly faster each wave.
  • Bug Fixes

    • Fixed a Tiger Mom buff issue where her activation state could persist incorrectly after her target changes, improving wave-to-wave behavior.

- Fixed logic bug in MainViewModel.kt where Tiger Mom would only buff one
  ally per lifetime; now resets when target is cleared.
- Synchronized Registry.kt base stats with documentation:
  - Chicken Rice damage: 10f
  - Durian damage: 150f
  - Tiger Mom HP: 80f
  - Enemy HP scaling: 1.07 (7% per wave)
- Updated STALL_STATS.md, CUSTOMER_STATS.md, and AGENTS.md for consistency.
- Corrected TigerMomBuffCleanupTest.kt to properly initialize GAME screen.
- Recorded fix as FIX-017 in fixes.md.

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 Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR synchronizes game balance constants in Registry.kt (enemy HP scaling exponent, Chicken Rice/Durian stall damage, Tiger Mom base HP) with corresponding documentation files, and fixes a Tiger Mom buff re-activation bug in MainViewModel by resetting hasActivatedBuff when her buff target is cleared, plus a related test adjustment.

Changes

Balance stats and buff fix

Layer / File(s) Summary
Registry balance constants updated
app/src/main/java/com/messark/hawker/registry/Registry.kt
HP scaling exponent multiplier changes 1.06→1.07, Chicken Rice damage 20f→10f, Durian damage 100f→150f, Tiger Mom baseHp 60f→80f.
Documentation synced with new values
AGENTS.md, CUSTOMER_STATS.md, STALL_STATS.md, fixes.md
Difficulty formula, customer stats table, stall stats table, and fix log updated to match the new registry constants.
Tiger Mom buff cleanup fix and test
app/src/main/java/com/messark/hawker/MainViewModel.kt, app/src/test/java/com/messark/hawker/TigerMomBuffCleanupTest.kt
cleanupEnemyBuffs now clears hasActivatedBuff for invalid Tiger Mom targets and includes it in the update condition; test explicitly sets currentScreen.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • candour/towerpower#91: Builds on the Tiger Mom hasActivatedBuff field and buff cleanup logic originally introduced there.
  • candour/towerpower#173: Both modify the same cleanupEnemyBuffs Tiger Mom lifecycle logic in MainViewModel.
  • candour/towerpower#181: Both modify the same Registry.kt balance constants for Chicken Rice, Durian, and Tiger Mom.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 accurately captures the Tiger Mom re-activation fix and the synchronized base stats changes.
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.
✨ 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 fix-tiger-mom-reactivation-and-stat-sync-417701321986501448

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.

@github-actions

github-actions Bot commented Jul 9, 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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ded933f-7f69-4a74-bc32-b2510ea9ab32

📥 Commits

Reviewing files that changed from the base of the PR and between 9b143ef and 51dd062.

📒 Files selected for processing (7)
  • AGENTS.md
  • CUSTOMER_STATS.md
  • STALL_STATS.md
  • app/src/main/java/com/messark/hawker/MainViewModel.kt
  • app/src/main/java/com/messark/hawker/registry/Registry.kt
  • app/src/test/java/com/messark/hawker/TigerMomBuffCleanupTest.kt
  • fixes.md

Comment thread fixes.md
| REF-015 | 2026-07-22 | Refactored `SpatialIndex.kt` and `Registry.kt` for improved efficiency. Optimized spatial bucketing using `floor()`, implemented hex-aware bucket pruning in `findNearby`, and unified `StallBehavior.selectTarget` to consistently use the spatial index, reducing targeting complexity and allocations. | Resolved |
| REF-016 | 2026-07-25 | Optimized the game engine loop and boost calculation in `MainViewModel.kt` and `Registry.kt`. Removed redundant sorted enemy lists from every tick and introduced a `stallBoosts` cache updated only on grid layout or Bak Kut Teh buff changes. Refactored `selectTarget` to calculate best targets directly from visible candidates, eliminating $O(E \log E)$ sorts per tick. | Resolved |
| REF-017 | 2026-07-28 | Refactored `MapGenerator.kt` for improved procedural variety. Standardized on axial coordinate logic, implemented a winding path generator (biased random walk) to replace simple A* carving, and introduced clumped pillar placement for more organic-looking environments. | Resolved |
| FIX-017 | 2026-07-30 | Synchronized base stats and HP scaling in `Registry.kt` and documentation (Chicken Rice damage: 10f, Durian damage: 150f, Tiger Mom HP: 80f, scaling: 1.07). Fixed Tiger Mom re-activation bug in `MainViewModel.kt` by resetting `hasActivatedBuff` when her target is cleared. | Resolved |

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== fixes.md around line 56 =="
cat -n fixes.md | sed -n '45,65p'

echo
echo "== search for date conventions in repository docs =="
rg -n "future-dated|release date|chronolog|FIX-\d+|Resolved" -S --glob '!**/node_modules/**' .

echo
echo "== list other FIX entries with dates =="
rg -n "^\| FIX-" fixes.md

Repository: candour/towerpower

Length of output: 17708


Avoid future-dating FIX-017.
2026-07-30 is later than the rest of this changelog and makes the resolved history look out of order; use the actual fix date instead.

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