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 string[] BuiltAt = { };
public readonly int[] PrimaryOffset = { 0, 0 }; public readonly int[] PrimaryOffset = { 0, 0 };
public readonly int[] SecondaryOffset = null; public readonly int[] SecondaryOffset = null;
public readonly int[] RotorOffset = { 0, 0 };
public readonly int[] RotorOffset2 = null;
public readonly int Recoil = 0; public readonly int Recoil = 0;
public readonly bool MuzzleFlash = false; public readonly bool MuzzleFlash = false;
public readonly int SelectionPriority = 10; public readonly int SelectionPriority = 10;

View File

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

View File

@@ -176,8 +176,8 @@ InitialFacing=192
LongDesc=Anti-Tanks & Anti-Infantry Plane.\n Strong vs Infantry, Tanks\n Weak vs Buildings LongDesc=Anti-Tanks & Anti-Infantry Plane.\n Strong vs Infantry, Tanks\n Weak vs Buildings
[TRAN] [TRAN]
Description=Transport Helicopter Description=Transport Helicopter
PrimaryOffset=0,14,0,-4 RotorOffset=0,14,0,-4
SecondaryOffset=0,-14,0,-2 RotorOffset2=0,-14,0,-2
BuiltAt=hpad BuiltAt=hpad
Traits=Unit, Helicopter, RenderUnitRotor, WithShadow Traits=Unit, Helicopter, RenderUnitRotor, WithShadow
InitialFacing=20 InitialFacing=20
@@ -186,13 +186,17 @@ LongDesc=Fast Infantry Transport Helicopter.\n Unarmed
Description=Longbow Description=Longbow
BuiltAt=hpad BuiltAt=hpad
Traits=Unit, AttackHeli, Helicopter, RenderUnitRotor, WithShadow, LimitedAmmo Traits=Unit, AttackHeli, Helicopter, RenderUnitRotor, WithShadow, LimitedAmmo
PrimaryOffset=0,0,0,-2 RotorOffset=0,0,0,-2
PrimaryOffset=-5,0,0,2
SecondaryOffset=5,0,0,2
InitialFacing=20 InitialFacing=20
LongDesc=Helicopter Gunship with AG Missiles.\n Strong vs Buildings, Tanks\n Weak vs Infantry LongDesc=Helicopter Gunship with AG Missiles.\n Strong vs Buildings, Tanks\n Weak vs Infantry
[HIND] [HIND]
Description=Hind Description=Hind
BuiltAt=hpad BuiltAt=hpad
Traits=Unit, AttackHeli, Helicopter, RenderUnitRotor, WithShadow, LimitedAmmo Traits=Unit, AttackHeli, Helicopter, RenderUnitRotor, WithShadow, LimitedAmmo
PrimaryOffset=-5,0,0,2
SecondaryOffset=5,0,0,2
InitialFacing=20 InitialFacing=20
LongDesc=Helicopter Gunship with Chainguns.\n Strong vs Infantry, Light Vehicles.\n Weak vs Tanks LongDesc=Helicopter Gunship with Chainguns.\n Strong vs Infantry, Light Vehicles.\n Weak vs Tanks