facings for the rest of mods/ra.

This commit is contained in:
Bob
2010-02-11 13:27:10 +13:00
parent 31f4e23081
commit bb18e426cd
8 changed files with 61 additions and 59 deletions

View File

@@ -19,7 +19,7 @@ namespace OpenRa.Traits
var attack = self.traits.GetOrDefault<AttackBase>();
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
var turretAnim = new Animation(GetImage(self));
var turretAnim = new Animation(GetImage(self), () => turreted.turretFacing );
turretAnim.PlayFacing( "turret", () => turreted.turretFacing );
if( attackInfo.PrimaryOffset != null )
@@ -36,10 +36,9 @@ namespace OpenRa.Traits
if( attackInfo.MuzzleFlash )
{
var muzzleFlash = new Animation( GetImage(self) );
var muzzleFlash = new Animation( GetImage(self), () => self.traits.Get<Turreted>().turretFacing );
muzzleFlash.PlayFetchIndex( "muzzle",
() => ( Util.QuantizeFacing( self.traits.Get<Turreted>().turretFacing, 8 ) ) * 6
+ (int)( attack.primaryRecoil * 5.9f ) ); /* hack: recoil can be 1.0f, but don't overflow into next anim */
() => (int)( attack.primaryRecoil * 5.9f ) ); /* hack: recoil can be 1.0f, but don't overflow into next anim */
anims.Add( "muzzle_flash", new AnimationWithOffset(
muzzleFlash,
() => Util.GetTurretPosition(self, unit, attackInfo.PrimaryOffset, attack.primaryRecoil),