diff --git a/OpenRa.Game/GameRules/UnitInfo.cs b/OpenRa.Game/GameRules/UnitInfo.cs index 420ca1811f..273041bbb9 100755 --- a/OpenRa.Game/GameRules/UnitInfo.cs +++ b/OpenRa.Game/GameRules/UnitInfo.cs @@ -50,6 +50,7 @@ namespace OpenRa.Game.GameRules public readonly int[] PrimaryOffset = { 0, 0 }; public readonly int[] SecondaryOffset = null; public readonly int Recoil = 0; + public readonly string SecondaryAnim = null; public UnitInfo(string name) { Name = name; } diff --git a/OpenRa.Game/Traits/RenderUnitRotor.cs b/OpenRa.Game/Traits/RenderUnitRotor.cs index 18af28651b..73908d1c82 100755 --- a/OpenRa.Game/Traits/RenderUnitRotor.cs +++ b/OpenRa.Game/Traits/RenderUnitRotor.cs @@ -8,13 +8,19 @@ namespace OpenRa.Game.Traits { class RenderUnitRotor : RenderUnit { - public Animation rotorAnim; + public Animation rotorAnim, secondRotorAnim; public RenderUnitRotor( Actor self ) : base(self) { rotorAnim = new Animation(self.unitInfo.Name); rotorAnim.PlayRepeating("rotor"); + + if (self.unitInfo.SecondaryAnim != null) + { + secondRotorAnim = new Animation(self.unitInfo.Name); + rotorAnim.PlayRepeating(self.unitInfo.SecondaryAnim); + } } public override IEnumerable> Render(Actor self) @@ -25,7 +31,7 @@ namespace OpenRa.Game.Traits yield return Util.Centered(rotorAnim.Image, self.CenterLocation + Util.GetTurretPosition(self, self.unitInfo.PrimaryOffset, 0)); if (self.unitInfo.SecondaryOffset != null) - yield return Util.Centered(rotorAnim.Image, self.CenterLocation + yield return Util.Centered((secondRotorAnim ?? rotorAnim).Image, self.CenterLocation + Util.GetTurretPosition(self, self.unitInfo.SecondaryOffset, 0)); } @@ -33,6 +39,8 @@ namespace OpenRa.Game.Traits { base.Tick(self); rotorAnim.Tick(); + if (secondRotorAnim != null) + secondRotorAnim.Tick(); } } } diff --git a/sequences.xml b/sequences.xml index 9c1a83451e..b4f87200bf 100644 --- a/sequences.xml +++ b/sequences.xml @@ -499,6 +499,9 @@ + + + diff --git a/units.ini b/units.ini index 759c693bd3..2a4dbdcf59 100755 --- a/units.ini +++ b/units.ini @@ -126,6 +126,7 @@ PrimaryOffset=0,14,0,-4 SecondaryOffset=0,-14,0,-2 BuiltAt=hpad Traits=Mobile, RenderUnitRotor +SecondaryAnim=rotor2 [HELI] Description=Longbow BuiltAt=hpad