Skip to content
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

Check for wall collision when determining flanking buddies in TokenPF2e#isFlanking #16984

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

In3luki
Copy link
Collaborator

@In3luki In3luki commented Oct 23, 2024

Screenshot 2024-11-10 184135

@stwlam stwlam marked this pull request as draft October 28, 2024 03:12
@xyzzy42
Copy link
Contributor

xyzzy42 commented Nov 8, 2024

The wall collision check here is different than the one used for the aura to square wall collision check, in this function

export function getAreaSquares(data: GetAreaSquaresParams): EffectAreaSquare[] {

The way that code works, is it creates four source points, each offset in one of the cardinal directions from the center of token by ⅛ the token size. Then it checks for any of those points having an unblocked line to the center of the destination square. So it's just four checks, rather than sixteen.

@In3luki
Copy link
Collaborator Author

In3luki commented Nov 8, 2024

I totally forgot about this PR. The reason for the 16 tests was to catch edge cases like this:
Screenshot 2024-11-08 211714

Ideally it would just be a check if the flanked token is actually rendered on the canvas from the perspective of the flanker but sadly that's not currently possible without switching the canvas perception layer (or maybe it was some other layer that I forgot).

@In3luki In3luki changed the title Check for wall collision as final step in TokenPF2e#canFlank Check for wall collision when determining flanking buddies in TokenPF2e#isFlanking Nov 10, 2024
@In3luki In3luki marked this pull request as ready for review November 10, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants