From 3ac5e0b45575ab9bce33eb9b64ab4f56958b2385 Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Wed, 6 Jul 2016 16:48:46 +0200 Subject: [PATCH] Add a damagetype option to SelfHealing. --- OpenRA.Mods.Common/Traits/SelfHealing.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/SelfHealing.cs b/OpenRA.Mods.Common/Traits/SelfHealing.cs index ed39fcaa38..745455ed2f 100644 --- a/OpenRA.Mods.Common/Traits/SelfHealing.cs +++ b/OpenRA.Mods.Common/Traits/SelfHealing.cs @@ -9,6 +9,7 @@ */ #endregion +using System.Collections.Generic; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits @@ -30,6 +31,9 @@ namespace OpenRA.Mods.Common.Traits public readonly int DamageCooldown = 0; + [Desc("Apply the selfhealing using these damagetypes.")] + public readonly HashSet DamageTypes = new HashSet(); + public override object Create(ActorInitializer init) { return new SelfHealing(init.Self, this); } } @@ -63,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits if (--ticks <= 0) { ticks = Info.Delay; - self.InflictDamage(self, new Damage(-(Info.Step + Info.PercentageStep * health.MaxHP / 100))); + self.InflictDamage(self, new Damage(-(Info.Step + Info.PercentageStep * health.MaxHP / 100), Info.DamageTypes)); } }