From 735975057d520d39b45da4bf2bf04ba6b54eff9c Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Mon, 2 May 2016 21:51:04 +0200 Subject: [PATCH] Add another way to call air strikes/paradrops to the Lua API --- .../Scripting/Properties/AirstrikeProperties.cs | 9 +++++++++ .../Scripting/Properties/ParatroopersProperties.cs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs index ccd5159c12..d4d1c38faa 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs @@ -32,5 +32,14 @@ namespace OpenRA.Mods.Common.Scripting { ap.SendAirstrike(Self, target, randomize, facing); } + + [Desc("Activate the actor's Airstrike Power.")] + public void SendAirstrikeFrom(CPos from, CPos to) + { + var i = Self.World.Map.CenterOfCell(from); + var j = Self.World.Map.CenterOfCell(to); + + ap.SendAirstrike(Self, j, false, (i - j).Yaw.Facing); + } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Scripting/Properties/ParatroopersProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/ParatroopersProperties.cs index d46605832c..62db33c119 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/ParatroopersProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/ParatroopersProperties.cs @@ -32,5 +32,14 @@ namespace OpenRA.Mods.RA.Scripting { return pp.SendParatroopers(Self, target, randomize, facing); } + + [Desc("Activate the actor's Paratroopers Power. Returns the dropped units.")] + public Actor[] SendParatroopersFrom(CPos from, CPos to) + { + var i = Self.World.Map.CenterOfCell(from); + var j = Self.World.Map.CenterOfCell(to); + + return pp.SendParatroopers(Self, j, false, (i - j).Yaw.Facing); + } } } \ No newline at end of file