region work
This commit is contained in:
@@ -107,19 +107,13 @@ private static final int cellGap = 1;
|
||||
}
|
||||
|
||||
public static boolean inRangeDropAggro(Mob agent, AbstractCharacter target) {
|
||||
float range = MobAIThread.AI_BASE_AGGRO_RANGE * MobAIThread.AI_BASE_AGGRO_RANGE;
|
||||
if(agent.isPlayerGuard())
|
||||
range = 62500;
|
||||
if(agent.isSiege())
|
||||
range = agent.getRange() * agent.getRange();
|
||||
|
||||
Vector3fImmutable sl = agent.getLoc();
|
||||
Vector3fImmutable tl = target.getLoc();
|
||||
|
||||
float distanceSquaredToTarget = sl.distanceSquared2D(tl) - sqr(agent.calcHitBox() + target.calcHitBox()); //distance to center of target
|
||||
|
||||
float range = agent.getRange() + 150;
|
||||
|
||||
if (range > 200)
|
||||
range = 200;
|
||||
|
||||
|
||||
return distanceSquaredToTarget < sqr(range);
|
||||
return agent.loc.distanceSquared(target.loc) > range;
|
||||
|
||||
}
|
||||
|
||||
@@ -448,7 +442,9 @@ private static final int cellGap = 1;
|
||||
if(building == null)
|
||||
return false;//no building at this location means nothing obstructing the walking path
|
||||
|
||||
if(Regions.getRegionAtLocation(point) != null)
|
||||
Regions region = Regions.getRegionAtLocation(point);
|
||||
if(region != null)
|
||||
if(region.lerpY(point) <= point.y)
|
||||
return false;
|
||||
|
||||
Zone currentZone = ZoneManager.findSmallestZone(point);
|
||||
|
||||
Reference in New Issue
Block a user