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)
9 ScoreRules_teams = teams;
11 ScoreInfo_SetLabel_TeamScore (ST_SCORE, "score", sprio);
12 ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
13 ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
14 ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
16 ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);
18 void ScoreRules_basics_end()
20 ScoreInfo_Init(ScoreRules_teams);
22 void ScoreRules_generic()
24 CheckAllowedTeams(world);
27 CheckAllowedTeams(world);
28 ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY);
31 ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY);
32 ScoreRules_basics_end();
38 #define SP_CTF_PICKUPS 5
39 #define SP_CTF_FCKILLS 6
40 #define SP_CTF_RETURNS 7
43 float sp_score, sp_caps;
44 sp_score = sp_caps = 0;
45 switch(cvar("g_ctf_win_mode"))
48 sp_caps = SFL_SORT_PRIO_PRIMARY;
50 case 1: // caps, then score
51 sp_caps = SFL_SORT_PRIO_PRIMARY;
52 sp_score = SFL_SORT_PRIO_SECONDARY;
56 sp_score = SFL_SORT_PRIO_PRIMARY;
57 sp_caps = SFL_SORT_PRIO_SECONDARY; // looks better ;)
61 CheckAllowedTeams(world);
62 ScoreRules_basics(2 + (c3>=0), sp_score); // NOTE this assumes that the rogue team is team 3
63 ScoreInfo_SetLabel_TeamScore (ST_CTF_CAPS, "caps", sp_caps);
64 ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS, "caps", sp_caps);
65 ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS, "pickups", 0);
66 ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS, "fckills", 0);
67 ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS, "returns", 0);
68 ScoreRules_basics_end();
72 #define ST_DOM_TICKS 1
73 #define SP_DOM_TICKS 4
74 #define SP_DOM_TAKES 5
77 float sp_domticks, sp_score;
78 sp_score = sp_domticks = 0;
79 if(cvar("g_domination_disable_frags"))
80 sp_domticks = SFL_SORT_PRIO_PRIMARY;
82 sp_score = SFL_SORT_PRIO_PRIMARY;
83 CheckAllowedTeams(world);
84 ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), sp_score);
85 ScoreInfo_SetLabel_TeamScore (ST_DOM_TICKS, "ticks", sp_domticks);
86 ScoreInfo_SetLabel_PlayerScore(SP_DOM_TICKS, "ticks", sp_domticks);
87 ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
88 ScoreRules_basics_end();
92 #define SP_LMS_LIVES 4
96 ScoreRules_basics(0, 0);
97 ScoreInfo_SetLabel_PlayerScore(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
98 ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
99 ScoreRules_basics_end();
105 #define SP_KH_PUSHES 5
106 #define SP_KH_DESTROYS 6
107 #define SP_KH_PICKUPS 7
108 #define SP_KH_KCKILLS 8
109 #define SP_KH_LOSSES 9
110 void ScoreRules_kh(float teams)
112 ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY);
113 ScoreInfo_SetLabel_TeamScore (ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
114 ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
115 ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES, "pushes", 0);
116 ScoreInfo_SetLabel_PlayerScore(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER);
117 ScoreInfo_SetLabel_PlayerScore(SP_KH_PICKUPS, "pickups", 0);
118 ScoreInfo_SetLabel_PlayerScore(SP_KH_KCKILLS, "kckills", 0);
119 ScoreInfo_SetLabel_PlayerScore(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER);
120 ScoreRules_basics_end();