Add AttackMove support to RA aircraft.

This commit is contained in:
Paul Chote
2014-01-19 11:07:47 +13:00
parent 61f5ab7167
commit d13e7ed432
2 changed files with 23 additions and 3 deletions

View File

@@ -29,6 +29,10 @@ namespace OpenRA.Mods.RA
[Desc("Ticks to wait until next AutoTarget: attempt.")]
public readonly int MaximumScanTimeInterval = 8;
public readonly bool TargetWhenIdle = true;
public readonly bool TargetWhenDamaged = true;
public readonly bool EnableStances = true;
public object Create(ActorInitializer init) { return new AutoTarget(init.self, this); }
}
@@ -59,13 +63,13 @@ namespace OpenRA.Mods.RA
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "SetUnitStance")
if (order.OrderString == "SetUnitStance" && info.EnableStances)
Stance = (UnitStance)order.TargetLocation.X;
}
public void Damaged(Actor self, AttackInfo e)
{
if (!self.IsIdle)
if (!self.IsIdle || !info.TargetWhenDamaged)
return;
if (e.Attacker.Destroyed)
@@ -93,7 +97,7 @@ namespace OpenRA.Mods.RA
public void TickIdle(Actor self)
{
if (Stance < UnitStance.Defend)
if (Stance < UnitStance.Defend || !info.TargetWhenIdle)
return;
var allowMovement = info.AllowMovement && Stance != UnitStance.Defend;