manuelVo / foundryvtt-drag-ruler

A Foundry VTT module that shows a ruler when dragging tokens so you can see how far you've dragged them
MIT License
39 stars 50 forks source link

Terrain Mapper compatibility #306

Open caewok opened 9 months ago

caewok commented 9 months ago

Terrain Mapper is a new module that lets the GM label the canvas with terrains. Each terrain can apply active effects to the token. This PR adds a check, relying on the Terrain Mapper API, to recalculate the distance based on whether each ruler segment will cross terrains.

Essentially, if the segment path hits a terrain that affects the token actor's movement attribute, the bonus/penalty is calculated for the affected portion of the segment. The total distance, for purposes of determining Drag Ruler color, is then adjusted based on this bonus/penalty.