renamed Actor.unitInfo to "Info"; other minor changes

This commit is contained in:
Bob
2009-12-05 19:12:29 +13:00
parent 7f1e34e482
commit 74b7d21d4b
29 changed files with 85 additions and 76 deletions

View File

@@ -13,12 +13,12 @@ namespace OpenRa.Game.Traits
: base(self)
{
self.traits.Get<Turreted>();
turretAnim = new Animation(self.unitInfo.Name);
turretAnim = new Animation(self.Info.Name);
if (self.unitInfo.MuzzleFlash)
if (self.Info.MuzzleFlash)
{
var attack = self.traits.WithInterface<AttackBase>().First();
muzzleFlash = new Animation(self.unitInfo.Name);
muzzleFlash = new Animation(self.Info.Name);
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 */
@@ -35,14 +35,14 @@ namespace OpenRa.Game.Traits
yield return Util.Centered(self, anim.Image, self.CenterLocation);
yield return Util.Centered(self, turretAnim.Image, self.CenterLocation
+ Util.GetTurretPosition(self, unit, self.unitInfo.PrimaryOffset, attack.primaryRecoil));
if (self.unitInfo.SecondaryOffset != null)
+ Util.GetTurretPosition(self, unit, self.Info.PrimaryOffset, attack.primaryRecoil));
if (self.Info.SecondaryOffset != null)
yield return Util.Centered(self, turretAnim.Image, self.CenterLocation
+ Util.GetTurretPosition(self, unit, self.unitInfo.SecondaryOffset, attack.secondaryRecoil));
+ Util.GetTurretPosition(self, unit, self.Info.SecondaryOffset, attack.secondaryRecoil));
if (muzzleFlash != null && attack.primaryRecoil > 0)
yield return Util.Centered(self, muzzleFlash.Image, self.CenterLocation
+ Util.GetTurretPosition(self, unit, self.unitInfo.PrimaryOffset, attack.primaryRecoil));
+ Util.GetTurretPosition(self, unit, self.Info.PrimaryOffset, attack.primaryRecoil));
}
public override void Tick(Actor self)