diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index 5630466860..cd6d760e14 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -54,9 +54,11 @@ namespace OpenRA.Mods.Common.Traits [Desc("Amount of time before detonation to remove the beacon")] public readonly int BeaconRemoveAdvance = 25; - [ActorReference] - [Desc("Actor to spawn before detonation")] - public readonly string CameraActor = null; + [Desc("Range of cells the camera should reveal around target cell.")] + public readonly WDist CameraRange = WDist.Zero; + + [Desc("Reveal cells to players with these stances only.")] + public readonly Stance CameraStances = Stance.Ally; [Desc("Amount of time before detonation to spawn the camera")] public readonly int CameraSpawnAdvance = 25; @@ -114,19 +116,10 @@ namespace OpenRA.Mods.Common.Traits self.World.AddFrameEndTask(w => w.Add(missile)); - if (info.CameraActor != null) + if (info.CameraRange != WDist.Zero) { - var camera = self.World.CreateActor(false, info.CameraActor, new TypeDictionary - { - new LocationInit(order.TargetLocation), - new OwnerInit(self.Owner), - }); - - camera.QueueActivity(new Wait(info.CameraSpawnAdvance + info.CameraRemoveDelay)); - camera.QueueActivity(new RemoveSelf()); - - Action addCamera = () => self.World.AddFrameEndTask(w => w.Add(camera)); - self.World.AddFrameEndTask(w => w.Add(new DelayedAction(info.FlightDelay - info.CameraSpawnAdvance, addCamera))); + self.World.AddFrameEndTask(w => w.Add(new RevealShroudEffect(targetPosition, info.CameraRange, Shroud.SourceType.Visibility, self.Owner, info.CameraStances, + info.FlightDelay - info.CameraSpawnAdvance, info.CameraSpawnAdvance + info.CameraRemoveDelay))); } if (Info.DisplayBeacon) @@ -142,18 +135,13 @@ namespace OpenRA.Mods.Common.Traits Info.ArrowSequence, Info.CircleSequence, Info.ClockSequence, - () => missile.FractionComplete); - - Action removeBeacon = () => self.World.AddFrameEndTask(w => - { - w.Remove(beacon); - beacon = null; - }); + () => missile.FractionComplete, + Info.BeaconDelay, + info.FlightDelay - info.BeaconRemoveAdvance); self.World.AddFrameEndTask(w => { w.Add(beacon); - w.Add(new DelayedAction(info.FlightDelay - info.BeaconRemoveAdvance, removeBeacon)); }); } } diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index bdd61aa228..06a1c452a5 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -633,7 +633,7 @@ TMPL: BeaconPoster: atomic BeaconPosterPalette: beaconposter DisplayRadarPing: True - CameraActor: camera + CameraRange: 10c0 SupportPowerChargeBar: Power: Amount: -150 diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 4630126854..769e780d10 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -951,7 +951,7 @@ palace: SpawnOffset: -512,1c171,0 DisplayBeacon: True DisplayRadarPing: True - CameraActor: camera + CameraRange: 10c0 ActivationSequence: ProduceActorPower@fremen: Description: Recruit Fremen diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 2520993e2b..490a26c410 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -36,8 +36,8 @@ MSLO: DisplayBeacon: True DisplayRadarPing: True BeaconPoster: atomicon - CameraActor: camera FlashType: Nuke + CameraRange: 10c0 CanPowerDown: PowerupSound: EnablePower PowerdownSound: DisablePower diff --git a/mods/ts/rules/nod-support.yaml b/mods/ts/rules/nod-support.yaml index 62606a522c..0739de0296 100644 --- a/mods/ts/rules/nod-support.yaml +++ b/mods/ts/rules/nod-support.yaml @@ -272,6 +272,6 @@ NAMISL: DisplayBeacon: False DisplayRadarPing: True BeaconPoster: - CameraActor: camera + CameraRange: 10c0 SelectionDecorations: VisualBounds: 75,48