Added 3 Lua player API properties
This commit is contained in:
@@ -24,6 +24,9 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
public PlayerProperties(ScriptContext context, Player player)
|
public PlayerProperties(ScriptContext context, Player player)
|
||||||
: base(context, player) { }
|
: base(context, player) { }
|
||||||
|
|
||||||
|
[Desc("The player's internal name.")]
|
||||||
|
public string InternalName { get { return Player.InternalName; } }
|
||||||
|
|
||||||
[Desc("The player's name.")]
|
[Desc("The player's name.")]
|
||||||
public string Name { get { return Player.PlayerName; } }
|
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.")]
|
[Desc("Returns true if the player is a bot.")]
|
||||||
public bool IsBot { get { return Player.IsBot; } }
|
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.")]
|
[Desc("Returns an array of actors representing all ground attack units of this player.")]
|
||||||
public Actor[] GetGroundAttackers()
|
public Actor[] GetGroundAttackers()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user