diff --git a/OpenRA.Mods.Cnc/IonCannonPower.cs b/OpenRA.Mods.Cnc/IonCannonPower.cs index 78be5acc6a..bfccab5135 100644 --- a/OpenRA.Mods.Cnc/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/IonCannonPower.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 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. For more information, @@ -10,11 +10,21 @@ using OpenRA.Mods.Cnc.Effects; using OpenRA.Mods.RA; +using OpenRA.Mods.RA.Activities; +using OpenRA.Primitives; +using OpenRA.Traits; namespace OpenRA.Mods.Cnc { class IonCannonPowerInfo : SupportPowerInfo { + [ActorReference] + [Desc("Actor to spawn when the attack starts")] + public readonly string CameraActor = null; + + [Desc("Amount of time to keep the camera alive")] + public readonly int CameraRemoveDelay = 25; + public override object Create(ActorInitializer init) { return new IonCannonPower(init.self, this); } } @@ -34,8 +44,21 @@ namespace OpenRA.Mods.Cnc self.World.AddFrameEndTask(w => { + var info = Info as IonCannonPowerInfo; Sound.Play(Info.LaunchSound, order.TargetLocation.CenterPosition); w.Add(new IonCannon(self, w, order.TargetLocation)); + + if (info.CameraActor == null) + return; + + var camera = w.CreateActor(info.CameraActor, new TypeDictionary + { + new LocationInit(order.TargetLocation), + new OwnerInit(self.Owner), + }); + + camera.QueueActivity(new Wait(info.CameraRemoveDelay)); + camera.QueueActivity(new RemoveSelf()); }); } } diff --git a/mods/cnc/rules/misc.yaml b/mods/cnc/rules/misc.yaml index 9b4fe0aeb8..a724f2c0e1 100644 --- a/mods/cnc/rules/misc.yaml +++ b/mods/cnc/rules/misc.yaml @@ -49,7 +49,14 @@ CAMERA: HP: 1000 RevealsShroud: Range: 10c0 - ProximityCaptor: - Types: Camera + BodyOrientation: + +CAMERA.small: + Immobile: + OccupiesSpace: false + Health: + HP: 1000 + RevealsShroud: + Range: 6c0 BodyOrientation: diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 8641a294a9..c8ef34c8a0 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -456,6 +456,7 @@ EYE: SelectTargetSound: select1.aud InsufficientPowerSound: nopower1.aud DisplayRadarPing: True + CameraActor: camera.small SupportPowerChargeBar: TMPL: