diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index ee9401be26..2db8498fd4 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -224,6 +224,7 @@ + diff --git a/OpenRa.Game/Traits/ChronoshiftPower.cs b/OpenRa.Game/Traits/ChronoshiftPower.cs index 1ee2f555f8..1f21c9193f 100644 --- a/OpenRa.Game/Traits/ChronoshiftPower.cs +++ b/OpenRa.Game/Traits/ChronoshiftPower.cs @@ -66,8 +66,7 @@ namespace OpenRa.Traits if (chronosphere != null) chronosphere.traits.Get().PlayCustomAnim(chronosphere, "active"); } - - Game.controller.CancelInputMode(); + FinishActivate(); } } diff --git a/OpenRa.Game/Traits/IronCurtainPower.cs b/OpenRa.Game/Traits/IronCurtainPower.cs index f91463482a..d0a727f415 100644 --- a/OpenRa.Game/Traits/IronCurtainPower.cs +++ b/OpenRa.Game/Traits/IronCurtainPower.cs @@ -28,6 +28,9 @@ namespace OpenRa.Traits { if (order.OrderString == "IronCurtain") { + if (self.Owner == self.World.LocalPlayer) + Game.controller.CancelInputMode(); + var curtain = self.World.Actors.Where(a => a.Owner != null && a.traits.Contains()).FirstOrDefault(); if (curtain != null) @@ -37,7 +40,7 @@ namespace OpenRa.Traits order.TargetActor.traits.Get().Activate(order.TargetActor, (int)((Info as IronCurtainPowerInfo).Duration * 25 * 60)); - Game.controller.CancelInputMode(); + FinishActivate(); } } diff --git a/OpenRa.Game/Traits/ParatroopersPower.cs b/OpenRa.Game/Traits/ParatroopersPower.cs new file mode 100644 index 0000000000..576a280b15 --- /dev/null +++ b/OpenRa.Game/Traits/ParatroopersPower.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace OpenRa.Traits +{ + class ParatroopersPowerInfo : SupportPowerInfo + { + /* todo... */ + public override object Create(Actor self) { return new ParatroopersPower(self,this); } + } + + class ParatroopersPower : SupportPower, IResolveOrder + { + public ParatroopersPower(Actor self, ParatroopersPowerInfo info) : base(self, info) { } + + protected override void OnActivate() + { + Game.controller.orderGenerator = new SelectTarget(); + Sound.Play("slcttgt1.aud"); + } + + class SelectTarget : IOrderGenerator + { + public IEnumerable Order(World world, int2 xy, MouseInput mi) + { + if (mi.Button == MouseButton.Left) + yield return new Order("ParatroopersActivate", world.LocalPlayer.PlayerActor, xy); + } + + public void Tick(World world) {} + public void Render(World world) {} + + public Cursor GetCursor(World world, int2 xy, MouseInput mi) + { + return Cursor.Ability; + } + } + + public void ResolveOrder(Actor self, Order order) + { + if (order.OrderString == "ParatroopersActivate") + { + if (self.Owner == self.World.LocalPlayer) + Game.controller.CancelInputMode(); + + /* todo:... */ + + FinishActivate(); + } + } + } +} diff --git a/mods/ra/units.ini b/mods/ra/units.ini index 0eaf99f54a..97225b3480 100644 --- a/mods/ra/units.ini +++ b/mods/ra/units.ini @@ -165,9 +165,7 @@ TRAN HELI HIND U2 -; TODO: -; U2 (spyplane) -; BADR (paratrooper/paradrop plane) +BADR [MIG] Description=Mig Attack Plane @@ -209,7 +207,8 @@ InitialFacing=20 LongDesc=Helicopter Gunship with Chainguns.\n Strong vs Infantry, Light Vehicles.\n Weak vs Tanks [U2] Traits=Unit, Plane, RenderUnit, WithShadow, IronCurtainable - +[BADR] +Traits=Unit, Plane, RenderUnit, WithShadow, IronCurtainable