Added an AttackSequences property to WithInfantryBody

This commit is contained in:
abc013
2016-09-05 13:28:29 +02:00
parent 45f779e9c0
commit ebb1c45786
3 changed files with 26 additions and 8 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));
}
}
}