tposney / midi-qol

Other
5 stars 0 forks source link

Suggestion: Hooks for marked character movement #807

Open tposney opened 2 years ago

tposney commented 2 years ago

In GitLab by @TogaParty on Apr 7, 2022, 05:46

In SW5e, at least, there are a number of abilities that essentially trigger an opportunity attack when a marked character moves 5 feet (. It would be great if it were possible to prompt for a reaction attack when a character that is marked with a DAE effect moves.

An example of this includes "Sharpshooter Style", but there are also ranger and fighter abilities that essentially function the same way.

tposney commented 2 years ago

It's something that I need to think about, but it's actually potentially hard, but there are cases in DND as well, reacting when another token is hit.

The current reaction check is quite naive and does a linear search of all items held by the character being checked, which is ok since it's only a single token (the target) to check.

Since any token could need to react to the movement it means checking every token whenever a token moves. And checking for reactions (currently) meas a linear search through every item held by every token on the canvas whenever a token moves.

It should be fine for small scenes but for big battle maps could actually be a problem.

I'm wondering if I need to maintain a list of triggers and associated tokens so that the search can be much quicker.

tposney commented 2 years ago

In GitLab by @TogaParty on Apr 13, 2022, 11:08

For the most immediate case I'm looking at (at least), I'm just looking to monitor movement on a single marked target (multiple SW5e abilities work this way). Broader opportunity attack monitoring would be cool, but I can see where it would be problematic, especially since there are also abilities that stipulate movement that does not trigger attacks of opportunity.