From 71340811efba9f027609deaa9dbabfbe5f75c84a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 2 Apr 2010 21:57:56 +1300 Subject: [PATCH] #65 CNC Ion Cannon - 3 minute cooldown, narrow effect, still PerCell damage for massive building damage --- OpenRA.Mods.Cnc/Effects/IonCannon.cs | 13 ++++++++++--- OpenRA.Mods.Cnc/IonCannonPower.cs | 2 +- mods/cnc/system.yaml | 2 +- mods/cnc/weapons.yaml | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Cnc/Effects/IonCannon.cs b/OpenRA.Mods.Cnc/Effects/IonCannon.cs index 1fdf858f8b..265f08b842 100644 --- a/OpenRA.Mods.Cnc/Effects/IonCannon.cs +++ b/OpenRA.Mods.Cnc/Effects/IonCannon.cs @@ -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); + } } } diff --git a/OpenRA.Mods.Cnc/IonCannonPower.cs b/OpenRA.Mods.Cnc/IonCannonPower.cs index c952678d2d..3d679b9eb0 100644 --- a/OpenRA.Mods.Cnc/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/IonCannonPower.cs @@ -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(); diff --git a/mods/cnc/system.yaml b/mods/cnc/system.yaml index b9ef559642..416be02de6 100644 --- a/mods/cnc/system.yaml +++ b/mods/cnc/system.yaml @@ -17,7 +17,7 @@ Player: LaunchSound: nukemisl.aud IonCannonPower: Image: ionicnh - ChargeTime: 1 + ChargeTime: 3 Description: Ion Cannon LongDesc: Discharges the orbital Ion Cannon at your target. Prerequisites: EYE diff --git a/mods/cnc/weapons.yaml b/mods/cnc/weapons.yaml index 608a511a7c..eb012b7d64 100644 --- a/mods/cnc/weapons.yaml +++ b/mods/cnc/weapons.yaml @@ -32,6 +32,27 @@ Atomic: Delay: 3 InfDeath: 4 +IonCannon: + Warhead@impact: + Damage: 500 + Spread: 6 + Wall: true + Wood: true + Ore: true + Verses: 100%,100%,100%,100%,100% + InfDeath: 4 + Warhead@area: + DamageMode: PerCell + Damage: 200 + SmudgeType: Scorch + Size: 2,1 + Wall: true + Wood: true + Ore: true + Verses: 100%,100%,100%,100%,100% + Delay: 3 + InfDeath: 4 + Sniper: Report: RAMGUN2 ROF: 40