diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index 49c98d8588..0c0d72e698 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -182,7 +182,8 @@ namespace OpenRA.Mods.Common.Effects if (!string.IsNullOrEmpty(info.Trail) && --smokeTicks < 0) { var delayedPos = WPos.LerpQuadratic(args.Source, target, angle, ticks - info.TrailDelay, length); - world.AddFrameEndTask(w => w.Add(new Smoke(w, delayedPos, GetEffectiveFacing(), info.Trail, trailPalette, info.TrailSequences.Random(world.SharedRandom)))); + world.AddFrameEndTask(w => w.Add(new SpriteEffect(delayedPos, w, info.Trail, info.TrailSequences.Random(world.SharedRandom), + trailPalette, false, false, GetEffectiveFacing()))); smokeTicks = info.TrailInterval; } diff --git a/OpenRA.Mods.Common/Effects/Missile.cs b/OpenRA.Mods.Common/Effects/Missile.cs index 23e078326b..de0f81dfdb 100644 --- a/OpenRA.Mods.Common/Effects/Missile.cs +++ b/OpenRA.Mods.Common/Effects/Missile.cs @@ -820,7 +820,7 @@ namespace OpenRA.Mods.Common.Effects // Create the smoke trail effect if (!string.IsNullOrEmpty(info.TrailImage) && --ticksToNextSmoke < 0 && (state != States.Freefall || info.TrailWhenDeactivated)) { - world.AddFrameEndTask(w => w.Add(new Smoke(w, pos - 3 * move / 2, renderFacing, info.TrailImage, trailPalette, info.TrailSequence))); + world.AddFrameEndTask(w => w.Add(new SpriteEffect(pos - 3 * move / 2, w, info.TrailImage, info.TrailSequence, trailPalette, false, false, renderFacing))); ticksToNextSmoke = info.TrailInterval; } diff --git a/OpenRA.Mods.Common/Effects/Smoke.cs b/OpenRA.Mods.Common/Effects/Smoke.cs deleted file mode 100644 index e3b4068873..0000000000 --- a/OpenRA.Mods.Common/Effects/Smoke.cs +++ /dev/null @@ -1,50 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2016 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System; -using System.Collections.Generic; -using OpenRA.Effects; -using OpenRA.Graphics; - -namespace OpenRA.Mods.Common.Effects -{ - public class Smoke : IEffect - { - readonly World world; - readonly WPos pos; - readonly Animation anim; - readonly string palette; - - public Smoke(World world, WPos pos, string trail, string palette, string sequence) - : this(world, pos, 0, trail, palette, sequence) { } - - public Smoke(World world, WPos pos, int facing, string trail, string palette, string sequence) - { - this.world = world; - this.pos = pos; - this.palette = palette; - - anim = new Animation(world, trail, () => facing); - anim.PlayThen(sequence, - () => world.AddFrameEndTask(w => w.Remove(this))); - } - - public void Tick(World world) { anim.Tick(); } - - public IEnumerable Render(WorldRenderer wr) - { - if (world.FogObscures(pos)) - return SpriteRenderable.None; - - return anim.Render(pos, wr.Palette(palette)); - } - } -} diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 615fe1b703..4cb22e0ca3 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -160,7 +160,6 @@ - diff --git a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs index d820f553f1..107e97fabe 100644 --- a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs +++ b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits { var offset = info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation)); var pos = position + body.LocalToWorld(offset); - self.World.AddFrameEndTask(w => w.Add(new Smoke(w, pos, getFacing, info.Sprite, info.Palette, info.Sequence))); + self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, w, info.Sprite, info.Sequence, info.Palette, false, false, getFacing))); } ticks = info.Interval; diff --git a/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs b/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs index bc15d3dfe1..e3062d2088 100644 --- a/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs @@ -140,7 +140,7 @@ namespace OpenRA.Mods.Common.Traits public void AddSmudge(CPos loc) { if (Game.CosmeticRandom.Next(0, 100) <= Info.SmokePercentage) - world.AddFrameEndTask(w => w.Add(new Smoke(w, world.Map.CenterOfCell(loc), Info.SmokeType, Info.SmokePalette, Info.SmokeSequence))); + world.AddFrameEndTask(w => w.Add(new SpriteEffect(world.Map.CenterOfCell(loc), w, Info.SmokeType, Info.SmokeSequence, Info.SmokePalette))); if (!dirty.ContainsKey(loc) && !tiles.ContainsKey(loc)) {