From 2a6c87f81d5b824c726b53f3ff3baa2c4f4608e3 Mon Sep 17 00:00:00 2001 From: Curtis Shmyr Date: Sat, 7 Nov 2015 12:17:09 -0700 Subject: [PATCH] Added 3 Lua player API properties --- .../Scripting/Properties/PlayerProperties.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs index f723aa0b6c..6dc98f0dce 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs @@ -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() {