Add DamageTypes to Kill() and make some traits use it.
This commit is contained in:
committed by
reaperrr
parent
b620e8107f
commit
5e7e3bb011
@@ -10,6 +10,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.GameRules;
|
||||
@@ -29,8 +30,9 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
WPos to;
|
||||
int ticks;
|
||||
WAngle angle;
|
||||
HashSet<string> damageTypes;
|
||||
|
||||
public Leap(Actor self, Actor target, Armament a, WDist speed, WAngle angle)
|
||||
public Leap(Actor self, Actor target, Armament a, WDist speed, WAngle angle, HashSet<string> damageTypes)
|
||||
{
|
||||
var targetMobile = target.TraitOrDefault<Mobile>();
|
||||
if (targetMobile == null)
|
||||
@@ -38,6 +40,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
|
||||
this.weapon = a.Weapon;
|
||||
this.angle = angle;
|
||||
this.damageTypes = damageTypes;
|
||||
mobile = self.Trait<Mobile>();
|
||||
mobile.SetLocation(mobile.FromCell, mobile.FromSubCell, targetMobile.FromCell, targetMobile.FromSubCell);
|
||||
mobile.IsMoving = true;
|
||||
@@ -67,7 +70,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
|
||||
self.World.ActorMap.GetActorsAt(mobile.ToCell, mobile.ToSubCell)
|
||||
.Except(new[] { self }).Where(t => weapon.IsValidAgainst(t, self))
|
||||
.Do(t => t.Kill(self));
|
||||
.Do(t => t.Kill(self, damageTypes));
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user