To start with for clarity, this post is not (directly) about the auras feature in MT (the visual effect). This post is about implementing effects like Paladin auras in 5e that provide a passive buff to other targets.
I am curious how people would approach the problem of implementing auras in MT. So, let's take for example a Paladin aura in 5e that gives a +2 to saving throws while within range. It is easy enough to implement for the Paladin, since the effect originates from the Paladin's token it can be easily "aware" of the feature granting the bonus. But for other tokens, it is not quite so easy. It requires the affected tokens to be somehow "aware" of the aura. I have though of a few ways to solve this issue:
-
Fairly sure this isn't possible, but worth mentioning in case I've missed something. The ideal solution would be for a token to detect when they are in an aura (the MT feature) and gather data about that aura. I don't think a function exists for this, though.
-
Use getTokens() and run though every token on the map to see if they have an aura feature, as well as if they're in range. The effect would be applied as it is needed - e.g. check for an aura when making the saving throw. This seems like it could get very slow to me - especially as the number of tokens increases - so a possible way of optimizing it a bit could be keeping track of the current maximum aura size active, and only using getTokens() for that distance. Would require more work to make sure the max distance is well kept up to date, though. Especially considering monsters would often get dropped in with auras already "active".
-
Similar to the above, but instead check for the aura when moving tokens, then apply/remove a state as appropriate if in range. Essentially shifts the processing time of using getTokens() to token movement, which I think would probably be worse.
Curious if there's ways to do this without using getTokens(), since that seems like the bottleneck here to me.