From 9b0ce4ff62c556a5fc661890d01deb932d935410 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 14 Apr 2010 20:04:57 +1200 Subject: [PATCH] add flare to parabombs too; optional so cnc airstrike still works --- OpenRA.Mods.RA/AirstrikePower.cs | 8 ++++++++ mods/ra/system.yaml | 1 + 2 files changed, 9 insertions(+) diff --git a/OpenRA.Mods.RA/AirstrikePower.cs b/OpenRA.Mods.RA/AirstrikePower.cs index c40b7f1da0..ef48bda92f 100644 --- a/OpenRA.Mods.RA/AirstrikePower.cs +++ b/OpenRA.Mods.RA/AirstrikePower.cs @@ -27,6 +27,7 @@ namespace OpenRA.Mods.RA class AirstrikePowerInfo : SupportPowerInfo { public readonly string UnitType = "badr.bomber"; + public readonly string FlareType = null; public override object Create(Actor self) { return new AirstrikePower(self, this); } } @@ -47,6 +48,9 @@ namespace OpenRA.Mods.RA Owner.World.AddFrameEndTask(w => { + var flareType = (Info as AirstrikePowerInfo).FlareType; + var flare = flareType != null ? w.CreateActor(flareType, order.TargetLocation, Owner) : null; + var a = w.CreateActor((Info as AirstrikePowerInfo).UnitType, startPos, Owner); a.traits.Get().Facing = Util.GetFacing(order.TargetLocation - startPos, 0); a.traits.Get().Altitude = a.Info.Traits.Get().CruiseAltitude; @@ -54,6 +58,10 @@ namespace OpenRA.Mods.RA a.CancelActivity(); a.QueueActivity(new Fly(order.TargetLocation)); + + if (flare != null) + a.QueueActivity(new CallFunc(() => Owner.World.AddFrameEndTask(_w => _w.Remove(flare)))); + a.QueueActivity(new FlyOffMap { Interruptible = false }); a.QueueActivity(new RemoveSelf()); }); diff --git a/mods/ra/system.yaml b/mods/ra/system.yaml index 704c0ce04e..3899dcb787 100644 --- a/mods/ra/system.yaml +++ b/mods/ra/system.yaml @@ -76,6 +76,7 @@ Player: OneShot: yes UnitType: badr.bomber SelectTargetSound: slcttgt1.aud + FlareType: flare VictoryConditions: ShortGameUnits: mcv