diff --git a/OpenRA.Mods.Common/Traits/RevealOnDeath.cs b/OpenRA.Mods.Common/Traits/RevealOnDeath.cs index 041de6fdda..61b1fb2c8f 100644 --- a/OpenRA.Mods.Common/Traits/RevealOnDeath.cs +++ b/OpenRA.Mods.Common/Traits/RevealOnDeath.cs @@ -9,6 +9,7 @@ */ #endregion +using System.Collections.Generic; using System.Linq; using OpenRA.Mods.Common.Effects; using OpenRA.Traits; @@ -30,6 +31,10 @@ namespace OpenRA.Mods.Common.Traits [Desc("Can this actor be revealed through shroud generated by the GeneratesShroud trait?")] public readonly bool RevealGeneratedShroud = true; + [Desc("DeathTypes for which shroud will be revealed.", + "Use an empty list (the default) to allow all DeathTypes.")] + public readonly HashSet DeathTypes = new HashSet(); + public override object Create(ActorInitializer init) { return new RevealOnDeath(init.Self, this); } } @@ -51,6 +56,9 @@ namespace OpenRA.Mods.Common.Traits if (!self.IsInWorld) return; + if (info.DeathTypes.Count > 0 && !attack.Damage.DamageTypes.Overlaps(info.DeathTypes)) + return; + var owner = self.Owner; if (owner != null && owner.WinState == WinState.Undefined) {