Added a lua function for paratroopers

This commit is contained in:
abcdefg30
2014-12-25 23:27:19 +01:00
parent 660f43cc66
commit a4f051ad6b
10 changed files with 108 additions and 53 deletions

View File

@@ -11,6 +11,7 @@
using System.Linq;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.RA.Traits;
using OpenRA.Scripting;
using OpenRA.Traits;
@@ -65,4 +66,22 @@ namespace OpenRA.Mods.RA.Scripting
Self.QueueActivity(new RemoveSelf());
}
}
[ScriptGlobal("Air Support Powers")]
public class ParatroopersProperties : ScriptActorProperties, Requires<ParatroopersPowerInfo>
{
readonly ParatroopersPower pp;
public ParatroopersProperties(ScriptContext context, Actor self)
: base(context, self)
{
pp = self.TraitsImplementing<ParatroopersPower>().First();
}
[Desc("Activate the actor's Paratroopers Power. Returns the dropped units.")]
public Actor[] SendParatroopers(WPos target, bool randomize = true, int facing = 0)
{
return pp.SendParatroopers(Self, target, randomize, facing);
}
}
}