collected updates
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user