5 #define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
6 REGISTRY(Scores, MAX_SCORE);
7 #define Scores_from(i) _Scores_from(i, NULL)
8 REGISTER_REGISTRY(Scores)
10 REGISTRY_CHECK(Scores);
11 STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
17 // game mode specific indices are not in common/, but in server/scores_rules.qc!
27 REGISTER_SP(SEPARATOR);
32 REGISTER_SP(DMGTAKEN);
36 REGISTER_SP(SUICIDES);
37 REGISTER_SP(TEAMKILLS);
44 // TODO: move to common mutators
46 REGISTER_SP(RACE_TIME);
47 REGISTER_SP(RACE_LAPS);
48 REGISTER_SP(RACE_FASTEST);
50 //REGISTER_SP(CTS_TIME);
51 //REGISTER_SP(CTS_LAPS);
52 //REGISTER_SP(CTS_FASTEST);
54 REGISTER_SP(ASSAULT_OBJECTIVES);
56 REGISTER_SP(CTF_PICKUPS);
57 REGISTER_SP(CTF_FCKILLS);
58 REGISTER_SP(CTF_RETURNS);
59 REGISTER_SP(CTF_CAPS);
60 REGISTER_SP(CTF_CAPTIME);
61 REGISTER_SP(CTF_DROPS);
63 REGISTER_SP(DOM_TAKES);
64 REGISTER_SP(DOM_TICKS);
66 REGISTER_SP(FREEZETAG_REVIVALS);
68 REGISTER_SP(KEEPAWAY_PICKUPS);
69 REGISTER_SP(KEEPAWAY_BCTIME);
70 REGISTER_SP(KEEPAWAY_CARRIERKILLS);
72 REGISTER_SP(KH_PICKUPS);
74 REGISTER_SP(KH_KCKILLS);
75 REGISTER_SP(KH_PUSHES);
76 REGISTER_SP(KH_DESTROYS);
77 REGISTER_SP(KH_LOSSES);
79 REGISTER_SP(LMS_RANK);
80 REGISTER_SP(LMS_LIVES);
82 REGISTER_SP(NEXBALL_GOALS);
83 REGISTER_SP(NEXBALL_FAULTS);
85 REGISTER_SP(ONS_TAKES);
86 REGISTER_SP(ONS_CAPS);
90 // the stuff you don't need to see
93 * Lower scores are better (e.g. suicides)
95 const int SFL_LOWER_IS_BETTER = BIT(0);
98 * Don't show zero values as scores
100 const int SFL_HIDE_ZERO = BIT(1);
103 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
105 const int SFL_ALLOW_HIDE = BIT(4);
108 * Display as a rank (with st, nd, rd, th suffix)
110 const int SFL_RANK = BIT(5);
113 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
115 const int SFL_TIME = BIT(6);
117 // not an extra constant yet
118 #define SFL_ZERO_IS_WORST SFL_TIME
121 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
123 const int SFL_SORT_PRIO_SECONDARY = 4;
124 const int SFL_SORT_PRIO_PRIMARY = 8;
125 const int SFL_SORT_PRIO_MASK = 12;
127 #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
128 #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
130 USING(PlayerScoreField, entity);
131 .int _scores[MAX_SCORE];
135 #define scores(this) _scores[(this).m_id]
136 #define scores_label(this) ((this).m_name)
137 #define scores_flags(this) ((this).m_flags)
139 #define MAX_TEAMSCORE 2
140 USING(ScoreTeam, string);
141 .int _teamscores[MAX_TEAMSCORE];
142 #define teamscores(i) _teamscores[i]
143 string _teamscores_label[MAX_TEAMSCORE];
144 #define teamscores_label(i) _teamscores_label[i]
145 int _teamscores_flags[MAX_TEAMSCORE];
146 #define teamscores_flags(i) _teamscores_flags[i]
148 const int ST_SCORE = 0;