#65 CNC Ion Cannon - 3 minute cooldown, narrow effect, still PerCell damage for massive building damage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user