Fix X-Ray for multi-hex movement previews#3172
Conversation
|
@emptyteabot is attempting to deploy a commit to the FreezingMoon Team on Vercel. A member of the Team first needs to authorize it. |
79c0146 to
3473264
Compare
|
Ready for review. The failing Vercel status is a team authorization block for the preview deployment, not a build/runtime failure from this PR. Local verification was completed before submission. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR improves X-Ray behavior during hovered movement/target previews for medium/large creatures by computing the full multi-hex preview footprint and applying X-Ray across every hex in that footprint (instead of only the cursor hex), while also preserving the last computed footprint for X-Ray reapply flows.
Changes:
- Added
getQueryFootprintHexes()helper to compute the full multi-hex footprint for hovered previews (including flipped-player offset and walkability adjustment). - Updated
HexGrid.queryHexes()hover path to pass the computed footprint intoHexGrid.xray()so X-Ray ghosts blockers for all occupied preview hexes. - Extended
HexGrid.xray()to accept an optional footprint, cache/reuse it for reapply paths, and clear it duringclearAllXray(), with added Jest coverage for the new behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/utility/query_footprint.ts |
Adds a shared helper to compute the occupied hex footprint for hovered multi-hex previews. |
src/utility/hexgrid.ts |
Threads preview footprint into X-Ray, caches it for reapply, and clears it at turn-boundary cleanup. |
src/__tests__/utility/query_footprint.ts |
Adds unit tests validating footprint computation for flipped/non-flipped multi-hex previews. |
src/__tests__/utility/hexgrid-xray.ts |
Adds a unit test ensuring X-Ray applies ghostOverlap() for every hex in the preview footprint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Testing
/claim #1301
Payout note: if this bounty can be paid as an EVM stablecoin instead of XTR, wallet is
0xe2e86bdb8753c24032f2ad42b4c1bd9748385a7d.