split rotor offsets from turret offsets

This commit is contained in:
Chris Forbes
2009-12-31 13:44:52 +13:00
parent 3cd89e1f69
commit d0c13c44b2
3 changed files with 12 additions and 6 deletions

View File

@@ -43,6 +43,8 @@ namespace OpenRa.Game.GameRules
public readonly string[] BuiltAt = { };
public readonly int[] PrimaryOffset = { 0, 0 };
public readonly int[] SecondaryOffset = null;
public readonly int[] RotorOffset = { 0, 0 };
public readonly int[] RotorOffset2 = null;
public readonly int Recoil = 0;
public readonly bool MuzzleFlash = false;
public readonly int SelectionPriority = 10;

View File

@@ -16,16 +16,16 @@ namespace OpenRa.Game.Traits
rotorAnim.PlayRepeating("rotor");
anims.Add( "rotor_1", new AnimationWithOffset(
rotorAnim,
() => Util.GetTurretPosition( self, unit, self.Info.PrimaryOffset, 0 ),
() => Util.GetTurretPosition( self, unit, self.Info.RotorOffset, 0 ),
null ) );
if( self.Info.SecondaryOffset == null ) return;
if (self.Info.RotorOffset2 == null) return;
secondRotorAnim = new Animation( self.Info.Name );
secondRotorAnim.PlayRepeating( "rotor2" );
anims.Add( "rotor_2", new AnimationWithOffset(
secondRotorAnim,
() => Util.GetTurretPosition( self, unit, self.Info.SecondaryOffset, 0 ),
() => Util.GetTurretPosition(self, unit, self.Info.RotorOffset2, 0),
null ) );
}