Skip to content

Fix Escort Ability 1-Hex Move Logic #2684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

emna9
Copy link
Contributor

@emna9 emna9 commented Apr 16, 2025

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

Copy link

vercel bot commented Apr 16, 2025

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

@emna9 emna9 closed this Apr 16, 2025
@emna9 emna9 deleted the escort-1hex-move branch April 16, 2025 02:05
@emna9 emna9 restored the escort-1hex-move branch April 16, 2025 02:05
@emna9 emna9 deleted the escort-1hex-move branch April 16, 2025 02:06
@emna9 emna9 restored the escort-1hex-move branch April 16, 2025 02:08
@turkiasma
Copy link
Contributor

@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

@DreadKnight
Copy link
Member

@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 DreadKnight marked this pull request as draft April 22, 2025 03:23
@DreadKnight
Copy link
Member

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

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.

3 participants