collected updates

This commit is contained in:
2024-04-21 13:43:02 -05:00
parent b5f0794866
commit df607d4d66
4 changed files with 1056 additions and 507 deletions
+6 -2
View File
@@ -138,7 +138,10 @@ function getDistance (origin, target) {
const ray = new Ray(origin, target)
const originScale = getScaleDistanceMod(origin)
const targetScale = getScaleDistanceMod(target)
const distance = shim.canvas.grid.measureDistances([{ ray }], { gridSpaces: true })[0]
const flatDistance = shim.canvas.grid.measureDistances(
[{ ray }], { gridSpaces: true })[0]
const elevation = Math.abs(origin.document.elevation - target.document.elevation)
const distance = Math.sqrt(elevation * elevation + flatDistance * flatDistance)
return distance - (originScale + targetScale)
}
@@ -178,7 +181,8 @@ function calcGangup (attacker, target, debug) {
t.id !== target.id &&
t.actor.system.status.isStunned === false &&
t.visible &&
withinRange(target, t, range)
withinRange(target, t, range) &&
!(t.actor.effects.find(c => c.name === 'Incapacitated' || c.name === 'Defeated'))
)
const attackerAllies = withinRangeOfToken.filter(
t => t.document.disposition === attacker.document.disposition)