Implement subterranean units.

This commit is contained in:
Paul Chote
2017-01-08 20:10:54 +00:00
parent bb5f25e0dc
commit 572c1cb89f
14 changed files with 228 additions and 9 deletions

View File

@@ -771,7 +771,7 @@ namespace OpenRA.Mods.Common.AI
var path = pathfinder.FindPath(
PathSearch.Search(World, mobileInfo, harvester, true,
loc => domainIndex.IsPassable(harvester.Location, loc, passable) && harvester.CanHarvestAt(loc, resLayer, harvInfo, territory))
loc => domainIndex.IsPassable(harvester.Location, loc, mobileInfo, passable) && harvester.CanHarvestAt(loc, resLayer, harvInfo, territory))
.WithCustomCost(loc => World.FindActorsInCircle(World.Map.CenterOfCell(loc), Info.HarvesterEnemyAvoidanceRadius)
.Where(u => !u.IsDead && harvester.Owner.Stances[u.Owner] == Stance.Enemy)
.Sum(u => Math.Max(WDist.Zero.Length, Info.HarvesterEnemyAvoidanceRadius.Length - (World.Map.CenterOfCell(loc) - u.CenterPosition).Length)))