From a7a6815f991cca1cc113635f12ef2559a165a07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 19 Feb 2016 09:37:32 +0100 Subject: [PATCH] Lint test the nuke missile sprites. --- OpenRA.Mods.Common/Effects/NukeLaunch.cs | 8 +++++--- OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Effects/NukeLaunch.cs b/OpenRA.Mods.Common/Effects/NukeLaunch.cs index 2b024d301a..eec0589d93 100644 --- a/OpenRA.Mods.Common/Effects/NukeLaunch.cs +++ b/OpenRA.Mods.Common/Effects/NukeLaunch.cs @@ -25,6 +25,7 @@ namespace OpenRA.Mods.Common.Effects readonly Animation anim; readonly WeaponInfo weapon; readonly string weaponPalette; + readonly string downSequence; readonly string flashType; readonly WPos ascendSource; @@ -37,12 +38,13 @@ namespace OpenRA.Mods.Common.Effects WPos pos; int ticks; - public NukeLaunch(Player firedBy, string name, WeaponInfo weapon, string weaponPalette, + public NukeLaunch(Player firedBy, string name, WeaponInfo weapon, string weaponPalette, string upSequence, string downSequence, WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType) { this.firedBy = firedBy; this.weapon = weapon; this.weaponPalette = weaponPalette; + this.downSequence = downSequence; this.delay = delay; turn = delay / 2; this.flashType = flashType; @@ -54,7 +56,7 @@ namespace OpenRA.Mods.Common.Effects descendTarget = targetPos; anim = new Animation(firedBy.World, name); - anim.PlayRepeating("up"); + anim.PlayRepeating(upSequence); pos = launchPos; if (weapon.Report != null && weapon.Report.Any()) @@ -69,7 +71,7 @@ namespace OpenRA.Mods.Common.Effects anim.Tick(); if (ticks == turn) - anim.PlayRepeating("down"); + anim.PlayRepeating(downSequence); if (ticks <= turn) pos = WPos.LerpQuadratic(ascendSource, ascendTarget, WAngle.Zero, ticks, turn); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index cf0166422f..5be4e41b80 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -23,10 +23,15 @@ namespace OpenRA.Mods.Common.Traits { [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.")] + "Also image to use for the missile.")] public readonly string MissileWeapon = ""; + [Desc("Sprite sequence for the ascending missile.")] + [SequenceReference("MissileWeapon")] public readonly string MissileUp = "up"; + + [Desc("Sprite sequence for the descending missile.")] + [SequenceReference("MissileWeapon")] public readonly string MissileDown = "down"; + [Desc("Offset from the actor the missile spawns on.")] public readonly WVec SpawnOffset = WVec.Zero; @@ -95,7 +100,7 @@ namespace OpenRA.Mods.Common.Traits } var targetPosition = self.World.Map.CenterOfCell(order.TargetLocation); - var missile = new NukeLaunch(self.Owner, info.MissileWeapon, info.WeaponInfo, info.MissilePalette, + var missile = new NukeLaunch(self.Owner, info.MissileWeapon, info.WeaponInfo, info.MissilePalette, info.MissileUp, info.MissileDown, self.CenterPosition + body.LocalToWorld(info.SpawnOffset), targetPosition, info.FlightVelocity, info.FlightDelay, info.SkipAscent,