Convert Explosion to world coords.
This commit is contained in:
@@ -18,26 +18,20 @@ namespace OpenRA.Mods.RA.Effects
|
||||
public class Explosion : IEffect
|
||||
{
|
||||
Animation anim;
|
||||
PPos pos;
|
||||
int altitude;
|
||||
WPos pos;
|
||||
|
||||
public Explosion(World world, PPos pixelPos, string style, bool isWater, int altitude)
|
||||
public Explosion(World world, WPos pos, string style)
|
||||
{
|
||||
this.pos = pixelPos;
|
||||
this.altitude = altitude;
|
||||
this.pos = pos;
|
||||
anim = new Animation("explosion");
|
||||
anim.PlayThen(style,
|
||||
() => world.AddFrameEndTask(w => w.Remove(this)));
|
||||
anim.PlayThen(style, () => world.AddFrameEndTask(w => w.Remove(this)));
|
||||
}
|
||||
|
||||
public void Tick( World world ) { anim.Tick(); }
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
var p = pos.ToInt2() - new int2(0, altitude);
|
||||
yield return new SpriteRenderable(anim.Image, p, wr.Palette("effect"), p.Y);
|
||||
yield return new SpriteRenderable(anim.Image, pos, 0, wr.Palette("effect"), 1f);
|
||||
}
|
||||
|
||||
public Player Owner { get { return null; } }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user