diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index 05c13c01fb..c408cb1cdd 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -27,6 +27,9 @@ namespace OpenRA.Mods.Common.Traits "Also image to use for the missile.")] public readonly string MissileWeapon = ""; + [Desc("Delay (in ticks) after launch until the missile is spawned.")] + public readonly int MissileDelay = 0; + [Desc("Sprite sequence for the ascending missile.")] [SequenceReference("MissileWeapon")] public readonly string MissileUp = "up"; @@ -110,7 +113,7 @@ namespace OpenRA.Mods.Common.Traits info.FlightVelocity, info.FlightDelay, info.SkipAscent, info.FlashType); - self.World.AddFrameEndTask(w => w.Add(missile)); + self.World.AddFrameEndTask(w => w.Add(new DelayedAction(info.MissileDelay, () => self.World.Add(missile)))); if (info.CameraRange != WDist.Zero) { diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index de0d817b34..ac905ec412 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -1068,6 +1068,7 @@ palace: EndChargeSpeechNotification: DeathHandMissileReady MissileLaunchDetected: MissileLaunchDetected MissileWeapon: atomic + MissileDelay: 19 SpawnOffset: -512,1c171,0 DisplayBeacon: True DisplayRadarPing: True diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 586837b55e..d97d7d9f51 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -42,6 +42,7 @@ MSLO: InsufficientPowerSpeechNotification: InsufficientPower IncomingSpeechNotification: AbombLaunchDetected MissileWeapon: atomic + MissileDelay: 3 SpawnOffset: 0,427,0 DisplayTimerStances: Ally, Neutral, Enemy DisplayBeacon: True