5 #define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
6 REGISTRY(Scores, MAX_SCORE);
7 REGISTER_REGISTRY(Scores)
9 REGISTRY_CHECK(Scores);
11 REGISTRY_DEFINE_GET(Scores, NULL)
12 STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
18 // game mode specific indices are not in common/, but in server/scores_rules.qc!
28 REGISTER_SP(SEPARATOR);
33 REGISTER_SP(DMGTAKEN);
37 REGISTER_SP(SUICIDES);
38 REGISTER_SP(TEAMKILLS);
45 // TODO: move to common mutators
47 REGISTER_SP(RACE_TIME);
48 REGISTER_SP(RACE_LAPS);
49 REGISTER_SP(RACE_FASTEST);
51 //REGISTER_SP(CTS_TIME);
52 //REGISTER_SP(CTS_LAPS);
53 //REGISTER_SP(CTS_FASTEST);
55 REGISTER_SP(ASSAULT_OBJECTIVES);
57 REGISTER_SP(CTF_PICKUPS);
58 REGISTER_SP(CTF_FCKILLS);
59 REGISTER_SP(CTF_RETURNS);
60 REGISTER_SP(CTF_CAPS);
61 REGISTER_SP(CTF_CAPTIME);
62 REGISTER_SP(CTF_DROPS);
64 REGISTER_SP(DOM_TAKES);
65 REGISTER_SP(DOM_TICKS);
67 REGISTER_SP(FREEZETAG_REVIVALS);
69 REGISTER_SP(KEEPAWAY_PICKUPS);
70 REGISTER_SP(KEEPAWAY_BCTIME);
71 REGISTER_SP(KEEPAWAY_CARRIERKILLS);
73 REGISTER_SP(KH_PICKUPS);
75 REGISTER_SP(KH_KCKILLS);
76 REGISTER_SP(KH_PUSHES);
77 REGISTER_SP(KH_DESTROYS);
78 REGISTER_SP(KH_LOSSES);
80 REGISTER_SP(LMS_RANK);
81 REGISTER_SP(LMS_LIVES);
83 REGISTER_SP(NEXBALL_GOALS);
84 REGISTER_SP(NEXBALL_FAULTS);
86 REGISTER_SP(ONS_TAKES);
87 REGISTER_SP(ONS_CAPS);
89 REGISTER_SP(SURV_SURVIVALS);
90 REGISTER_SP(SURV_HUNTS);
94 // the stuff you don't need to see
97 * Lower scores are better (e.g. suicides)
99 const int SFL_LOWER_IS_BETTER = BIT(0);
102 * Don't show zero values as scores
104 const int SFL_HIDE_ZERO = BIT(1);
107 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
109 const int SFL_ALLOW_HIDE = BIT(4);
112 * Display as a rank (with st, nd, rd, th suffix)
114 const int SFL_RANK = BIT(5);
117 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
119 const int SFL_TIME = BIT(6);
121 // not an extra constant yet
122 #define SFL_ZERO_IS_WORST SFL_TIME
125 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
127 const int SFL_SORT_PRIO_SECONDARY = 4;
128 const int SFL_SORT_PRIO_PRIMARY = 8;
129 const int SFL_SORT_PRIO_MASK = 12;
131 #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
132 #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
134 USING(PlayerScoreField, entity);
135 .int _scores[MAX_SCORE];
139 #define scores(this) _scores[(this).m_id]
140 #define scores_label(this) ((this).m_name)
141 #define scores_flags(this) ((this).m_flags)
143 #define MAX_TEAMSCORE 2
144 USING(ScoreTeam, string);
145 .int _teamscores[MAX_TEAMSCORE];
146 #define teamscores(i) _teamscores[i]
147 string _teamscores_label[MAX_TEAMSCORE];
148 #define teamscores_label(i) _teamscores_label[i]
149 int _teamscores_flags[MAX_TEAMSCORE];
150 #define teamscores_flags(i) _teamscores_flags[i]
152 const int ST_SCORE = 0;