Second implementation of Sandworms

Fix tabs in AttackSwallow.cs
This commit is contained in:
penev92
2014-11-02 14:17:52 +02:00
parent 5da5bce405
commit 1057f8ff3b
18 changed files with 500 additions and 34 deletions

View File

@@ -10,6 +10,7 @@
using System.Drawing;
using System.Linq;
using OpenRA.Mods.RA.Move;
using OpenRA.Traits;
namespace OpenRA.Mods.RA
@@ -163,12 +164,15 @@ namespace OpenRA.Mods.RA
nextScanTime = self.World.SharedRandom.Next(info.MinimumScanTimeInterval, info.MaximumScanTimeInterval);
var inRange = self.World.FindActorsInCircle(self.CenterPosition, range);
var mobile = self.TraitOrDefault<Mobile>();
return inRange
.Where(a =>
a.AppearsHostileTo(self) &&
!a.HasTrait<AutoTargetIgnore>() &&
attack.HasAnyValidWeapons(Target.FromActor(a)) &&
self.Owner.Shroud.IsTargetable(a))
a.AppearsHostileTo(self) &&
!a.HasTrait<AutoTargetIgnore>() &&
attack.HasAnyValidWeapons(Target.FromActor(a)) &&
self.Owner.Shroud.IsTargetable(a) &&
(!attack.Info.AttackRequiresEnteringCell || (mobile != null && mobile.MovementSpeedForCell(self, a.Location) != 0))
)
.ClosestTo(self);
}
}