From 6c56ebc7b48a42d68091cc5678cd3fea19572102 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 9 Apr 2010 22:35:06 +1200 Subject: [PATCH] actually make it work (except for napalm) --- OpenRA.Mods.Cnc/AirstrikePower.cs | 24 ++- OpenRA.Mods.RA/ParatroopersPower.cs | 2 +- mods/cnc/sequences-vehicles.xml | 258 +++++++++++++--------------- mods/cnc/system.yaml | 4 +- mods/cnc/vehicles.yaml | 15 +- 5 files changed, 160 insertions(+), 143 deletions(-) diff --git a/OpenRA.Mods.Cnc/AirstrikePower.cs b/OpenRA.Mods.Cnc/AirstrikePower.cs index a1a16ee036..22b6a84ca3 100644 --- a/OpenRA.Mods.Cnc/AirstrikePower.cs +++ b/OpenRA.Mods.Cnc/AirstrikePower.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using OpenRA.Traits; +using OpenRA.Traits.Activities; namespace OpenRA.Mods.Cnc { @@ -15,6 +16,14 @@ namespace OpenRA.Mods.Cnc { public AirstrikePower(Actor self, AirstrikePowerInfo info) : base(self, info) { } + protected override void OnActivate() + { + Game.controller.orderGenerator = new SelectTarget(); + Sound.Play(Info.SelectTargetSound); + } + + protected override void OnFinishCharging() { Sound.PlayToPlayer(Owner, Info.EndChargeSound); } + class SelectTarget : IOrderGenerator { public IEnumerable Order(World world, int2 xy, MouseInput mi) @@ -40,7 +49,20 @@ namespace OpenRA.Mods.Cnc { if (order.OrderString == "Airstrike") { - // todo: spawn a10, have it dump napalm all over the target + var startPos = Owner.World.ChooseRandomEdgeCell(); + Owner.World.AddFrameEndTask(w => + { + var a = w.CreateActor("a10", startPos, Owner); + a.traits.Get().Facing = Util.GetFacing(order.TargetLocation - startPos, 0); + a.traits.Get().Altitude = a.Info.Traits.Get().CruiseAltitude; + + a.CancelActivity(); + a.QueueActivity(new Fly(order.TargetLocation)); + self.QueueActivity(new FlyOffMap { Interruptible = false }); + self.QueueActivity(new RemoveSelf()); + + // todo: napalm + }); Game.controller.CancelInputMode(); FinishActivate(); diff --git a/OpenRA.Mods.RA/ParatroopersPower.cs b/OpenRA.Mods.RA/ParatroopersPower.cs index b6b4ee9309..013b8f6132 100644 --- a/OpenRA.Mods.RA/ParatroopersPower.cs +++ b/OpenRA.Mods.RA/ParatroopersPower.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA protected override void OnActivate() { Game.controller.orderGenerator = new SelectTarget(); - Sound.Play("slcttgt1.aud"); + Sound.Play(Info.SelectTargetSound); } class SelectTarget : IOrderGenerator diff --git a/mods/cnc/sequences-vehicles.xml b/mods/cnc/sequences-vehicles.xml index 5d907e501e..98e4f876ea 100644 --- a/mods/cnc/sequences-vehicles.xml +++ b/mods/cnc/sequences-vehicles.xml @@ -1,140 +1,122 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mods/cnc/system.yaml b/mods/cnc/system.yaml index 5252fc0434..ae706c26cc 100644 --- a/mods/cnc/system.yaml +++ b/mods/cnc/system.yaml @@ -28,10 +28,10 @@ Player: SelectTargetSound: select1.aud AirstrikePower: Image: a10icnh - ChargeTime: 8 + ChargeTime: .2 Description: Airstrike LongDesc: Delivers a load of napalm on your target. - Prerequisites: hq + Prerequisites: nuke TechLevel: 8 EndChargeSound: airredy1.aud diff --git a/mods/cnc/vehicles.yaml b/mods/cnc/vehicles.yaml index 21b96735ef..4a6b756ca1 100644 --- a/mods/cnc/vehicles.yaml +++ b/mods/cnc/vehicles.yaml @@ -450,7 +450,6 @@ ORCA: LimitedAmmo: Ammo: 6 - C17: ParaDrop: LZRange: 1 @@ -467,3 +466,17 @@ C17: Cargo: Passengers: 10 -Selectable: + +A10: + Inherits: ^Plane + Unit: + HP: 60 + Armor: light + ROT: 4 + Sight: 0 + Speed: 25 + Plane: + RenderUnit: + WithShadow: + LimitedAmmo: + Ammo: 10