make attacks queuable

This commit is contained in:
Bob
2010-11-13 15:17:48 +13:00
parent 10ed3db71d
commit 7306de3730
9 changed files with 61 additions and 29 deletions

View File

@@ -149,8 +149,7 @@ namespace OpenRA.Mods.RA
{
if (order.OrderString == "Attack")
{
self.CancelActivity();
QueueAttack(self, Target.FromOrder(order));
QueueAttack(self, order.Queued, Target.FromOrder(order));
if (self.Owner == self.World.LocalPlayer)
self.World.AddFrameEndTask(w =>
@@ -181,7 +180,7 @@ namespace OpenRA.Mods.RA
return (order.OrderString == "Attack") ? "Attack" : null;
}
protected abstract void QueueAttack(Actor self, Target newTarget);
protected abstract void QueueAttack(Actor self, bool queued, Target newTarget);
public bool HasAnyValidWeapons(Target t) { return Weapons.Any(w => w.IsValidAgainst(self.World, t)); }
public float GetMaximumRange() { return Weapons.Max(w => w.Info.Range); }