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!
20 // fields not networked via the score system
25 REGISTER_SP(COUNTRY); //LegendGuard adds new column for country label 05-04-2021
27 REGISTER_SP(SEPARATOR);
29 REGISTER_SP(KDRATIO); // kills / deaths
30 REGISTER_SP(SUM); // kills - deaths
31 REGISTER_SP(FRAGS); // kills - suicides
38 REGISTER_SP(DMGTAKEN);
42 REGISTER_SP(SUICIDES);
43 REGISTER_SP(TEAMKILLS);
49 // TODO: move to common mutators
51 REGISTER_SP(RACE_TIME);
52 REGISTER_SP(RACE_LAPS);
53 REGISTER_SP(RACE_FASTEST);
55 //REGISTER_SP(CTS_TIME);
56 //REGISTER_SP(CTS_LAPS);
57 //REGISTER_SP(CTS_FASTEST);
59 REGISTER_SP(ASSAULT_OBJECTIVES);
61 REGISTER_SP(CTF_PICKUPS);
62 REGISTER_SP(CTF_FCKILLS);
63 REGISTER_SP(CTF_RETURNS);
64 REGISTER_SP(CTF_CAPS);
65 REGISTER_SP(CTF_CAPTIME);
66 REGISTER_SP(CTF_DROPS);
68 REGISTER_SP(DOM_TAKES);
69 REGISTER_SP(DOM_TICKS);
71 REGISTER_SP(FREEZETAG_REVIVALS);
73 REGISTER_SP(KEEPAWAY_PICKUPS);
74 REGISTER_SP(KEEPAWAY_BCTIME);
75 REGISTER_SP(KEEPAWAY_CARRIERKILLS);
77 REGISTER_SP(KH_PICKUPS);
79 REGISTER_SP(KH_KCKILLS);
80 REGISTER_SP(KH_PUSHES);
81 REGISTER_SP(KH_DESTROYS);
82 REGISTER_SP(KH_LOSSES);
84 REGISTER_SP(LMS_RANK);
85 REGISTER_SP(LMS_LIVES);
87 REGISTER_SP(NEXBALL_GOALS);
88 REGISTER_SP(NEXBALL_FAULTS);
90 REGISTER_SP(ONS_TAKES);
91 REGISTER_SP(ONS_CAPS);
93 REGISTER_SP(MEDAL_AIRSHOT);
94 REGISTER_SP(MEDAL_DAMAGE);
95 REGISTER_SP(MEDAL_ELECTROBITCH);
96 REGISTER_SP(MEDAL_EXCELLENT);
97 REGISTER_SP(MEDAL_FIRSTBLOOD);
98 REGISTER_SP(MEDAL_HEADSHOT);
99 REGISTER_SP(MEDAL_HUMILIATION);
100 REGISTER_SP(MEDAL_IMPRESSIVE);
101 REGISTER_SP(MEDAL_YODA);
102 REGISTER_SP(MEDAL_TELEFRAG);
104 REGISTER_SP(MEDAL_ACCURACY);
105 REGISTER_SP(MEDAL_ASSIST);
106 REGISTER_SP(MEDAL_CAPTURE);
107 REGISTER_SP(MEDAL_DEFENSE);
108 REGISTER_SP(MEDAL_PERFECT);
110 REGISTER_SP(MEDAL_KILLSTREAK_03);
111 REGISTER_SP(MEDAL_KILLSTREAK_05);
112 REGISTER_SP(MEDAL_KILLSTREAK_10);
113 REGISTER_SP(MEDAL_KILLSTREAK_15);
114 REGISTER_SP(MMM_KARMA); //LegendGuard adds REGISTER_SP for MMM Karma points 21-02-2021
118 // the stuff you don't need to see
121 * Lower scores are better (e.g. suicides)
123 const int SFL_LOWER_IS_BETTER = BIT(0);
126 * Don't show zero values as scores
128 const int SFL_HIDE_ZERO = BIT(1);
131 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
133 const int SFL_ALLOW_HIDE = BIT(4);
136 * Display as a rank (with st, nd, rd, th suffix)
138 const int SFL_RANK = BIT(5);
141 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
143 const int SFL_TIME = BIT(6);
145 // not an extra constant yet
146 #define SFL_ZERO_IS_WORST SFL_TIME
149 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
151 const int SFL_SORT_PRIO_SECONDARY = 4;
152 const int SFL_SORT_PRIO_PRIMARY = 8;
153 const int SFL_SORT_PRIO_MASK = 12;
155 #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
156 #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
158 USING(PlayerScoreField, entity);
159 .int _scores[MAX_SCORE];
163 #define scores(this) _scores[(this).m_id]
164 #define scores_label(this) ((this).m_name)
165 #define scores_flags(this) ((this).m_flags)
167 #define MAX_TEAMSCORE 2
168 USING(ScoreTeam, string);
169 .int _teamscores[MAX_TEAMSCORE];
170 #define teamscores(i) _teamscores[i]
171 string _teamscores_label[MAX_TEAMSCORE];
172 #define teamscores_label(i) _teamscores_label[i]
173 int _teamscores_flags[MAX_TEAMSCORE];
174 #define teamscores_flags(i) _teamscores_flags[i]
176 const int ST_SCORE = 0;