Add a per-player handicap option to the lobby.

Handicaps reduce unit health, firepower, and build speed.
This commit is contained in:
Paul Chote
2020-12-30 15:17:44 +00:00
committed by reaperrr
parent c7c78eda80
commit 02a2624bcc
22 changed files with 346 additions and 0 deletions

View File

@@ -52,6 +52,16 @@ namespace OpenRA.Mods.Common.Scripting
}
}
[Desc("The player's handicap level.")]
public int Handicap
{
get
{
var c = Player.World.LobbyInfo.Clients.FirstOrDefault(i => i.Index == Player.ClientIndex);
return c?.Handicap ?? 0;
}
}
[Desc("Returns true if the player is a bot.")]
public bool IsBot { get { return Player.IsBot; } }