AncientBeast icon indicating copy to clipboard operation
AncientBeast copied to clipboard

Fix Escort Ability 1-Hex Move Logic

Open emna9 opened this issue 8 months ago • 6 comments

In this pull request, I’ve made progress on the Escort ability by ensuring that the block (Scavenger + Target) moves by exactly 1 hex. However, there is still an issue with overlap when the direction is 1 (moving from left to right). The movement works correctly for the right to left direction (1 hex shifts), but when moving in the right direction,the creatures may overlap.

Changes made:

Fixed the calculation of 1-hex movement for both the Scavenger and the Target.

Adjusted the hover block logic to start from the correct tile in both directions.

Problem: When the direction is 1 (moving from left to right), I’m unable to click on tiles 1 or 2, and the block only starts from tile 3. This results in overlap issues when moving towards the right.

escort move1hex escort2 move1hex1

This fixes issue #2616

emna9 avatar Apr 16 '25 02:04 emna9

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ancientbeast ✅ Ready (Inspect) Visit Preview Apr 16, 2025 2:17am

vercel[bot] avatar Apr 16 '25 02:04 vercel[bot]

@emna9 Great progress ! But there are two things to fix to fully resolve the issue:But there are two things to fix to fully resolve the issue: 1- Rightward movement (dir = 1) still causes overlap — it seems like the block starts from tile 3 instead of tile 1. That’s likely because hoveredBlockStartX is too far ahead. Try adjusting how it’s calculated to allow selecting closer tiles (1 hex shift). 2- In activate(), when moving right, the crea and trg destinations overlap. You should compute their positions relative to trgIsInfront, not just by applying finalShift. Use: const creaDestX = trgIsInfront ? hoveredBlockStartX - trgSize : hoveredBlockStartX; const trgDestX = trgIsInfront ? hoveredBlockStartX : hoveredBlockStartX - creaSize; Hope this helps you fix the bug

turkiasma avatar Apr 16 '25 23:04 turkiasma

@turkiasma Thanks for your nice review on this!

@emna9 Will mark this as draft until that stuff is actually fixed. I've found some other bug related to this based on some new feature that we added with new unit location previews; I've opened up #2688 showcasing it, up for grabs 🐻

DreadKnight avatar Apr 22 '25 03:04 DreadKnight

@emna9 Any progress with this one? It also has a conflict now...

DreadKnight avatar May 27 '25 07:05 DreadKnight

@emna9 Poke 🐻

DreadKnight avatar Jun 09 '25 18:06 DreadKnight

heyy @DreadKnight I didnt make any progress , feel free to unassign me if you need

emna9 avatar Jun 10 '25 01:06 emna9

The issue was fixed in PR #2801

DreadKnight avatar Nov 06 '25 13:11 DreadKnight