Add a damagetype option to SelfHealing.

This commit is contained in:
Zimmermann Gyula
2016-07-06 16:48:46 +02:00
parent 4fa70cdfb9
commit 3ac5e0b455

View File

@@ -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<string> DamageTypes = new HashSet<string>();
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));
}
}