Add another way to call air strikes/paradrops to the Lua API

This commit is contained in:
Oliver Brakmann
2016-05-02 21:51:04 +02:00
parent d743c23482
commit 735975057d
2 changed files with 18 additions and 0 deletions

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}
}