#65 CNC Ion Cannon - 3 minute cooldown, narrow effect, still PerCell damage for massive building damage

This commit is contained in:
Chris Forbes
2010-04-02 21:57:56 +13:00
parent 93632f6c6c
commit 71340811ef
4 changed files with 33 additions and 5 deletions

View File

@@ -30,13 +30,14 @@ namespace OpenRA.Mods.Cnc.Effects
{
int2 Target;
Animation anim;
Actor firedBy;
public IonCannon(World world, int2 location)
public IonCannon(Actor firedBy, World world, int2 location)
{
this.firedBy = firedBy;
Target = location;
anim = new Animation("ionsfx");
anim.PlayThen("idle",
() => world.AddFrameEndTask(w => w.Remove(this)));
anim.PlayThen("idle", () => Finish(world));
}
public void Tick(World world) { anim.Tick(); }
@@ -47,5 +48,11 @@ namespace OpenRA.Mods.Cnc.Effects
Util.CenterOfCell(Target) - 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);
}
}
}

View File

@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Cnc
Owner.World.AddFrameEndTask(w =>
{
Sound.Play(Info.LaunchSound);
w.Add(new IonCannon(w, order.TargetLocation));
w.Add(new IonCannon(self, w, order.TargetLocation));
});
Game.controller.CancelInputMode();