diff --git a/OpenRA.Game/Effects/NukeLaunch.cs b/OpenRA.Game/Effects/NukeLaunch.cs index 76ce40a7ff..1b5f1546b8 100644 --- a/OpenRA.Game/Effects/NukeLaunch.cs +++ b/OpenRA.Game/Effects/NukeLaunch.cs @@ -31,7 +31,6 @@ namespace OpenRA.Effects class NukeLaunch : IEffect { readonly ProjectileInfo projectileUp, projectileDown; - readonly WarheadInfo nukeWarhead; readonly Actor silo; Animation anim; float2 pos; @@ -39,14 +38,15 @@ namespace OpenRA.Effects readonly int targetAltitude = 400; int altitude; bool goingUp = true; + WeaponInfo weapon; - public NukeLaunch(Actor silo, int2 targetLocation) + public NukeLaunch(Actor silo, string weapon, int2 targetLocation) { this.silo = silo; this.targetLocation = targetLocation; + this.weapon = Rules.WeaponInfo[weapon]; projectileUp = Rules.ProjectileInfo["NukeUp"]; projectileDown = Rules.ProjectileInfo["NukeDown"]; - nukeWarhead = Rules.WarheadInfo["Nuke"]; anim = new Animation(projectileUp.Image); anim.PlayRepeating("idle"); @@ -79,8 +79,7 @@ namespace OpenRA.Effects void Explode(World world) { world.AddFrameEndTask(w => w.Remove(this)); - var weapon = Rules.WeaponInfo["Atomic"]; - Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, projectileDown, nukeWarhead, silo); + Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, Rules.ProjectileInfo[weapon.Projectile], Rules.WarheadInfo[weapon.Warhead], silo); } public IEnumerable Render() diff --git a/OpenRA.Game/Traits/SupportPowers/NukePower.cs b/OpenRA.Game/Traits/SupportPowers/NukePower.cs index e375392fda..19ec54ad9b 100644 --- a/OpenRA.Game/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Game/Traits/SupportPowers/NukePower.cs @@ -57,8 +57,8 @@ namespace OpenRA.Traits if (Owner != Owner.World.LocalPlayer) Sound.Play("alaunch1.aud"); - // TODO: FIRE ZE MISSILES - w.Add(new NukeLaunch(silo, order.TargetLocation)); + //FIRE ZE MISSILES + w.Add(new NukeLaunch(silo, Info.MissileWeapon, order.TargetLocation)); }); Game.controller.CancelInputMode(); diff --git a/OpenRA.Game/Traits/SupportPowers/SupportPower.cs b/OpenRA.Game/Traits/SupportPowers/SupportPower.cs index 8736744033..ab3a6e19c4 100644 --- a/OpenRA.Game/Traits/SupportPowers/SupportPower.cs +++ b/OpenRA.Game/Traits/SupportPowers/SupportPower.cs @@ -33,6 +33,7 @@ namespace OpenRA.Traits public readonly string[] Prerequisites = { }; public readonly int TechLevel = -1; public readonly bool GivenAuto = true; + public readonly string MissileWeapon = ""; public abstract object Create(Actor self); } diff --git a/mods/ra/rules.yaml b/mods/ra/rules.yaml index f0b863a7eb..622d0c8cea 100644 --- a/mods/ra/rules.yaml +++ b/mods/ra/rules.yaml @@ -50,6 +50,7 @@ Player: LongDesc: Launches a nuclear missile at a target location. Prerequisites: MSLO TechLevel: 12 + MissileWeapon: atomic SonarPulsePower: Image: sonricon ChargeTime: 10