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 SP_LMS_LIVES 4
52 ScoreRules_basics(0, 0, 0, FALSE);
53 ScoreInfo_SetLabel_PlayerScore(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
54 ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
55 ScoreRules_basics_end();
61 #define SP_KH_PUSHES 5
62 #define SP_KH_DESTROYS 6
63 #define SP_KH_PICKUPS 7
64 #define SP_KH_KCKILLS 8
65 #define SP_KH_LOSSES 9
66 void ScoreRules_kh(float teams)
68 ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
69 ScoreInfo_SetLabel_TeamScore (ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
70 ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
71 ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES, "pushes", 0);
72 ScoreInfo_SetLabel_PlayerScore(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER);
73 ScoreInfo_SetLabel_PlayerScore(SP_KH_PICKUPS, "pickups", 0);
74 ScoreInfo_SetLabel_PlayerScore(SP_KH_KCKILLS, "kckills", 0);
75 ScoreInfo_SetLabel_PlayerScore(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER);
76 ScoreRules_basics_end();
80 #define ST_RACE_LAPS 1
81 #define SP_RACE_LAPS 4
82 #define SP_RACE_FASTEST 5
83 #define SP_RACE_TIME 5
84 //#define SP_RACE_RANK 6
85 void ScoreRules_race()
87 ScoreRules_basics(race_teams, 0, 0, FALSE);
90 ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
91 ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
92 ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
93 //ScoreInfo_SetLabel_PlayerScore(SP_RACE_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_ALLOW_HIDE);
95 else if(g_race_qualifying)
97 ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
101 //ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", 0);
102 ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
103 ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
105 ScoreRules_basics_end();
109 #define ST_ASSAULT_OBJECTIVES 1
110 #define SP_ASSAULT_OBJECTIVES 4
111 void ScoreRules_assault()
113 ScoreRules_basics(2, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, TRUE);
114 ScoreInfo_SetLabel_TeamScore( ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
115 ScoreInfo_SetLabel_PlayerScore(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
116 ScoreRules_basics_end();
120 #define ST_NEXBALL_GOALS 1
121 #define SP_NEXBALL_GOALS 4
122 #define SP_NEXBALL_FAULTS 5
123 void ScoreRules_nexball(float teams)
125 ScoreRules_basics(teams, 0, 0, TRUE);
126 ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
127 ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
128 ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
129 ScoreRules_basics_end();
133 #define SP_FREEZETAG_REVIVALS 4
134 void ScoreRules_freezetag()
136 CheckAllowedTeams(world);
137 ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
138 ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0);
139 ScoreRules_basics_end();