Skip to content

Fix Stall Logic Accuracy and Hardcoded Values - #151

Merged
candour merged 1 commit into
mainfrom
fix-stall-logic-accuracy-6434205710160606072
May 12, 2026
Merged

Fix Stall Logic Accuracy and Hardcoded Values#151
candour merged 1 commit into
mainfrom
fix-stall-logic-accuracy-6434205710160606072

Conversation

@candour

@candour candour commented May 12, 2026

Copy link
Copy Markdown
Owner

This change improves the accuracy of stall firing logic in Registry.kt. Specifically, it fixes a bug where TEH_TARIK might fail to correctly identify if a target is on a DRAIN tile due to naive coordinate rounding. It also cleans up hardcoded values in the SATAY stall logic and corrects its projectile rotation to properly align with the isometric view.


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

Summary by CodeRabbit

  • Bug Fixes
    • Improved TEH_TARIK stall drain hit detection precision through enhanced coordinate calculations.
    • Fixed SATAY projectile rotation angle calculations for proper isometric alignment.
    • SATAY projectiles now render with stall-specific colors instead of default appearance.
    • Corrected SATAY projectile source attribution for accurate gameplay feedback.

Review Change Stack

- Replaced `Math.round` with `GridUtils.hexRound` for `TEH_TARIK` tile detection to ensure accurate `DRAIN` tile interaction.
- Removed hardcoded `Color.White` and `StallType.SATAY` from `SATAY` firing branch.
- Refined `SATAY` rotation calculation to use isometric screen-space coordinates for better visual alignment.
- Updated `fixes.md` with ID FIX-007.

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

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1046f55b-e989-445b-b3b7-51f93ccc1bb4

📥 Commits

Reviewing files that changed from the base of the PR and between 787fb64 and c5ea042.

📒 Files selected for processing (2)
  • app/src/main/java/com/messark/hawker/registry/Registry.kt
  • fixes.md

📝 Walkthrough

Walkthrough

Registry.kt integrates GridUtils to refactor stall firing logic: TEH_TARIK now uses GridUtils.hexRound() for hex coordinate lookup; SATAY applies isometric-corrected angle calculation, uses the stall's projectileColor instead of hardcoded white, and sets sourceStallType from the stall type. Bug fix FIX-007 documents these changes.

Changes

Stall Firing Logic

Layer / File(s) Summary
Stall firing coordinate and projectile refinements
app/src/main/java/com/messark/hawker/registry/Registry.kt, fixes.md
GridUtils import enables TEH_TARIK to use shared hexRound() for drain detection target lookup. SATAY projectile creation is corrected to apply isometric-adjusted angle via ISOMETRIC_Y_FACTOR, use stall-defined projectileColor instead of white, and set sourceStallType from current stall type instead of hardcoded StallType.SATAY. FIX-007 documents the stall firing logic adjustments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • candour/towerpower#149: Both PRs interact with the same GridUtils geometry utilities; this PR calls GridUtils.hexRound and GridUtils.ISOMETRIC_Y_FACTOR while the related PR implements those utility functions.
  • candour/towerpower#141: Both PRs modify StallDefinition.fire behavior and Registry.kt entries; the related PR changed the StallDefinition type structure that this PR now uses in its firing logic refactor.
🚥 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 directly and accurately summarizes the main changes: fixing stall logic accuracy (TEH_TARIK coordinate rounding, SATAY rotation) and removing hardcoded values (Color.White, StallType.SATAY).
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 fix-stall-logic-accuracy-6434205710160606072

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.

@candour
candour merged commit be585ed into main May 12, 2026
3 checks passed
@candour
candour deleted the fix-stall-logic-accuracy-6434205710160606072 branch May 12, 2026 04:21
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