fixed #934 -- convert all AttackBase.MuzzleFlash uses to WithMuzzleFlash

This commit is contained in:
Chris Forbes
2011-06-25 11:51:04 +12:00
parent 29b81be5bb
commit 6be55b61aa
4 changed files with 4 additions and 19 deletions

View File

@@ -29,7 +29,6 @@ namespace OpenRA.Mods.RA
public readonly int[] SecondaryLocalOffset = { }; public readonly int[] SecondaryLocalOffset = { };
public readonly int[] PrimaryOffset = { 0, 0 }; public readonly int[] PrimaryOffset = { 0, 0 };
public readonly int[] SecondaryOffset = null; public readonly int[] SecondaryOffset = null;
public readonly bool MuzzleFlash = false;
public readonly int FireDelay = 0; public readonly int FireDelay = 0;
public readonly bool AlignIdleTurrets = false; public readonly bool AlignIdleTurrets = false;

View File

@@ -26,7 +26,6 @@ namespace OpenRA.Mods.RA.Render
var facing = self.Trait<IFacing>(); var facing = self.Trait<IFacing>();
var turreted = self.Trait<Turreted>(); var turreted = self.Trait<Turreted>();
var attack = self.TraitOrDefault<AttackBase>(); var attack = self.TraitOrDefault<AttackBase>();
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
var turretAnim = new Animation(GetImage(self), () => turreted.turretFacing ); var turretAnim = new Animation(GetImage(self), () => turreted.turretFacing );
turretAnim.Play( "turret" ); turretAnim.Play( "turret" );
@@ -38,17 +37,6 @@ namespace OpenRA.Mods.RA.Render
new AnimationWithOffset( turretAnim, new AnimationWithOffset( turretAnim,
() => Combat.GetTurretPosition( self, facing, turret ), () => Combat.GetTurretPosition( self, facing, turret ),
null)); null));
if (attackInfo.MuzzleFlash)
{
var muzzleFlash = new Animation(GetImage(self), () => turreted.turretFacing);
muzzleFlash.PlayFetchIndex("muzzle",
() => (int)(turret.Recoil * 5.9f)); /* hack: dumb crap */
anims.Add("muzzle_flash_{0}".F(i),
new AnimationWithOffset(muzzleFlash,
() => Combat.GetTurretPosition(self, facing, turret),
() => turret.Recoil <= 0));
}
} }
} }
} }

View File

@@ -94,7 +94,6 @@ APC:
AttackFrontal: AttackFrontal:
PrimaryWeapon: QuadCannon PrimaryWeapon: QuadCannon
PrimaryOffset: 0,0,0,-4 PrimaryOffset: 0,0,0,-4
MuzzleFlash: yes
RenderUnit: RenderUnit:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget:
@@ -195,7 +194,7 @@ BGGY:
AttackTurreted: AttackTurreted:
PrimaryWeapon: MachineGun PrimaryWeapon: MachineGun
PrimaryOffset: 0,1,0,-3 PrimaryOffset: 0,1,0,-3
MuzzleFlash: yes WithMuzzleFlash:
RenderUnitTurreted: RenderUnitTurreted:
AutoTarget: AutoTarget:
LeavesHusk: LeavesHusk:
@@ -257,7 +256,7 @@ JEEP:
AttackTurreted: AttackTurreted:
PrimaryWeapon: MachineGun PrimaryWeapon: MachineGun
PrimaryOffset: 0,0,0,-2 PrimaryOffset: 0,0,0,-2
MuzzleFlash: yes WithMuzzleFlash:
RenderUnitTurreted: RenderUnitTurreted:
AutoTarget: AutoTarget:
LeavesHusk: LeavesHusk:

View File

@@ -288,7 +288,7 @@ JEEP:
AttackTurreted: AttackTurreted:
PrimaryWeapon: M60mg PrimaryWeapon: M60mg
PrimaryOffset: 0,0,0,-2 PrimaryOffset: 0,0,0,-2
MuzzleFlash: yes WithMuzzleFlash:
RenderUnitTurreted: RenderUnitTurreted:
AutoTarget: AutoTarget:
Cargo: Cargo:
@@ -319,7 +319,6 @@ APC:
AttackFrontal: AttackFrontal:
PrimaryWeapon: M60mg PrimaryWeapon: M60mg
PrimaryOffset: 0,0,0,-4 PrimaryOffset: 0,0,0,-4
MuzzleFlash: yes
RenderUnit: RenderUnit:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget: