add flare to parabombs too; optional so cnc airstrike still works

This commit is contained in:
Chris Forbes
2010-04-14 20:04:57 +12:00
parent c811d24611
commit 9b0ce4ff62
2 changed files with 9 additions and 0 deletions

View File

@@ -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<Unit>().Facing = Util.GetFacing(order.TargetLocation - startPos, 0);
a.traits.Get<Unit>().Altitude = a.Info.Traits.Get<PlaneInfo>().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());
});

View File

@@ -76,6 +76,7 @@ Player:
OneShot: yes
UnitType: badr.bomber
SelectTargetSound: slcttgt1.aud
FlareType: flare
VictoryConditions:
ShortGameUnits: mcv