diff --git a/OpenRA.Mods.RA/AutoTarget.cs b/OpenRA.Mods.RA/AutoTarget.cs index e29d20199e..2d59f5bcfe 100644 --- a/OpenRA.Mods.RA/AutoTarget.cs +++ b/OpenRA.Mods.RA/AutoTarget.cs @@ -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; diff --git a/mods/ra/rules/aircraft.yaml b/mods/ra/rules/aircraft.yaml index a5e4c7563c..678d22bd15 100644 --- a/mods/ra/rules/aircraft.yaml +++ b/mods/ra/rules/aircraft.yaml @@ -102,6 +102,10 @@ MIG: ROT: 5 Speed: 186 RearmBuildings: afld + AutoTarget: + TargetWhenIdle: false + TargetWhenDamaged: false + EnableStances: false RenderUnit: CameraPitch: 99 WithShadow: @@ -154,6 +158,10 @@ YAK: InitialFacing: 192 ROT: 5 Speed: 149 + AutoTarget: + TargetWhenIdle: false + TargetWhenDamaged: false + EnableStances: false RenderUnit: CameraPitch: 99 WithShadow: @@ -261,6 +269,10 @@ HELI: InitialFacing: 20 ROT: 4 Speed: 149 + AutoTarget: + TargetWhenIdle: false + TargetWhenDamaged: false + EnableStances: false RenderUnit: WithRotor: Offset: 0,0,85 @@ -307,6 +319,10 @@ HIND: InitialFacing: 20 ROT: 4 Speed: 112 + AutoTarget: + TargetWhenIdle: false + TargetWhenDamaged: false + EnableStances: false RenderUnit: WithRotor: WithShadow: