diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
index 0f6bdf8672..7719f3510d 100644
--- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
+++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
@@ -789,6 +789,7 @@
+
diff --git a/OpenRA.Mods.Common/Traits/RevealOnFire.cs b/OpenRA.Mods.Common/Traits/RevealOnFire.cs
new file mode 100644
index 0000000000..4edeb16f59
--- /dev/null
+++ b/OpenRA.Mods.Common/Traits/RevealOnFire.cs
@@ -0,0 +1,79 @@
+#region Copyright & License Information
+/*
+ * Copyright 2007-2017 The OpenRA Developers (see AUTHORS)
+ * This file is part of OpenRA, which is free software. It is made
+ * available to you under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version. For more
+ * information, see COPYING.
+ */
+#endregion
+
+using System.Linq;
+using OpenRA.Mods.Common.Effects;
+using OpenRA.Traits;
+
+namespace OpenRA.Mods.Common.Traits
+{
+ [Desc("Reveal this actor to the target's owner when attacking.")]
+ public class RevealOnFireInfo : ConditionalTraitInfo
+ {
+ [Desc("The armament types which trigger revealing.")]
+ public readonly string[] ArmamentNames = { "primary", "secondary" };
+
+ [Desc("Stances relative to the target player this actor will be revealed to during firing.")]
+ public readonly Stance RevealForStancesRelativeToTarget = Stance.Ally;
+
+ [Desc("Duration of the reveal.")]
+ public readonly int Duration = 25;
+
+ [Desc("Radius of the reveal around this actor.")]
+ public readonly WDist Radius = new WDist(1536);
+
+ [Desc("Can this actor be revealed through shroud generated by the GeneratesShroud trait?")]
+ public readonly bool RevealGeneratedShroud = true;
+
+ public override object Create(ActorInitializer init) { return new RevealOnFire(init.Self, this); }
+ }
+
+ public class RevealOnFire : ConditionalTrait, INotifyAttack
+ {
+ readonly RevealOnFireInfo info;
+
+ public RevealOnFire(Actor self, RevealOnFireInfo info)
+ : base(info)
+ {
+ this.info = info;
+ }
+
+ void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
+ {
+ if (IsTraitDisabled)
+ return;
+
+ if (!info.ArmamentNames.Contains(a.Info.Name))
+ return;
+
+ var targetPlayer = GetTargetPlayer(target);
+
+ if (targetPlayer != null && targetPlayer.WinState == WinState.Undefined)
+ {
+ self.World.AddFrameEndTask(w => w.Add(new RevealShroudEffect(self.CenterPosition, info.Radius,
+ info.RevealGeneratedShroud ? Shroud.SourceType.Visibility : Shroud.SourceType.PassiveVisibility,
+ targetPlayer, info.RevealForStancesRelativeToTarget, duration: info.Duration)));
+ }
+ }
+
+ Player GetTargetPlayer(Target target)
+ {
+ if (target.Type == TargetType.Actor)
+ return target.Actor.Owner;
+ else if (target.Type == TargetType.FrozenActor && !target.FrozenActor.Actor.IsDead)
+ return target.FrozenActor.Actor.Owner;
+
+ return null;
+ }
+
+ void INotifyAttack.PreparingAttack(Actor self, OpenRA.Traits.Target target, Armament a, Barrel barrel) { }
+ }
+}
diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml
index a9a79c56c4..87ae7ba8f5 100644
--- a/mods/ts/rules/defaults.yaml
+++ b/mods/ts/rules/defaults.yaml
@@ -341,6 +341,7 @@
Palette: pips
ReferencePoint: Bottom, Right
RequiresCondition: hospitalheal
+ RevealOnFire:
^RegularInfantryDeath:
WithDeathAnimation@normal:
@@ -520,6 +521,7 @@
RequiresCondition: criticalspeed
Modifier: 60
Carryable:
+ RevealOnFire:
^Tank:
Inherits: ^Vehicle
@@ -592,6 +594,7 @@
MustBeDestroyed:
RenderVoxels:
WithVoxelBody:
+ RevealOnFire:
^Helicopter:
Inherits: ^Aircraft
@@ -662,6 +665,7 @@
HiddenUnderFog:
Guardable:
WithSpriteBody:
+ RevealOnFire:
^BlossomTree:
Inherits@1: ^SpriteActor
@@ -747,6 +751,7 @@
Range: 6c0
DetectCloaked:
Range: 5c0
+ RevealOnFire:
^Train:
Inherits@1: ^EmpDisable
diff --git a/mods/ts/rules/nod-support.yaml b/mods/ts/rules/nod-support.yaml
index 0739de0296..4c642e930a 100644
--- a/mods/ts/rules/nod-support.yaml
+++ b/mods/ts/rules/nod-support.yaml
@@ -218,6 +218,7 @@ GAARTY:
NoTransformSounds:
Voice: Move
WithMuzzleOverlay:
+ RevealOnFire:
NAMISL:
Inherits: ^Building
diff --git a/mods/ts/rules/nod-vehicles.yaml b/mods/ts/rules/nod-vehicles.yaml
index bdf5be7144..3c103ebaef 100644
--- a/mods/ts/rules/nod-vehicles.yaml
+++ b/mods/ts/rules/nod-vehicles.yaml
@@ -165,6 +165,8 @@ TTNK:
AutoTarget:
Carryable:
RequiresCondition: undeployed
+ RevealOnFire:
+ ArmamentNames: primary, deployed
ART2:
Inherits: ^Tank