Merge pull request #11348 from reaperrr/clean-effects

Remove redundant Effects
This commit is contained in:
reaperrr
2016-05-26 07:52:12 +02:00
17 changed files with 18 additions and 155 deletions

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits
var sequence = terrain.IsWater ? info.WaterCorpseSequence : info.GroundCorpseSequence;
var palette = terrain.IsWater ? info.WaterCorpsePalette : info.GroundCorpsePalette;
if (sequence != null && palette != null)
self.World.AddFrameEndTask(w => w.Add(new Explosion(w, self.OccupiesSpace.CenterPosition, info.Image, sequence, palette)));
self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(self.OccupiesSpace.CenterPosition, w, info.Image, sequence, palette)));
self.Kill(self);
}

View File

@@ -10,7 +10,7 @@
#endregion
using System.Collections.Generic;
using OpenRA.Effects;
using OpenRA.Mods.Common.Effects;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render

View File

@@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Traits.Render
void SpawnExplosions(World world, IEnumerable<CPos> cells)
{
foreach (var c in cells)
world.AddFrameEndTask(w => w.Add(new Explosion(w, w.Map.CenterOfCell(c), info.Image, info.Sequences.Random(w.SharedRandom), info.Palette)));
world.AddFrameEndTask(w => w.Add(new SpriteEffect(w.Map.CenterOfCell(c), w, info.Image, info.Sequences.Random(w.SharedRandom), info.Palette)));
}
}
}

View File

@@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public void SpawnDeathAnimation(Actor self, WPos pos, string image, string sequence, string palette)
{
self.World.AddFrameEndTask(w => w.Add(new Corpse(w, pos, image, sequence, palette)));
self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, w, image, sequence, palette)));
}
void INotifyCrushed.OnCrush(Actor self, Actor crusher, HashSet<string> crushClasses)

View File

@@ -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;

View File

@@ -9,8 +9,8 @@
*/
#endregion
using OpenRA.Effects;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Effects;
using OpenRA.Primitives;
using OpenRA.Traits;

View File

@@ -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))
{