diff --git a/OpenRA.Mods.Common/Effects/NukeLaunch.cs b/OpenRA.Mods.Common/Effects/NukeLaunch.cs index feece05e42..883d3d5284 100644 --- a/OpenRA.Mods.Common/Effects/NukeLaunch.cs +++ b/OpenRA.Mods.Common/Effects/NukeLaunch.cs @@ -23,6 +23,7 @@ namespace OpenRA.Mods.Common.Effects readonly Player firedBy; readonly Animation anim; readonly WeaponInfo weapon; + readonly string weaponPalette; readonly string flashType; readonly WPos ascendSource; @@ -35,10 +36,12 @@ namespace OpenRA.Mods.Common.Effects WPos pos; int ticks; - public NukeLaunch(Player firedBy, string name, WeaponInfo weapon, WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType) + public NukeLaunch(Player firedBy, string name, WeaponInfo weapon, string weaponPalette, + WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType) { this.firedBy = firedBy; this.weapon = weapon; + this.weaponPalette = weaponPalette; this.delay = delay; turn = delay / 2; this.flashType = flashType; @@ -91,7 +94,7 @@ namespace OpenRA.Mods.Common.Effects public IEnumerable Render(WorldRenderer wr) { - return anim.Render(pos, wr.Palette("effect")); + return anim.Render(pos, wr.Palette(weaponPalette)); } public float FractionComplete { get { return ticks * 1f / delay; } } diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index cf9bd82482..1f01b25124 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -21,9 +21,17 @@ namespace OpenRA.Mods.Common.Traits class NukePowerInfo : SupportPowerInfo, IRulesetLoaded, Requires { [WeaponReference] + [Desc("Weapon to use for the impact.", + "But also image to use for the missile.", + "Requires an 'up' and a 'down' sequence on the image.")] public readonly string MissileWeapon = ""; + + [Desc("Offset from the actor the missile spawns on.")] public readonly WVec SpawnOffset = WVec.Zero; + [Desc("Palette to use for the missile weapon image.")] + [PaletteReference] public readonly string MissilePalette = "effect"; + [Desc("Travel time - split equally between ascent and descent")] public readonly int FlightDelay = 400; @@ -86,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits } var targetPosition = self.World.Map.CenterOfCell(order.TargetLocation); - var missile = new NukeLaunch(self.Owner, info.MissileWeapon, info.WeaponInfo, + var missile = new NukeLaunch(self.Owner, info.MissileWeapon, info.WeaponInfo, info.MissilePalette, self.CenterPosition + body.LocalToWorld(info.SpawnOffset), targetPosition, info.FlightVelocity, info.FlightDelay, info.SkipAscent,