Combat.DoExplosion now takes a Target
(needs more refactoring)
This commit is contained in:
@@ -18,14 +18,14 @@ namespace OpenRA.Mods.Cnc.Effects
|
||||
{
|
||||
class IonCannon : IEffect
|
||||
{
|
||||
int2 Target;
|
||||
Target target;
|
||||
Animation anim;
|
||||
Actor firedBy;
|
||||
|
||||
public IonCannon(Actor firedBy, World world, int2 location)
|
||||
{
|
||||
this.firedBy = firedBy;
|
||||
Target = location;
|
||||
target = Target.FromPos(OpenRA.Traits.Util.CenterOfCell(location));
|
||||
anim = new Animation("ionsfx");
|
||||
anim.PlayThen("idle", () => Finish(world));
|
||||
}
|
||||
@@ -35,14 +35,14 @@ namespace OpenRA.Mods.Cnc.Effects
|
||||
public IEnumerable<Renderable> Render()
|
||||
{
|
||||
yield return new Renderable(anim.Image,
|
||||
Traits.Util.CenterOfCell(Target) - new float2(.5f * anim.Image.size.X, anim.Image.size.Y - Game.CellSize),
|
||||
target.CenterLocation - new float2(.5f * anim.Image.size.X, anim.Image.size.Y - Game.CellSize),
|
||||
"effect");
|
||||
}
|
||||
|
||||
void Finish( World world )
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Remove(this));
|
||||
Combat.DoExplosion(firedBy, "IonCannon", Target, 0);
|
||||
Combat.DoExplosion(firedBy, "IonCannon", target, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user