Add DamageTypes to Kill() and make some traits use it.

This commit is contained in:
Mustafa Alperen Seki
2018-02-03 11:07:02 +03:00
committed by reaperrr
parent b620e8107f
commit 5e7e3bb011
17 changed files with 58 additions and 22 deletions

View File

@@ -9,6 +9,7 @@
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
@@ -163,9 +164,12 @@ namespace OpenRA.Mods.Common.Traits
}
}
public void Kill(Actor self, Actor attacker)
public void Kill(Actor self, Actor attacker, HashSet<string> damageTypes = null)
{
InflictDamage(self, attacker, new Damage(MaxHP), true);
if (damageTypes == null)
damageTypes = new HashSet<string>();
InflictDamage(self, attacker, new Damage(MaxHP, damageTypes), true);
}
void ITick.Tick(Actor self)