Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
scores.qc File Reference
Include dependency graph for scores.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string GetPlayerScoreString (entity pl, float shortString)
 Returns score strings for eventlog etc.
string GetScoreLogLabel (string label, float fl)
string GetTeamScoreString (int tm, float shortString)
float PlayerScore_Add (entity player, PlayerScoreField scorefield, float score)
 Adds a score to the player's scores.
void PlayerScore_Attach (entity player)
 Attaches a PlayerScore entity to a player.
bool PlayerScore_Clear (entity player)
 Initialize the score of this player if needed.
float PlayerScore_Compare (entity t1, entity t2, bool strict)
void PlayerScore_Detach (entity player)
 Detaches a PlayerScore entity from the player.
void PlayerScore_PlayerStats (entity p)
bool PlayerScore_SendEntity (entity this, entity to, float sendflags)
float PlayerScore_Set (entity player, PlayerScoreField scorefield, float score)
 Sets the player's score to the score parameter.
entity PlayerScore_Sort (.float field, int teams, bool strict, bool nospectators)
 Sorts the players and stores their place in the given field, starting with.
void PlayerScore_TeamStats ()
float PlayerTeamScore_Add (entity player, PlayerScoreField pscorefield, float tscorefield, float score)
 Adds a score to both the player and the team.
int PlayerTeamScore_Compare (entity p1, entity p2, float teams, bool strict)
void Score_ClearAll ()
 Clear ALL scores (for ready-restart).
void Score_NicePrint (entity to)
 Prints the scores to the console of a player.
string Score_NicePrint_ItemColor (int vflags)
void Score_NicePrint_Player (entity to, entity p, float w)
void Score_NicePrint_Spectator (entity to, entity p)
void Score_NicePrint_Spectators (entity to)
void Score_NicePrint_Team (entity to, float t, float w)
int ScoreField_Compare (entity t1, entity t2,.float field, int fieldflags, int previous)
void ScoreInfo_Init (int teams)
 Initialize the scores info for the given number of teams.
bool ScoreInfo_SendEntity (entity this, entity to, int sf)
void ScoreInfo_SetLabel_PlayerScore (PlayerScoreField i, string label, int scoreflags)
void ScoreInfo_SetLabel_TeamScore (int i, string label, int scoreflags)
float TeamScore_Add (entity player, float scorefield, float score)
 Adds a score to the player's team's scores.
float TeamScore_AddToTeam (int t, float scorefield, float score)
 Adds a score to the given team.
int TeamScore_Compare (entity t1, entity t2, bool strict)
float TeamScore_GetCompareValue (float t)
 Returns a value indicating the team score (and higher is better).
bool TeamScore_SendEntity (entity this, entity to, float sendflags)
void TeamScore_Spawn (float t, string name)
void WinningConditionHelper (entity this)
 Sets the following results for the current scores entities.

Variables

const float NAMEWIDTH = 22
float score_dummyfield
entity scorekeeper
int scores_flags_primary
int scores_flags_secondary
var int scores_primary
var int scores_secondary
const float SCORESWIDTH = 58
entity teamscorekeepers [16]
int teamscores_entities_count
int teamscores_flags_primary
var int teamscores_primary

Function Documentation

◆ GetPlayerScoreString()

string GetPlayerScoreString ( entity pl,
float shortString )

Returns score strings for eventlog etc.

When called with NULL, or 0, as argument, they return the labels in the same order. The strings are comma separated; labels that end with !! designate primary, labels that end with ! designate high priority. Labels get an appended < if the scores are better if smaller (e.g. deaths). High priorities always come first. Example label string: score!!,kills,deaths<,suicides< If shortString is set, only the sort keys are returned.

Definition at line 613 of file scores.qc.

614{
615 entity sk;
616 int fl;
617 string lbl;
618
619 string out = "";
620 if(!pl)
621 {
622 // label
623 FOREACH(Scores, true, {
625 {
626 fl = scores_flags(it);
627 lbl = scores_label(it);
628 out = strcat(out, GetScoreLogLabel(lbl, fl), ",");
629 }
630 });
631 if(shortString < 2)
632 FOREACH(Scores, true, {
634 {
635 fl = scores_flags(it);
636 lbl = scores_label(it);
637 out = strcat(out, GetScoreLogLabel(lbl, fl), ",");
638 }
639 });
640 if(shortString < 1)
641 FOREACH(Scores, true, {
644 {
645 fl = scores_flags(it);
646 lbl = scores_label(it);
647 out = strcat(out, GetScoreLogLabel(lbl, fl), ",");
648 }
649 });
650 out = substring(out, 0, strlen(out) - 1);
651 }
652 else if((sk = CS(pl).scorekeeper))
653 {
654 FOREACH(Scores, true, {
656 out = strcat(out, ftos(sk.(scores(it))), ",");
657 });
658 if(shortString < 2)
659 FOREACH(Scores, true, {
661 out = strcat(out, ftos(sk.(scores(it))), ",");
662 });
663 if(shortString < 1)
664 FOREACH(Scores, true, {
667 out = strcat(out, ftos(sk.(scores(it))), ",");
668 });
669 out = substring(out, 0, strlen(out) - 1);
670 }
671 return out;
672}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define scores_label(this)
Definition scores.qh:146
#define scores_flags(this)
Definition scores.qh:147
const int SFL_SORT_PRIO_MASK
Definition scores.qh:135
const int SFL_SORT_PRIO_SECONDARY
Scoring priority (NOTE: PRIMARY is used for fraglimit) NOTE: SFL_SORT_PRIO_SECONDARY value must be lo...
Definition scores.qh:133
const int SFL_SORT_PRIO_PRIMARY
Definition scores.qh:134
#define strlen
#define FOREACH(list, cond, body)
Definition iter.qh:19
string substring(string s, float start, float length)
string ftos(float f)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
string GetScoreLogLabel(string label, float fl)
Definition scores.qc:602
entity scorekeeper
Definition scores.qc:19
ClientState CS(Client this)
Definition state.qh:47

References CS(), entity(), FOREACH, ftos(), GetScoreLogLabel(), scorekeeper, scores_flags, scores_label, SFL_SORT_PRIO_MASK, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_SECONDARY, strcat(), strlen, and substring().

Referenced by DumpStats(), and WinningConditionHelper().

◆ GetScoreLogLabel()

string GetScoreLogLabel ( string label,
float fl )

Definition at line 602 of file scores.qc.

603{
604 if(fl & SFL_LOWER_IS_BETTER)
605 label = strcat(label, "<");
607 label = strcat(label, "!!");
609 label = strcat(label, "!");
610 return label;
611}
const int SFL_LOWER_IS_BETTER
Lower scores are better (e.g.
Definition scores.qh:102

References SFL_LOWER_IS_BETTER, SFL_SORT_PRIO_MASK, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_SECONDARY, and strcat().

Referenced by GetPlayerScoreString(), and GetTeamScoreString().

◆ GetTeamScoreString()

string GetTeamScoreString ( int tm,
float shortString )

Definition at line 674 of file scores.qc.

675{
676 entity sk;
677 int i, fl;
678 string lbl;
679
680 string out = "";
681 if(tm == 0)
682 {
683 // label
684 for(i = 0; i < MAX_TEAMSCORE; ++i)
686 {
687 fl = teamscores_flags(i);
688 lbl = teamscores_label(i);
689 out = strcat(out, GetScoreLogLabel(lbl, fl), ",");
690 }
691 if(shortString < 2)
692 for(i = 0; i < MAX_TEAMSCORE; ++i)
694 {
695 fl = teamscores_flags(i);
696 lbl = teamscores_label(i);
697 out = strcat(out, GetScoreLogLabel(lbl, fl), ",");
698 }
699 if(shortString < 1)
700 for(i = 0; i < MAX_TEAMSCORE; ++i)
703 {
704 fl = teamscores_flags(i);
705 lbl = teamscores_label(i);
706 out = strcat(out, GetScoreLogLabel(lbl, fl), ",");
707 }
708 out = substring(out, 0, strlen(out) - 1);
709 }
710 else if((sk = teamscorekeepers[tm - 1]))
711 {
712 for(i = 0; i < MAX_TEAMSCORE; ++i)
714 out = strcat(out, ftos(sk.(teamscores(i))), ",");
715 if(shortString < 2)
716 for(i = 0; i < MAX_TEAMSCORE; ++i)
718 out = strcat(out, ftos(sk.(teamscores(i))), ",");
719 if(shortString < 1)
720 for(i = 0; i < MAX_TEAMSCORE; ++i)
723 out = strcat(out, ftos(sk.(teamscores(i))), ",");
724 out = substring(out, 0, strlen(out) - 1);
725 }
726 return out;
727}
#define MAX_TEAMSCORE
Definition scores.qh:149
#define teamscores_flags(i)
Definition scores.qh:156
#define teamscores_label(i)
Definition scores.qh:154
entity teamscorekeepers[16]
Definition scores.qc:20

References entity(), ftos(), GetScoreLogLabel(), MAX_TEAMSCORE, SFL_SORT_PRIO_MASK, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_SECONDARY, strcat(), strlen, substring(), teamscorekeepers, teamscores_flags, and teamscores_label.

Referenced by DumpStats(), and WinningConditionHelper().

◆ PlayerScore_Add()

float PlayerScore_Add ( entity player,
PlayerScoreField scorefield,
float score )

Adds a score to the player's scores.

NEVER call this if PlayerScore_Attach has not been called yet! Means: FIXME make players unable to join the game when not called ClientConnect yet. Returns the new score.

Definition at line 352 of file scores.qc.

353{
354 bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score, player);
355 score = M_ARGV(1, float);
356
357 if(!mutator_returnvalue && game_stopped)
358 {
359 score = 0;
360 }
361
362 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
363 entity s = CS(player).scorekeeper;
364 if(!s)
365 {
366 if(game_stopped)
367 return 0;
368 LOG_WARN("Adding score to unknown player!");
369 return 0;
370 }
371 if(!score)
372 {
373 return s.(scores(scorefield));
374 }
375 if(scores_label(scorefield) != "")
376 s.SendFlags |= BIT(scorefield.m_id % 16);
377 if(!warmup_stage)
379 s.(scores(scorefield)) += score;
380 MUTATOR_CALLHOOK(AddedPlayerScore, scorefield, score, player);
381 return s.(scores(scorefield));
382}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
bool warmup_stage
Definition main.qh:120
#define M_ARGV(x, type)
Definition events.qh:17
float game_stopped
Definition stats.qh:81
#define LOG_WARN(...)
Definition log.qh:61
const string PLAYERSTATS_TOTAL
#define PlayerStats_GameReport_Event_Player(ent, eventid, val)
entity scores_initialized
Definition scores.qh:7

References BIT, CS(), entity(), game_stopped, LOG_WARN, M_ARGV, MUTATOR_CALLHOOK, PlayerStats_GameReport_Event_Player, PLAYERSTATS_TOTAL, scores_initialized, scores_label, strcat(), and warmup_stage.

Referenced by _GameRules_scoring_add_float2int(), and PlayerTeamScore_Add().

◆ PlayerScore_Attach()

void PlayerScore_Attach ( entity player)

Attaches a PlayerScore entity to a player.

Use that in ClientConnect. Remember to detach it in ClientDisconnect!

Definition at line 334 of file scores.qc.

335{
336 if(CS(player).scorekeeper)
337 error("player already has a scorekeeper");
339 sk.owner = player;
341 CS(player).scorekeeper = sk;
342}
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:123
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67
#define error
Definition pre.qh:6
bool PlayerScore_SendEntity(entity this, entity to, float sendflags)
Definition scores.qc:257

References CS(), entity(), error, Net_LinkEntity(), new_pure, PlayerScore_SendEntity(), and scorekeeper.

Referenced by ClientState_attach().

◆ PlayerScore_Clear()

bool PlayerScore_Clear ( entity player)

Initialize the score of this player if needed.

Does nothing in teamplay. Use that when a spectator becomes a player. Returns whether clearing has been performed

Definition at line 285 of file scores.qc.

286{
287 entity sk;
288
290 return false;
291
292 if(MUTATOR_CALLHOOK(ForbidPlayerScore_Clear))
293 return false;
294
295 sk = CS(player).scorekeeper;
296 FOREACH(Scores, true, {
297 if(sk.(scores(it)) != 0 && scores_label(it) != "")
298 sk.SendFlags |= BIT(i % 16);
299 if(i != SP_SKILL.m_id)
300 sk.(scores(it)) = 0;
301 });
302
303 return true;
304}
int teamscores_entities_count
Definition scores.qc:21

References BIT, CS(), entity(), FOREACH, MUTATOR_CALLHOOK, scores_label, and teamscores_entities_count.

Referenced by PutPlayerInServer(), and SetPlayerTeam().

◆ PlayerScore_Compare()

float PlayerScore_Compare ( entity t1,
entity t2,
bool strict )

Definition at line 415 of file scores.qc.

416{
417 if(!t1 || !t2) return (!t2) - !t1;
418
419 int result = 0;
421 // NOTE: if (scores_secondary) doesn't work because it's a field pointer
422 if (result == 0 && scores_flags_secondary)
424
425 if (result == 0 && strict)
426 {
427 FOREACH(Scores, true, {
429 continue;
430 if (scores_label(it) == "")
431 continue;
432 var .float f = scores(it);
433 result = ScoreField_Compare(t1, t2, f, scores_flags(it), result);
434 if (result) break;
435 });
436 if (result == 0)
437 result = t1.owner.playerid - t2.owner.playerid;
438 }
439
440 return result;
441}
#define scores(this)
Definition scores.qh:145
entity result
Definition promise.qc:43
var int scores_primary
Definition scores.qc:22
int ScoreField_Compare(entity t1, entity t2,.float field, int fieldflags, int previous)
Definition scores.qc:30
int scores_flags_secondary
Definition scores.qc:27
int scores_flags_primary
Definition scores.qc:24
var int scores_secondary
Definition scores.qc:26

References entity(), FOREACH, result, ScoreField_Compare(), scores, scores_flags, scores_flags_primary, scores_flags_secondary, scores_label, scores_primary, scores_secondary, and SFL_SORT_PRIO_MASK.

Referenced by PlayerTeamScore_Compare(), and WinningConditionHelper().

◆ PlayerScore_Detach()

void PlayerScore_Detach ( entity player)

Detaches a PlayerScore entity from the player.

Use that in ClientDisconnect.

Definition at line 344 of file scores.qc.

345{
346 if(!CS(player).scorekeeper)
347 error("player has no scorekeeper");
348 delete(CS(player).scorekeeper);
349 CS(player).scorekeeper = NULL;
350}
#define NULL
Definition post.qh:14

References CS(), entity(), error, NULL, and scorekeeper.

Referenced by ClientState_detach().

◆ PlayerScore_PlayerStats()

void PlayerScore_PlayerStats ( entity p)

Definition at line 950 of file scores.qc.

951{
952 entity s = CS(p).scorekeeper;
953 FOREACH(Scores, true, {
954 if(s.(scores(it)) != 0 && scores_label(it) != "")
956 strcat(PLAYERSTATS_SCOREBOARD, scores_label(it)), s.(scores(it)));
957 });
958}
const string PLAYERSTATS_SCOREBOARD

References CS(), entity(), FOREACH, PlayerStats_GameReport_Event_Player, PLAYERSTATS_SCOREBOARD, scores_label, and strcat().

Referenced by PlayerStats_GameReport().

◆ PlayerScore_SendEntity()

bool PlayerScore_SendEntity ( entity this,
entity to,
float sendflags )

Definition at line 257 of file scores.qc.

258{
259 WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES);
261
262 int longflags = 0;
263 FOREACH(Scores, true, {
264 int p = BIT(i % 16);
265 if (this.(scores(it)) > 127 || this.(scores(it)) <= -128)
266 longflags |= p;
267 });
268
269 WriteShort(MSG_ENTITY, sendflags);
270 WriteShort(MSG_ENTITY, longflags);
271 FOREACH(Scores, true, {
272 int p = BIT(i % 16);
273 if (sendflags & p)
274 {
275 if(longflags & p)
276 WriteInt24_t(MSG_ENTITY, this.(scores(it)));
277 else
278 WriteChar(MSG_ENTITY, this.(scores(it)));
279 }
280 });
281
282 return true;
283}
entity owner
Definition main.qh:87
const int MSG_ENTITY
Definition net.qh:115
#define WriteHeader(to, id)
Definition net.qh:221
void WriteChar(float data, float dest, float desto)
void WriteShort(float data, float dest, float desto)
void WriteByte(float data, float dest, float desto)
#define etof(e)
Definition misc.qh:25

References BIT, entity(), etof, FOREACH, MSG_ENTITY, owner, scores, WriteByte(), WriteChar(), WriteHeader, and WriteShort().

Referenced by PlayerScore_Attach().

◆ PlayerScore_Set()

float PlayerScore_Set ( entity player,
PlayerScoreField scorefield,
float score )

Sets the player's score to the score parameter.

NEVER call this if PlayerScore_Attach has not been called yet! Means: FIXME make players unable to join the game when not called ClientConnect yet. Returns the new (or old if unchanged) score.

Definition at line 384 of file scores.qc.

385{
386 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
387 entity s = CS(player).scorekeeper;
388 if(!s)
389 {
390 if(game_stopped)
391 return 0;
392 LOG_WARN("Setting score of unknown player!");
393 return 0;
394 }
395
396 float oldscore = s.(scores(scorefield));
397 if(oldscore == score)
398 return oldscore;
399
400 if(scores_label(scorefield) != "")
401 s.SendFlags |= BIT(scorefield.m_id % 16);
402 s.(scores(scorefield)) = score;
403 return s.(scores(scorefield));
404}

References BIT, CS(), entity(), game_stopped, LOG_WARN, scores_initialized, and scores_label.

Referenced by NET_HANDLE().

◆ PlayerScore_Sort()

entity PlayerScore_Sort ( .float field,
int teams,
bool strict,
bool nospectators )

Sorts the players and stores their place in the given field, starting with.

  1. Non-players get 0 written into that field. Returns the beginning of a sorted chain of the non-spectators. teams: >0: sort by teams first (always strict ordering); <0: sort by teams only (respects strict flag) strict: return a strict ordering nospectators: exclude spectators

Definition at line 748 of file scores.qc.

749{
750 entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
751
752 plist = NULL;
753
754 FOREACH_CLIENT(true, { it.(field) = 0; });
755
757 {
758 if(nospectators)
759 if(it.frags == FRAGS_SPECTATOR)
760 continue;
761
762 it.chain = plist;
763 plist = it;
764 });
765 // Now plist points to the whole list.
766
767 pfirst = plast = NULL;
768
769 int i = 0, j = 0;
770 while(plist)
771 {
772 pprev = pbestprev = NULL;
773 pbest = plist;
774 for(p = plist; (pprev = p), (p = p.chain); )
775 {
776 if(PlayerTeamScore_Compare(p, pbest, teams, strict) > 0)
777 {
778 pbest = p;
779 pbestprev = pprev;
780 }
781 }
782
783 // remove pbest out of the chain
784 if(pbestprev == NULL)
785 plist = pbest.chain;
786 else
787 pbestprev.chain = pbest.chain;
788 pbest.chain = NULL;
789
790 ++i;
791 if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, strict))
792 j = i;
793
794 pbest.(field) = j;
795
796 if (!pfirst)
797 pfirst = pbest;
798 if(plast)
799 plast.chain = pbest;
800 plast = pbest;
801 }
802
803 return pfirst;
804}
entity teams
Definition main.qh:58
const int FRAGS_SPECTATOR
Definition constants.qh:4
int PlayerTeamScore_Compare(entity p1, entity p2, float teams, bool strict)
Definition scores.qc:730
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:50

References CS(), entity(), FOREACH_CLIENT, FRAGS_SPECTATOR, NULL, PlayerTeamScore_Compare(), scorekeeper, and teams.

Referenced by MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), PlayerStats_GameReport(), and Score_NicePrint().

◆ PlayerScore_TeamStats()

void PlayerScore_TeamStats ( )

Definition at line 960 of file scores.qc.

961{
962 for (int t = 0; t < 16; ++t)
963 {
964 entity sk = teamscorekeepers[t];
965 if (!sk)
966 continue;
967 for (int i = 0; i < MAX_TEAMSCORE; ++i)
968 if(sk.(teamscores(i)) != 0 && teamscores_label(i) != "")
969 // the +1 is important here!
971 strcat(PLAYERSTATS_SCOREBOARD, teamscores_label(i)), sk.(teamscores(i)));
972 }
973}
#define PlayerStats_GameReport_Event_Team(team, eventid, val)

References entity(), MAX_TEAMSCORE, PlayerStats_GameReport_Event_Team, PLAYERSTATS_SCOREBOARD, strcat(), teamscorekeepers, and teamscores_label.

Referenced by PlayerStats_GameReport().

◆ PlayerTeamScore_Add()

float PlayerTeamScore_Add ( entity player,
PlayerScoreField pscorefield,
float tscorefield,
float score )

Adds a score to both the player and the team.

Returns the team score if possible, otherwise the player score.

Definition at line 406 of file scores.qc.

407{
408 float r = PlayerScore_Add(player, pscorefield, score);
409 if(teamscores_entities_count) // only for teamplay
410 r = TeamScore_Add(player, tscorefield, score);
411 return r;
412}
float TeamScore_Add(entity player, float scorefield, float score)
Adds a score to the player's team's scores.
Definition scores.qc:134
float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
Adds a score to the player's scores.
Definition scores.qc:352

References entity(), PlayerScore_Add(), TeamScore_Add(), and teamscores_entities_count.

Referenced by _GameRules_scoring_add_float2int().

◆ PlayerTeamScore_Compare()

int PlayerTeamScore_Compare ( entity p1,
entity p2,
float teams,
bool strict )

Definition at line 730 of file scores.qc.

731{
733 {
734 if(p1.team != p2.team)
735 {
736 entity t1 = teamscorekeepers[p1.team - 1];
737 entity t2 = teamscorekeepers[p2.team - 1];
738 int r = TeamScore_Compare(t1, t2, ((teams >= 0) ? 1 : strict));
739 return r;
740 }
741 if(teams < 0)
742 return 0;
743 }
744
745 return PlayerScore_Compare(CS(p1).scorekeeper, CS(p2).scorekeeper, strict);
746}
float PlayerScore_Compare(entity t1, entity t2, bool strict)
Definition scores.qc:415
int TeamScore_Compare(entity t1, entity t2, bool strict)
Definition scores.qc:140

References CS(), entity(), PlayerScore_Compare(), scorekeeper, teams, TeamScore_Compare(), teamscorekeepers, and teamscores_entities_count.

Referenced by PlayerScore_Sort().

◆ Score_ClearAll()

void Score_ClearAll ( )

Clear ALL scores (for ready-restart).

Definition at line 306 of file scores.qc.

307{
308 entity sk;
309 int t;
310 FOREACH_CLIENTSLOT(true, {
311 sk = CS(it).scorekeeper;
312 if (!sk) continue;
313 FOREACH(Scores, true, {
314 if(sk.(scores(it)) != 0 && scores_label(it) != "")
315 sk.SendFlags |= BIT(i % 16);
316 if(i != SP_SKILL.m_id)
317 sk.(scores(it)) = 0;
318 });
319 });
320 for(t = 0; t < 16; ++t)
321 {
322 sk = teamscorekeepers[t];
323 if(!sk)
324 continue;
325 for(int j = 0; j < MAX_TEAMSCORE; ++j)
326 {
327 if(sk.(teamscores(j)) != 0 && teamscores_label(j) != "")
328 sk.SendFlags |= BIT(j);
329 sk.(teamscores(j)) = 0;
330 }
331 }
332}
#define FOREACH_CLIENTSLOT(cond, body)
Definition utils.qh:40

References BIT, CS(), entity(), FOREACH, FOREACH_CLIENTSLOT, MAX_TEAMSCORE, scores_label, teamscorekeepers, and teamscores_label.

Referenced by reset_map().

◆ Score_NicePrint()

void Score_NicePrint ( entity to)

Prints the scores to the console of a player.

Definition at line 917 of file scores.qc.

918{
919 int t = 0;
920 FOREACH(Scores, true, {
921 if(scores_label(it) != "")
922 ++t;
923 });
924 int w = bound(6, floor(SCORESWIDTH / t - 1), 9);
925
926 entity p = PlayerScore_Sort(score_dummyfield, 1, true, false);
927 t = -1;
928
930 Score_NicePrint_Team(to, t, w);
931 while(p)
932 {
934 if(t != p.team)
935 Score_NicePrint_Team(to, p.team, w);
936 Score_NicePrint_Player(to, p, w);
937 t = p.team;
938 p = p.chain;
939 }
940
941 t = 0;
943 if (!t)
946 t = 1;
947 });
948}
#define IS_PLAYER(s)
Definition player.qh:243
float bound(float min, float value, float max)
float floor(float f)
void Score_NicePrint_Team(entity to, float t, float w)
Definition scores.qc:842
const float SCORESWIDTH
Definition scores.qc:830
void Score_NicePrint_Spectator(entity to, entity p)
Definition scores.qc:911
float score_dummyfield
Definition scores.qc:916
void Score_NicePrint_Player(entity to, entity p, float w)
Definition scores.qc:876
void Score_NicePrint_Spectators(entity to)
Definition scores.qc:906
entity PlayerScore_Sort(.float field, int teams, bool strict, bool nospectators)
Sorts the players and stores their place in the given field, starting with.
Definition scores.qc:748

References bound(), entity(), floor(), FOREACH, FOREACH_CLIENT, IS_PLAYER, PlayerScore_Sort(), score_dummyfield, Score_NicePrint_Player(), Score_NicePrint_Spectator(), Score_NicePrint_Spectators(), Score_NicePrint_Team(), scores_label, SCORESWIDTH, and teamscores_entities_count.

Referenced by CommonCommand_teamstatus(), MUTATOR_HOOKFUNCTION(), and MUTATOR_HOOKFUNCTION().

◆ Score_NicePrint_ItemColor()

string Score_NicePrint_ItemColor ( int vflags)

Definition at line 832 of file scores.qc.

833{
834 if(vflags & SFL_SORT_PRIO_PRIMARY)
835 return "^3";
836 else if(vflags & SFL_SORT_PRIO_SECONDARY)
837 return "^5";
838 else
839 return "^7";
840}

References SFL_SORT_PRIO_PRIMARY, and SFL_SORT_PRIO_SECONDARY.

Referenced by Score_NicePrint_Player(), and Score_NicePrint_Team().

◆ Score_NicePrint_Player()

void Score_NicePrint_Player ( entity to,
entity p,
float w )

Definition at line 876 of file scores.qc.

877{
878 float i;
879 entity sk = CS(p).scorekeeper;
880
881 string s = strcat(" ", playername(p.netname, p.team, false));
882 for (;;)
883 {
884 i = strlennocol(s) - NAMEWIDTH;
885 if(i > 0)
886 s = substring(s, 0, strlen(s) - i);
887 else
888 {
889 s = strcat(s, strpad(i, ""));
890 break;
891 }
892 }
893
894 FOREACH(Scores, true, {
895 if(scores_label(it) != "")
896 {
897 int fl = scores_flags(it);
898 float sc = sk.(scores(it));
899 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, ScoreString(fl, sc, 0)));
900 }
901 });
902
903 print_to(to, s);
904}
string playername(string thename, int teamid, bool team_colorize)
Definition util.qc:2082
string ScoreString(int pFlags, float pValue, int rounds_played)
Definition util.qc:423
const float NAMEWIDTH
Definition scores.qc:829
string Score_NicePrint_ItemColor(int vflags)
Definition scores.qc:832
void print_to(entity to, string input)
Definition common.qc:171

References CS(), entity(), FOREACH, NAMEWIDTH, playername(), print_to(), Score_NicePrint_ItemColor(), scores_flags, scores_label, ScoreString(), strcat(), strlen, and substring().

Referenced by Score_NicePrint().

◆ Score_NicePrint_Spectator()

void Score_NicePrint_Spectator ( entity to,
entity p )

Definition at line 911 of file scores.qc.

912{
913 print_to(to, strcat(" ", playername(p.netname, p.team, false)));
914}

References entity(), playername(), print_to(), and strcat().

Referenced by Score_NicePrint().

◆ Score_NicePrint_Spectators()

void Score_NicePrint_Spectators ( entity to)

Definition at line 906 of file scores.qc.

907{
908 print_to(to, "Spectators:");
909}

References entity(), and print_to().

Referenced by Score_NicePrint().

◆ Score_NicePrint_Team()

void Score_NicePrint_Team ( entity to,
float t,
float w )

Definition at line 842 of file scores.qc.

843{
844 int fl;
845 string s = "";
846
847 entity sk = teamscorekeepers[t - 1];
848 if(sk)
849 {
850 s = strcat(s, Team_ColoredFullName(t));
851 for(int i = 0; i < MAX_TEAMSCORE; ++i)
852 if(teamscores_label(i) != "")
853 {
854 fl = teamscores_flags(i);
855 float sc = sk.(teamscores(i));
856 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), ScoreString(fl, sc, 0));
857 }
858 }
859 else
860 s = "Scores:";
861
862 s = strcat(s, strpad(max(0, NAMEWIDTH - strlennocol(s)), ""));
863
864 FOREACH(Scores, true, {
865 if(scores_label(it) != "")
866 {
867 fl = scores_flags(it);
868 string s2 = scores_label(it);
869 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, substring(s2, 0, w)));
870 }
871 });
872
873 print_to(to, s);
874}
float max(float f,...)
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1points s1 s2
Definition all.inc:469
#define Team_ColoredFullName(teamid)
Definition teams.qh:232

References entity(), FOREACH, max(), MAX_TEAMSCORE, NAMEWIDTH, print_to(), s2, Score_NicePrint_ItemColor(), scores_flags, scores_label, ScoreString(), strcat(), substring(), Team_ColoredFullName, teamscorekeepers, teamscores_flags, and teamscores_label.

Referenced by Score_NicePrint().

◆ ScoreField_Compare()

int ScoreField_Compare ( entity t1,
entity t2,
.float field,
int fieldflags,
int previous )

Definition at line 30 of file scores.qc.

31{
32 if(fieldflags & SFL_NOT_SORTABLE) // column does not sort
33 return previous;
34 if (t1.(field) == t2.(field))
35 return previous;
36
37 if(fieldflags & SFL_ZERO_IS_WORST)
38 {
39 if (t1.(field) == 0)
40 {
41 previous = -1;
42 return previous;
43 }
44 else if (t2.(field) == 0)
45 {
46 previous = +1;
47 return previous;
48 }
49 }
50
51 if (fieldflags & SFL_LOWER_IS_BETTER)
52 previous = (t2.(field) - t1.(field));
53 else
54 previous = (t1.(field) - t2.(field));
55
56 return previous;
57}
const int SFL_NOT_SORTABLE
Definition scores.qh:124
#define SFL_ZERO_IS_WORST
Definition scores.qh:127

References entity(), SFL_LOWER_IS_BETTER, SFL_NOT_SORTABLE, and SFL_ZERO_IS_WORST.

Referenced by PlayerScore_Compare(), and TeamScore_Compare().

◆ ScoreInfo_Init()

void ScoreInfo_Init ( int teams)

Initialize the scores info for the given number of teams.

Set all labels right before this call.

Definition at line 232 of file scores.qc.

233{
235 {
236 scores_initialized.SendFlags |= 1; // force a resend
237 }
238 else
239 {
240 scores_initialized = new_pure(ent_client_scoreinfo);
242 }
243 if(teams & BIT(0))
245 if(teams & BIT(1))
247 if(teams & BIT(2))
248 TeamScore_Spawn(NUM_TEAM_3, "Yellow");
249 if(teams & BIT(3))
251}
void TeamScore_Spawn(float t, string name)
Definition scores.qc:96
bool ScoreInfo_SendEntity(entity this, entity to, int sf)
Definition scores.qc:204
const int NUM_TEAM_2
Definition teams.qh:14
const int NUM_TEAM_4
Definition teams.qh:16
const int NUM_TEAM_3
Definition teams.qh:15
const int NUM_TEAM_1
Definition teams.qh:13

References BIT, Net_LinkEntity(), new_pure, NUM_TEAM_1, NUM_TEAM_2, NUM_TEAM_3, NUM_TEAM_4, ScoreInfo_SendEntity(), scores_initialized, teams, and TeamScore_Spawn().

Referenced by ScoreRules_basics_end().

◆ ScoreInfo_SendEntity()

bool ScoreInfo_SendEntity ( entity this,
entity to,
int sf )

Definition at line 204 of file scores.qc.

205{
206 int i;
207 WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
209 string gt_name = "";
211 gt_name = cvar_string(strcat("sv_vote_gametype_", loaded_gametype_custom_string, "_name"));
212 WriteString(MSG_ENTITY, gt_name);
213 FOREACH(Scores, true, {
216 });
217 for(i = 0; i < MAX_TEAMSCORE; ++i)
218 {
221 }
222 // prevent sending the welcome message again when score types are sent again because the scoring system has changed
223 // it can happen in some gametypes like Race when the qualyfing session ends and the race starts
224 bool welcome_msg_too = (!CS(to) || time < CS(to).jointime + 5);
225 WriteByte(MSG_ENTITY, welcome_msg_too);
226 // welcome message is sent here because it needs to know the gametype
227 if (welcome_msg_too)
229 return true;
230}
float time
#define WriteRegistered(r, to, it)
Definition net.qh:299
Gametype MapInfo_LoadedGametype
Definition mapinfo.qh:220
void WriteString(string data, float dest, float desto)
const string cvar_string(string name)
void SendWelcomeMessage(entity this, int msg_type)
Definition client.qc:1075
string loaded_gametype_custom_string
Definition world.qh:53

References CS(), cvar_string(), entity(), FOREACH, loaded_gametype_custom_string, MapInfo_LoadedGametype, MAX_TEAMSCORE, MSG_ENTITY, scores_flags, scores_label, SendWelcomeMessage(), strcat(), teamscores_flags, teamscores_label, time, WriteByte(), WriteHeader, WriteRegistered, and WriteString().

Referenced by ScoreInfo_Init().

◆ ScoreInfo_SetLabel_PlayerScore()

void ScoreInfo_SetLabel_PlayerScore ( PlayerScoreField i,
string label,
int scoreflags )

◆ ScoreInfo_SetLabel_TeamScore()

void ScoreInfo_SetLabel_TeamScore ( int i,
string label,
int scoreflags )

Definition at line 188 of file scores.qc.

189{
190 teamscores_label(i) = label;
191 teamscores_flags(i) = scoreflags;
192 if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
193 {
195 teamscores_flags_primary = scoreflags;
196 }
197 if(label != "")
198 {
201 }
202}
#define teamscores(i)
Definition scores.qh:152
var int teamscores_primary
Definition scores.qc:23
int teamscores_flags_primary
Definition scores.qc:25

References PlayerStats_GameReport_AddEvent(), PLAYERSTATS_SCOREBOARD, PLAYERSTATS_TOTAL, SFL_SORT_PRIO_MASK, SFL_SORT_PRIO_PRIMARY, strcat(), teamscores, teamscores_flags, teamscores_flags_primary, teamscores_label, and teamscores_primary.

Referenced by ScoreRules_basics().

◆ TeamScore_Add()

float TeamScore_Add ( entity player,
float scorefield,
float score )

Adds a score to the player's team's scores.

NEVER call this if team has not been set yet! Returns the new score.

Definition at line 134 of file scores.qc.

135{
136 return TeamScore_AddToTeam(player.team, scorefield, score);
137}
float TeamScore_AddToTeam(int t, float scorefield, float score)
Adds a score to the given team.
Definition scores.qc:107

References entity(), and TeamScore_AddToTeam().

Referenced by PlayerTeamScore_Add().

◆ TeamScore_AddToTeam()

float TeamScore_AddToTeam ( int t,
float scorefield,
float score )

Adds a score to the given team.

NEVER call this if team has not been set yet! Returns the new score.

Definition at line 107 of file scores.qc.

108{
109 entity s;
110
111 if(game_stopped)
112 score = 0;
113
114 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
115 if(t <= 0 || t >= 16)
116 {
117 if(game_stopped)
118 return 0;
119 error("Adding score to invalid team!");
120 }
121 s = teamscorekeepers[t - 1];
122 if(!s)
123 {
124 if(game_stopped)
125 return 0;
126 error("Adding score to unknown team!");
127 }
128 if(score)
129 if(teamscores_label(scorefield) != "")
130 s.SendFlags |= BIT(scorefield);
131 return (s.(teamscores(scorefield)) += score);
132}

References BIT, entity(), error, game_stopped, scores_initialized, teamscorekeepers, and teamscores_label.

Referenced by CA_CheckWinner(), ctf_Handle_Return(), Domination_CheckWinner(), dompointthink(), freezetag_CheckWinner(), GoalTouch(), Onslaught_CheckWinner(), TeamScore_Add(), WinningCondition_Assault(), and WinningCondition_RanOutOfSpawns().

◆ TeamScore_Compare()

int TeamScore_Compare ( entity t1,
entity t2,
bool strict )

Definition at line 140 of file scores.qc.

141{
142 if(!t1 || !t2) return (!t2) - !t1;
143
144 // supporting MAX_TEAMSCORE > 2 requires keeping track of primary and secondary teamscore
145 if (MAX_TEAMSCORE > 2)
146 error("MAX_TEAMSCORE > 2 not supported");
147
148 // first compare primary, then others (don't check secondary flag since there are only 2 teamscores)
149 int result = 0;
152 if (result == 0 && strict)
153 {
154 i = (i + 1) % MAX_TEAMSCORE;
156 if (result == 0)
157 result = t1.team - t2.team;
158 }
159
160 return result;
161}
#define boolean(value)
Definition bool.qh:9

References boolean, entity(), error, MAX_TEAMSCORE, result, ScoreField_Compare(), teamscores, teamscores_flags, and teamscores_primary.

Referenced by PlayerTeamScore_Compare(), and WinningConditionHelper().

◆ TeamScore_GetCompareValue()

float TeamScore_GetCompareValue ( float t)

Returns a value indicating the team score (and higher is better).

Definition at line 806 of file scores.qc.

807{
808 float s;
809
810 if(t <= 0 || t >= 16)
811 {
812 if(game_stopped)
813 return 0;
814 error("Reading score of invalid team!");
815 }
816
817 entity sk = teamscorekeepers[t - 1];
818 if (!sk)
819 return -999999999;
820 s = sk.teamscores_primary;
822 if(!s)
823 return -999999999;
825 s = -s;
826 return s;
827}

References entity(), error, game_stopped, SFL_LOWER_IS_BETTER, SFL_ZERO_IS_WORST, teamscorekeepers, and teamscores_flags_primary.

Referenced by WinningCondition_Scores().

◆ TeamScore_SendEntity()

bool TeamScore_SendEntity ( entity this,
entity to,
float sendflags )

Definition at line 63 of file scores.qc.

64{
65 int i, longflags;
66
67 WriteHeader(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
68 int t = this.team - 1;
69 assert(t, eprint(this));
71
72 longflags = 0;
73 for(i = 0; i < MAX_TEAMSCORE; ++i)
74 if(this.(teamscores(i)) > 127 || this.(teamscores(i)) <= -128)
75 longflags |= BIT(i);
76
77#if MAX_TEAMSCORE <= 8
78 WriteByte(MSG_ENTITY, sendflags);
79 WriteByte(MSG_ENTITY, longflags);
80#else
81 WriteShort(MSG_ENTITY, sendflags);
82 WriteShort(MSG_ENTITY, longflags);
83#endif
84 for(i = 0; i < MAX_TEAMSCORE; ++i)
85 if(sendflags & BIT(i))
86 {
87 if(longflags & BIT(i))
88 WriteInt24_t(MSG_ENTITY, this.(teamscores(i)));
89 else
91 }
92
93 return true;
94}
int team
Definition main.qh:188
#define assert(expr,...)
Definition log.qh:8
void eprint(entity e)

References assert, BIT, entity(), eprint(), MAX_TEAMSCORE, MSG_ENTITY, team, teamscores, WriteByte(), WriteChar(), WriteHeader, and WriteShort().

Referenced by TeamScore_Spawn().

◆ TeamScore_Spawn()

void TeamScore_Spawn ( float t,
string name )

Definition at line 96 of file scores.qc.

97{
98 entity ts = new_pure(csqc_score_team);
99 ts.netname = name; // not used yet, FIXME
100 ts.team = t;
102 teamscorekeepers[t - 1] = ts;
105}
string name
Definition menu.qh:30
void PlayerStats_GameReport_AddTeam(int t)
bool TeamScore_SendEntity(entity this, entity to, float sendflags)
Definition scores.qc:63

References entity(), name, Net_LinkEntity(), new_pure, PlayerStats_GameReport_AddTeam(), TeamScore_SendEntity(), teamscorekeepers, and teamscores_entities_count.

Referenced by ScoreInfo_Init().

◆ WinningConditionHelper()

void WinningConditionHelper ( entity this)

Sets the following results for the current scores entities.

Definition at line 443 of file scores.qc.

444{
445 float c;
446 string s;
447 entity sk;
448
449 // format:
450 // gametype:P<pure>:S<slots>::plabel,plabel:tlabel,tlabel:teamid:tscore,tscore:teamid:tscore,tscore
451 // score labels always start with a symbol or with lower case
452 // so to match pure, match for :P0:
453 // to match full, match for :S0:
454
455 // NOTE can't use a single strcat because strcat concatenates max 8 strings
456 s = strcat(GetGametype(),
459 ":S", ftos(nJoinAllowed(NULL)));
460 s = strcat(s,
461 ":F", ftos(serverflags),
463 ":M", modname);
464 s = strcat(s,
466
467 entity winnerscorekeeper = NULL;
468 entity secondscorekeeper = NULL;
469
471 {
472 int t;
473
474 s = strcat(s, ":", GetTeamScoreString(0, 1));
475 for(t = 0; t < 16; ++t)
476 if(teamscorekeepers[t])
477 s = strcat(s, ":", ftos(t+1), ":", GetTeamScoreString(t+1, 1));
478
481 for(t = 0; t < 16; ++t)
482 {
483 sk = teamscorekeepers[t];
484 c = TeamScore_Compare(winnerscorekeeper, sk, true);
485 if(c < 0)
486 {
489 secondscorekeeper = winnerscorekeeper;
490 winnerscorekeeper = sk;
491 }
492 else
493 {
494 c = TeamScore_Compare(secondscorekeeper, sk, true);
495 if(c < 0)
496 {
498 secondscorekeeper = sk;
499 }
500 }
501 }
502
503 WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper, false) == 0);
506
507 WinningConditionHelper_topscore = winnerscorekeeper.teamscores_primary;
508 WinningConditionHelper_secondscore = secondscorekeeper.teamscores_primary;
511
512 WinningConditionHelper_winner = NULL; // not supported in teamplay
513 WinningConditionHelper_second = NULL; // not supported in teamplay
514 }
515 else
516 {
520 sk = CS(it).scorekeeper;
521 c = PlayerScore_Compare(winnerscorekeeper, sk, true);
522 if(c < 0)
523 {
526 secondscorekeeper = winnerscorekeeper;
527 winnerscorekeeper = sk;
528 }
529 else
530 {
531 c = PlayerScore_Compare(secondscorekeeper, sk, true);
532 if(c < 0)
533 {
535 secondscorekeeper = sk;
536 }
537 }
538 });
539
540 WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, false) == 0);
543
544 WinningConditionHelper_topscore = winnerscorekeeper.scores_primary;
545 WinningConditionHelper_secondscore = secondscorekeeper.scores_primary;
548
549 WinningConditionHelper_winnerteam = -1; // no teamplay
550 WinningConditionHelper_secondteam = -1; // no teamplay
551 }
552
554 {
556 {
559 else
561 }
562 if(player_count == 0) // special case: empty servers DO end the match at a 0:0 tie
564 }
565
567 {
569 {
572 else
574 }
575 }
576
577 if (s != worldstatus)
579
580 FOREACH_CLIENT(true, {
581 string s = "";
583 {
584 s = GetPlayerScoreString(it, 1);
585 s = strcat(s, IS_REAL_CLIENT(it) ? ":human" : ":bot");
586 if(!(IS_PLAYER(it) || INGAME_JOINED(it)))
587 s = strcat(s, ":spectator");
588 }
589 else
590 {
591 if (IS_PLAYER(it) || INGAME_JOINED(it))
592 s = GetPlayerScoreString(it, 2);
593 else
594 s = "-666";
595 }
596
597 if (s != it.clientstatus)
598 strcpy(it.clientstatus, s);
599 });
600}
int player_count
Definition api.qh:103
int serverflags
Definition main.qh:211
string worldstatus
string GetGametype()
string GetTeamScoreString(int tm, float shortString)
Definition scores.qc:674
string GetPlayerScoreString(entity pl, float shortString)
Returns score strings for eventlog etc.
Definition scores.qc:613
int nJoinAllowed(entity this)
Determines how many player slots are free.
Definition client.qc:2143
string autocvar_g_xonoticversion
Definition client.qh:46
float WinningConditionHelper_secondscore
second highest score
Definition scores.qh:108
entity WinningConditionHelper_second
the second player, or NULL if none
Definition scores.qh:113
float WinningConditionHelper_winnerteam
the color of the winning team, or -1 if none
Definition scores.qh:109
entity WinningConditionHelper_winner
the winning player, or NULL if none
Definition scores.qh:112
float WinningConditionHelper_topscore
highest score
Definition scores.qh:107
float WinningConditionHelper_equality
we have no winner
Definition scores.qh:111
bool autocvar_g_full_getstatus_responses
Definition scores.qh:5
float WinningConditionHelper_lowerisbetter
lower is better, duh
Definition scores.qh:114
float WinningConditionHelper_zeroisworst
zero is worst, duh
Definition scores.qh:115
float WinningConditionHelper_secondteam
the color of the second team, or -1 if none
Definition scores.qh:110
#define strcpy(this, s)
Definition string.qh:52
#define INGAME_JOINED(it)
Definition sv_rules.qh:25
#define IS_REAL_CLIENT(v)
Definition utils.qh:17
float cvar_purechanges_count
Definition world.qh:47
string modname
Definition world.qh:49
string sv_termsofservice_url_escaped
Definition world.qh:59

References autocvar_g_full_getstatus_responses, autocvar_g_xonoticversion, CS(), cvar_purechanges_count, entity(), FOREACH_CLIENT, ftos(), GetGametype(), GetPlayerScoreString(), GetTeamScoreString(), INGAME_JOINED, IS_PLAYER, IS_REAL_CLIENT, modname, nJoinAllowed(), NULL, player_count, PlayerScore_Compare(), scores_flags_primary, serverflags, SFL_LOWER_IS_BETTER, SFL_ZERO_IS_WORST, strcat(), strcpy, sv_termsofservice_url_escaped, TeamScore_Compare(), teamscorekeepers, teamscores_entities_count, teamscores_flags_primary, WinningConditionHelper_equality, WinningConditionHelper_lowerisbetter, WinningConditionHelper_second, WinningConditionHelper_secondscore, WinningConditionHelper_secondteam, WinningConditionHelper_topscore, WinningConditionHelper_winner, WinningConditionHelper_winnerteam, WinningConditionHelper_zeroisworst, and worldstatus.

Referenced by spawnfunc(), WinningCondition_Assault(), WinningCondition_Invasion(), WinningCondition_LMS(), and WinningCondition_Scores().

Variable Documentation

◆ NAMEWIDTH

const float NAMEWIDTH = 22

Definition at line 829 of file scores.qc.

Referenced by Score_NicePrint_Player(), and Score_NicePrint_Team().

◆ score_dummyfield

float score_dummyfield

Definition at line 916 of file scores.qc.

Referenced by PlayerStats_GameReport(), and Score_NicePrint().

◆ scorekeeper

◆ scores_flags_primary

int scores_flags_primary

◆ scores_flags_secondary

int scores_flags_secondary

Definition at line 27 of file scores.qc.

Referenced by PlayerScore_Compare(), and ScoreInfo_SetLabel_PlayerScore().

◆ scores_primary

var int scores_primary

Definition at line 22 of file scores.qc.

Referenced by PlayerScore_Compare(), and ScoreInfo_SetLabel_PlayerScore().

◆ scores_secondary

var int scores_secondary

Definition at line 26 of file scores.qc.

Referenced by PlayerScore_Compare(), and ScoreInfo_SetLabel_PlayerScore().

◆ SCORESWIDTH

const float SCORESWIDTH = 58

Definition at line 830 of file scores.qc.

Referenced by Score_NicePrint().

◆ teamscorekeepers

◆ teamscores_entities_count

◆ teamscores_flags_primary

int teamscores_flags_primary

◆ teamscores_primary

var int teamscores_primary

Definition at line 23 of file scores.qc.

Referenced by ScoreInfo_SetLabel_TeamScore(), and TeamScore_Compare().