Merge pull request #9924 from cjshmyr/lua-islocalplayer

Added 3 Lua player API properties
This commit is contained in:
Matthias Mailänder
2015-11-08 08:52:17 +01:00

View File

@@ -24,6 +24,9 @@ namespace OpenRA.Mods.Common.Scripting
public PlayerProperties(ScriptContext context, Player player)
: base(context, player) { }
[Desc("The player's internal name.")]
public string InternalName { get { return Player.InternalName; } }
[Desc("The player's name.")]
public string Name { get { return Player.PlayerName; } }
@@ -52,6 +55,12 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Returns true if the player is a bot.")]
public bool IsBot { get { return Player.IsBot; } }
[Desc("Returns true if the player is non combatant.")]
public bool IsNonCombatant { get { return Player.NonCombatant; } }
[Desc("Returns true if the player is the local player.")]
public bool IsLocalPlayer { get { return Player == (Player.World.RenderPlayer ?? Player.World.LocalPlayer); } }
[Desc("Returns an array of actors representing all ground attack units of this player.")]
public Actor[] GetGroundAttackers()
{