Merge pull request #11974 from abc013/SecondWeaponAnimation

Add support for multiple fire animations in WithInfantryBody
This commit is contained in:
abcdefg30
2016-10-15 12:49:41 +02:00
committed by GitHub
14 changed files with 81 additions and 51 deletions

View File

@@ -30,13 +30,13 @@ namespace OpenRA.Mods.RA.Activities
int ticks;
WAngle angle;
public Leap(Actor self, Actor target, WeaponInfo weapon, WDist speed, WAngle angle)
public Leap(Actor self, Actor target, Armament a, WDist speed, WAngle angle)
{
var targetMobile = target.TraitOrDefault<Mobile>();
if (targetMobile == null)
throw new InvalidOperationException("Leap requires a target actor with the Mobile trait");
this.weapon = weapon;
this.weapon = a.Weapon;
this.angle = angle;
mobile = self.Trait<Mobile>();
mobile.SetLocation(mobile.FromCell, mobile.FromSubCell, targetMobile.FromCell, targetMobile.FromSubCell);
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Activities
length = Math.Max((to - from).Length / speed.Length, 1);
// HACK: why isn't this using the interface?
self.Trait<WithInfantryBody>().Attacking(self, Target.FromActor(target));
self.Trait<WithInfantryBody>().Attacking(self, Target.FromActor(target), a);
if (weapon.Report != null && weapon.Report.Any())
Game.Sound.Play(weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Traits
return;
self.CancelActivity();
self.QueueActivity(new Leap(self, target.Actor, a.Weapon, info.Speed, info.Angle));
self.QueueActivity(new Leap(self, target.Actor, a, info.Speed, info.Angle));
}
}
}