1 #include "scores_rules.qh"
3 #include "cl_client.qh"
6 void CheckAllowedTeams (entity for_whom);
8 int NumTeams(int teams)
10 return (teams & BIT(0)) + (teams & BIT(1)) + (teams & BIT(2)) + (teams & BIT(3));
13 // NOTE: SP_ constants may not be >= MAX_SCORE; ST_constants may not be >= MAX_TEAMSCORE
14 // scores that should be in all modes:
16 void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled)
19 for(i = 0; i < MAX_SCORE; ++i)
20 ScoreInfo_SetLabel_PlayerScore(i, "", 0);
21 for(i = 0; i < MAX_TEAMSCORE; ++i)
22 ScoreInfo_SetLabel_TeamScore(i, "", 0);
24 ScoreRules_teams = teams;
27 ScoreInfo_SetLabel_TeamScore (ST_SCORE, "score", stprio);
29 if (!INDEPENDENT_PLAYERS)
30 ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
32 ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
34 if (!INDEPENDENT_PLAYERS)
35 ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
38 ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);
40 ScoreInfo_SetLabel_PlayerScore(SP_DMG, "damage", 0);
41 ScoreInfo_SetLabel_PlayerScore(SP_DMGTAKEN, "damagetaken", SFL_LOWER_IS_BETTER);
43 void ScoreRules_basics_end()
45 ScoreInfo_Init(ScoreRules_teams);
47 void ScoreRules_generic()
51 CheckAllowedTeams(NULL);
53 if(c1 >= 0) teams |= BIT(0);
54 if(c2 >= 0) teams |= BIT(1);
55 if(c3 >= 0) teams |= BIT(2);
56 if(c4 >= 0) teams |= BIT(3);
57 ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
60 ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
61 ScoreRules_basics_end();