Add sprite trail support to NukeLaunch/NukePower

This commit is contained in:
reaperrr
2019-04-11 20:47:34 +02:00
committed by reaperrr
parent 4a71a6746f
commit 78f538f103
2 changed files with 48 additions and 3 deletions

View File

@@ -41,6 +41,24 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Custom palette is a player palette BaseName.")]
public readonly bool IsPlayerPalette = false;
[Desc("Trail animation.")]
public readonly string TrailImage = null;
[Desc("Loop a randomly chosen sequence of TrailImage from this list while this projectile is moving.")]
[SequenceReference("TrailImage")] public readonly string[] TrailSequences = { "idle" };
[Desc("Interval in ticks between each spawned Trail animation.")]
public readonly int TrailInterval = 1;
[Desc("Delay in ticks until trail animation is spawned.")]
public readonly int TrailDelay = 1;
[Desc("Palette used to render the trail sequence.")]
[PaletteReference("TrailUsePlayerPalette")] public readonly string TrailPalette = "effect";
[Desc("Use the Player Palette to render the trail sequence.")]
public readonly bool TrailUsePlayerPalette = false;
[Desc("Travel time - split equally between ascent and descent.")]
public readonly int FlightDelay = 400;
@@ -117,7 +135,8 @@ namespace OpenRA.Mods.Common.Traits
self.CenterPosition + body.LocalToWorld(info.SpawnOffset),
targetPosition,
info.FlightVelocity, info.MissileDelay, info.FlightDelay, info.SkipAscent,
info.FlashType);
info.FlashType,
info.TrailImage, info.TrailSequences, info.TrailPalette, info.TrailUsePlayerPalette, info.TrailDelay, info.TrailInterval);
self.World.AddFrameEndTask(w => w.Add(missile));