2 void CheckAllowedTeams (entity for_whom);
4 // NOTE: SP_ constants may not be >= MAX_SCORE; ST_constants may not be >= MAX_TEAMSCORE
5 // scores that should be in all modes:
6 float ScoreRules_teams;
7 void ScoreRules_basics(float teams, float sprio, float stprio, float score_enabled)
10 for(i = 0; i < MAX_SCORE; ++i)
11 ScoreInfo_SetLabel_PlayerScore(i, "", 0);
12 for(i = 0; i < MAX_TEAMSCORE; ++i)
13 ScoreInfo_SetLabel_TeamScore(i, "", 0);
15 ScoreRules_teams = teams;
18 ScoreInfo_SetLabel_TeamScore (ST_SCORE, "score", stprio);
20 if not(INDEPENDENT_PLAYERS)
21 ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
23 ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
25 if not(INDEPENDENT_PLAYERS)
26 ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
29 ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);
31 void ScoreRules_basics_end()
33 ScoreInfo_Init(ScoreRules_teams);
35 void ScoreRules_generic()
39 CheckAllowedTeams(world);
40 ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
43 ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
44 ScoreRules_basics_end();
48 #define ST_DOM_TICKS 1
49 #define SP_DOM_TICKS 4
50 #define SP_DOM_TAKES 5
53 float sp_domticks, sp_score;
54 sp_score = sp_domticks = 0;
55 if(autocvar_g_domination_disable_frags)
56 sp_domticks = SFL_SORT_PRIO_PRIMARY;
58 sp_score = SFL_SORT_PRIO_PRIMARY;
59 CheckAllowedTeams(world);
60 ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), sp_score, sp_score, TRUE);
61 ScoreInfo_SetLabel_TeamScore (ST_DOM_TICKS, "ticks", sp_domticks);
62 ScoreInfo_SetLabel_PlayerScore(SP_DOM_TICKS, "ticks", sp_domticks);
63 ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
64 ScoreRules_basics_end();
68 #define SP_LMS_LIVES 4
72 ScoreRules_basics(0, 0, 0, FALSE);
73 ScoreInfo_SetLabel_PlayerScore(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
74 ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
75 ScoreRules_basics_end();
81 #define SP_KH_PUSHES 5
82 #define SP_KH_DESTROYS 6
83 #define SP_KH_PICKUPS 7
84 #define SP_KH_KCKILLS 8
85 #define SP_KH_LOSSES 9
86 void ScoreRules_kh(float teams)
88 ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
89 ScoreInfo_SetLabel_TeamScore (ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
90 ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
91 ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES, "pushes", 0);
92 ScoreInfo_SetLabel_PlayerScore(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER);
93 ScoreInfo_SetLabel_PlayerScore(SP_KH_PICKUPS, "pickups", 0);
94 ScoreInfo_SetLabel_PlayerScore(SP_KH_KCKILLS, "kckills", 0);
95 ScoreInfo_SetLabel_PlayerScore(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER);
96 ScoreRules_basics_end();
100 #define ST_RACE_LAPS 1
101 #define SP_RACE_LAPS 4
102 #define SP_RACE_FASTEST 5
103 #define SP_RACE_TIME 5
104 //#define SP_RACE_RANK 6
105 void ScoreRules_race()
107 ScoreRules_basics(race_teams, 0, 0, FALSE);
110 ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
111 ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
112 ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
113 //ScoreInfo_SetLabel_PlayerScore(SP_RACE_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_ALLOW_HIDE);
115 else if(g_race_qualifying)
117 ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
121 //ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", 0);
122 ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
123 ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
125 ScoreRules_basics_end();
129 #define ST_ASSAULT_OBJECTIVES 1
130 #define SP_ASSAULT_OBJECTIVES 4
131 void ScoreRules_assault()
133 ScoreRules_basics(2, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, TRUE);
134 ScoreInfo_SetLabel_TeamScore( ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
135 ScoreInfo_SetLabel_PlayerScore(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
136 ScoreRules_basics_end();
140 #define ST_NEXBALL_GOALS 1
141 #define SP_NEXBALL_GOALS 4
142 #define SP_NEXBALL_FAULTS 5
143 void ScoreRules_nexball(float teams)
145 ScoreRules_basics(teams, 0, 0, TRUE);
146 ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
147 ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
148 ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
149 ScoreRules_basics_end();
153 #define SP_FREEZETAG_REVIVALS 4
154 void ScoreRules_freezetag()
156 CheckAllowedTeams(world);
157 ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
158 ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0);
159 ScoreRules_basics_end();