1 #include "scores_rules.qh"
3 #include <server/defs.qh>
4 #include <server/miscfunctions.qh>
7 #include <common/gamemodes/rules.qh>
12 int NumTeams(int teams)
14 return boolean(teams & BIT(0)) + boolean(teams & BIT(1)) + boolean(teams & BIT(2)) + boolean(teams & BIT(3));
19 return NumTeams(ScoreRules_teams);
22 // NOTE: ST_constants may not be >= MAX_TEAMSCORE
23 // scores that should be in all modes:
24 void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled)
26 FOREACH(Scores, true, {
27 ScoreInfo_SetLabel_PlayerScore(it, "", 0);
29 for(int i = 0; i < MAX_TEAMSCORE; ++i)
30 ScoreInfo_SetLabel_TeamScore(i, "", 0);
32 ScoreRules_teams = teams;
35 ScoreInfo_SetLabel_TeamScore (ST_SCORE, "score", stprio);
37 if (!INDEPENDENT_PLAYERS)
38 ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
40 ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
42 if (!INDEPENDENT_PLAYERS)
44 ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
45 ScoreInfo_SetLabel_PlayerScore(SP_TEAMKILLS, "teamkills", SFL_LOWER_IS_BETTER);
49 ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);
51 ScoreInfo_SetLabel_PlayerScore(SP_DMG, "dmg", 0);
52 ScoreInfo_SetLabel_PlayerScore(SP_DMGTAKEN, "dmgtaken", SFL_LOWER_IS_BETTER);
53 ScoreInfo_SetLabel_PlayerScore(SP_ELO, "elo", 0);
56 ScoreInfo_SetLabel_PlayerScore(SP_FPS, "fps", 0);
58 void ScoreRules_basics_end()
60 ScoreInfo_Init(ScoreRules_teams);
62 void ScoreRules_generic()
67 entity balance = TeamBalance_CheckAllowedTeams(NULL);
68 teams = TeamBalance_GetAllowedTeams(balance);
69 TeamBalance_Destroy(balance);
71 GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {});