/** * Attaches a PlayerScore entity to a player. Use that in ClientConnect. * Remember to detach it in ClientDisconnect! */ void PlayerScore_Attach(entity player); /** * Detaches a PlayerScore entity from the player. Use that in ClientDisconnect. */ void PlayerScore_Detach(entity player); /** * Adds a score to the player's scores. * NEVER call this if PlayerScore_Attach has not been called yet! * Means: FIXME make players unable to join the game when not called ClientConnect yet. */ void PlayerScore_Add(entity player, float scorefield, float score); /** * Initialize the score of this player if needed. * Does nothing in teamplay. * Use that when a spectator becomes a player. */ void PlayerScore_Clear(entity player); /** * Adds a score to the player's team's scores. * NEVER call this if team has not been set yet! */ void TeamScore_Add(entity player, float scorefield, float score); /** * Adds a score to the given team. * NEVER call this if team has not been set yet! */ void TeamScore_AddToTeam(float t, float scorefield, float score); /** * Adds a score to both the player and the team. */ void PlayerTeamScore_Add(entity player, float pscorefield, float tscorefield, float score); /** * Adds to the generic score fields for both the player and the team. */ #define PlayerTeamScore_AddScore(p,s) PlayerTeamScore_Add(p, SP_SCORE, ST_SCORE, s) /** * Initialize the scores info for the given number of teams. * Immediately set all labels afterwards. */ void ScoreInfo_Init(float teams); /** * Set the label of a team score item, as well as the scoring flags. */ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags); /** * Set the label of a player score item, as well as the scoring flags. */ void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags); /** * Clear ALL scores (for ready-restart). */ void Score_ClearAll(); /** * Prints the scores (ugly!) to the console. */ void Score_DebugPrint(); /** * Sets the following results for the current scores entities. */ void WinningConditionHelper(); float WinningConditionHelper_topscore; ///< highest score float WinningConditionHelper_equality; ///< 1 if and only if the top two have equal scores float WinningConditionHelper_winnerteam; ///< the color of the winning team, or -1 if none entity WinningConditionHelper_winner; ///< the winning player, or world if none