Add AttackMove support to RA aircraft.
This commit is contained in:
@@ -29,6 +29,10 @@ namespace OpenRA.Mods.RA
|
|||||||
[Desc("Ticks to wait until next AutoTarget: attempt.")]
|
[Desc("Ticks to wait until next AutoTarget: attempt.")]
|
||||||
public readonly int MaximumScanTimeInterval = 8;
|
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); }
|
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)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (order.OrderString == "SetUnitStance")
|
if (order.OrderString == "SetUnitStance" && info.EnableStances)
|
||||||
Stance = (UnitStance)order.TargetLocation.X;
|
Stance = (UnitStance)order.TargetLocation.X;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
public void Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (!self.IsIdle)
|
if (!self.IsIdle || !info.TargetWhenDamaged)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (e.Attacker.Destroyed)
|
if (e.Attacker.Destroyed)
|
||||||
@@ -93,7 +97,7 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public void TickIdle(Actor self)
|
public void TickIdle(Actor self)
|
||||||
{
|
{
|
||||||
if (Stance < UnitStance.Defend)
|
if (Stance < UnitStance.Defend || !info.TargetWhenIdle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var allowMovement = info.AllowMovement && Stance != UnitStance.Defend;
|
var allowMovement = info.AllowMovement && Stance != UnitStance.Defend;
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ MIG:
|
|||||||
ROT: 5
|
ROT: 5
|
||||||
Speed: 186
|
Speed: 186
|
||||||
RearmBuildings: afld
|
RearmBuildings: afld
|
||||||
|
AutoTarget:
|
||||||
|
TargetWhenIdle: false
|
||||||
|
TargetWhenDamaged: false
|
||||||
|
EnableStances: false
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
CameraPitch: 99
|
CameraPitch: 99
|
||||||
WithShadow:
|
WithShadow:
|
||||||
@@ -154,6 +158,10 @@ YAK:
|
|||||||
InitialFacing: 192
|
InitialFacing: 192
|
||||||
ROT: 5
|
ROT: 5
|
||||||
Speed: 149
|
Speed: 149
|
||||||
|
AutoTarget:
|
||||||
|
TargetWhenIdle: false
|
||||||
|
TargetWhenDamaged: false
|
||||||
|
EnableStances: false
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
CameraPitch: 99
|
CameraPitch: 99
|
||||||
WithShadow:
|
WithShadow:
|
||||||
@@ -261,6 +269,10 @@ HELI:
|
|||||||
InitialFacing: 20
|
InitialFacing: 20
|
||||||
ROT: 4
|
ROT: 4
|
||||||
Speed: 149
|
Speed: 149
|
||||||
|
AutoTarget:
|
||||||
|
TargetWhenIdle: false
|
||||||
|
TargetWhenDamaged: false
|
||||||
|
EnableStances: false
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
WithRotor:
|
WithRotor:
|
||||||
Offset: 0,0,85
|
Offset: 0,0,85
|
||||||
@@ -307,6 +319,10 @@ HIND:
|
|||||||
InitialFacing: 20
|
InitialFacing: 20
|
||||||
ROT: 4
|
ROT: 4
|
||||||
Speed: 112
|
Speed: 112
|
||||||
|
AutoTarget:
|
||||||
|
TargetWhenIdle: false
|
||||||
|
TargetWhenDamaged: false
|
||||||
|
EnableStances: false
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
WithRotor:
|
WithRotor:
|
||||||
WithShadow:
|
WithShadow:
|
||||||
|
|||||||
Reference in New Issue
Block a user