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

Range Penalty ignores Foundry's diagonal counting settings #18392

Open
coop152 opened this issue Mar 3, 2025 · 1 comment
Open

Range Penalty ignores Foundry's diagonal counting settings #18392

coop152 opened this issue Mar 3, 2025 · 1 comment

Comments

@coop152
Copy link

coop152 commented Mar 3, 2025

Range penalty on ranged weapons seems to always use the 1/2/1 counting method for diagonals, even when foundry is configured to use alternate counting. For example, here is an air repeater (range 30ft) suffering from a -2 range penalty when the targeted token is within 25ft, using equidistant diagonals:

Image

I also can't find any way to disable the range penalty automation, so you have to manually disable it in the roll settings each time. A toggle in the automation settings to disable it (like flanking has) would be nice, especially if fixing the measuring issue isn't feasible. Thanks!

@coop152
Copy link
Author

coop152 commented Mar 3, 2025

Plus, a (potentially wrong) pointer: seems like this function for measuring distance switches from the system-provided, rule-accurate measuring to foundry's built-in measuring if you aren't using a square grid. Perhaps it should also fall back on foundry's own measuring when the square grid diagonal setting has been changed? For example:

function measureDistance(p0: Point, p1: Point): number {
    if (canvas.grid.type !== CONST.GRID_TYPES.SQUARE
      || (canvas.grid as SquareGrid).diagonals !== CONST.GRID_DIAGONALS.ALTERNATING_1) {
        return canvas.grid.measurePath([p0, p1]).distance;
    }

    return measureDistanceOnGrid(new Ray(p0, p1));
}

Edit: Ignore that, that code is irrelevant. However, making the same modification in this code seems to work (tested it with a quick and dirty modification of the js).

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

No branches or pull requests

1 participant