Make all warheads use WarheadArgs

Instead of passing damageModifiers directly.
This commit is contained in:
reaperrr
2020-05-01 00:54:58 +02:00
committed by Pavel Penev
parent 38cdc93010
commit 2b4035979b
5 changed files with 31 additions and 14 deletions

View File

@@ -10,6 +10,7 @@
#endregion
using System.Collections.Generic;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
@@ -17,10 +18,10 @@ namespace OpenRA.Mods.Common.Warheads
{
public class HealthPercentageDamageWarhead : TargetDamageWarhead
{
protected override void InflictDamage(Actor victim, Actor firedBy, HitShapeInfo hitshapeInfo, IEnumerable<int> damageModifiers)
protected override void InflictDamage(Actor victim, Actor firedBy, HitShape shape, WarheadArgs args)
{
var healthInfo = victim.Info.TraitInfo<HealthInfo>();
var damage = Util.ApplyPercentageModifiers(healthInfo.HP, damageModifiers.Append(Damage, DamageVersus(victim, hitshapeInfo)));
var damage = Util.ApplyPercentageModifiers(healthInfo.HP, args.DamageModifiers.Append(Damage, DamageVersus(victim, shape, args)));
victim.InflictDamage(firedBy, new Damage(damage, DamageTypes));
}
}