diff --git a/OpenRA.Mods.RA/SupportPowers/NukePower.cs b/OpenRA.Mods.RA/SupportPowers/NukePower.cs index 2f057e68e0..55182b85fa 100755 --- a/OpenRA.Mods.RA/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/NukePower.cs @@ -32,6 +32,16 @@ namespace OpenRA.Mods.RA [Desc("Descend immediately on the target, with half the FlightDelay")] public readonly bool SkipAscent = false; + [ActorReference] + [Desc("Actor to spawn before detonation")] + public readonly string CameraActor = null; + + [Desc("Amount of time before detonation to spawn the camera")] + public readonly int CameraSpawnAdvance = 25; + + [Desc("Amount of time after detonation to remove the camera")] + public readonly int CameraRemoveDelay = 25; + public override object Create(ActorInitializer init) { return new NukePower(init.self, this); } } @@ -68,6 +78,21 @@ namespace OpenRA.Mods.RA self.CenterPosition + body.LocalToWorld(npi.SpawnOffset), order.TargetLocation.CenterPosition, npi.FlightVelocity, npi.FlightDelay, npi.SkipAscent))); + + if (npi.CameraActor != null) + { + var camera = self.World.CreateActor(false, npi.CameraActor, new TypeDictionary + { + new LocationInit(order.TargetLocation), + new OwnerInit(self.Owner), + }); + + camera.QueueActivity(new Wait(npi.CameraSpawnAdvance + npi.CameraRemoveDelay)); + camera.QueueActivity(new RemoveSelf()); + + Action addCamera = () => self.World.AddFrameEndTask(w => w.Add(camera)); + self.World.AddFrameEndTask(w => w.Add(new DelayedAction(npi.FlightDelay - npi.CameraSpawnAdvance, addCamera))); + } } } } diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index c8ef34c8a0..dac6f9b5f1 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -499,6 +499,7 @@ TMPL: DisplayBeacon: True BeaconPoster: atomic DisplayRadarPing: True + CameraActor: camera SupportPowerChargeBar: GUN: diff --git a/mods/d2k/rules/harkonnen.yaml b/mods/d2k/rules/harkonnen.yaml index a22a46a697..0ccdcf70dd 100644 --- a/mods/d2k/rules/harkonnen.yaml +++ b/mods/d2k/rules/harkonnen.yaml @@ -98,6 +98,7 @@ PALACEH: SpawnOffset: -512,1c171,0 DisplayBeacon: True DisplayRadarPing: True + CameraActor: camera CanPowerDown: DisabledOverlay: RequiresPower: diff --git a/mods/d2k/rules/misc.yaml b/mods/d2k/rules/misc.yaml index 4ee97c7222..44040506e8 100644 --- a/mods/d2k/rules/misc.yaml +++ b/mods/d2k/rules/misc.yaml @@ -115,3 +115,11 @@ SPICEBLOOM: Terrain: Spice BodyOrientation: +CAMERA: + Immobile: + OccupiesSpace: false + Health: + HP: 1000 + RevealsShroud: + Range: 8c0 + BodyOrientation: diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 4d4dae93dd..a2be332b8f 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -40,6 +40,7 @@ MSLO: DisplayBeacon: True DisplayRadarPing: True BeaconPoster: atomicon + CameraActor: camera CanPowerDown: RequiresPower: DisabledOverlay: