From 4578ea09ba198b4b0d8f70fbf807ada64fbb954e Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Tue, 1 Jan 2019 18:42:49 +0300 Subject: [PATCH] Add DamageTypes to Capture Sabotage --- OpenRA.Mods.Common/Activities/CaptureActor.cs | 2 +- OpenRA.Mods.Common/Traits/Captures.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Activities/CaptureActor.cs b/OpenRA.Mods.Common/Activities/CaptureActor.cs index bf235d4eed..8510c42b88 100644 --- a/OpenRA.Mods.Common/Activities/CaptureActor.cs +++ b/OpenRA.Mods.Common/Activities/CaptureActor.cs @@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Activities if (100 * (long)health.HP > captures.Info.SabotageThreshold * (long)health.MaxHP) { var damage = (int)((long)health.MaxHP * captures.Info.SabotageHPRemoval / 100); - actor.InflictDamage(self, new Damage(damage)); + actor.InflictDamage(self, new Damage(damage, captures.Info.SabotageDamageTypes)); if (captures.Info.ConsumedByCapture) self.Dispose(); diff --git a/OpenRA.Mods.Common/Traits/Captures.cs b/OpenRA.Mods.Common/Traits/Captures.cs index f62ece524a..3b8ec74dda 100644 --- a/OpenRA.Mods.Common/Traits/Captures.cs +++ b/OpenRA.Mods.Common/Traits/Captures.cs @@ -32,6 +32,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Sabotage damage expressed as a percentage of maximum target health.")] public readonly int SabotageHPRemoval = 50; + [Desc("Damage types that applied with the sabotage damage.")] + public readonly BitSet SabotageDamageTypes = default(BitSet); + [Desc("Delay (in ticks) that to wait next to the target before initiating the capture.")] public readonly int CaptureDelay = 0;