X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fconstants.qh;h=6c775560394259816e14622b1584cb2843b34d59;hp=28db23dc11a13fd08b5365a30ca670e2b8638701;hb=a8e9c14803c6ee158f8183701f8e9c8601da9983;hpb=e0e847a336cdb7ab1fcb93d3cf3e1402b761a726 diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 28db23dc1..6c7755603 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -1,5 +1,4 @@ -#ifndef CONSTANTS_H -#define CONSTANTS_H +#pragma once REGISTER_NET_TEMP(TE_CSQC_PICTURE) REGISTER_NET_TEMP(TE_CSQC_RACE) @@ -123,19 +122,115 @@ const int SFL_SORT_PRIO_SECONDARY = 4; const int SFL_SORT_PRIO_PRIMARY = 8; const int SFL_SORT_PRIO_MASK = 12; -/** +/* * Score indices */ -#define MAX_SCORE 12 + +#ifndef MENUQC + +#define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER ) +#define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) ) + + +#define MAX_SCORE 64 + +#define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField)) +REGISTRY(Scores, MAX_SCORE); +#define Scores_from(i) _Scores_from(i, NULL) +REGISTER_REGISTRY(Scores) +REGISTRY_SORT(Scores); +REGISTRY_CHECK(Scores); +STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); } + +USING(PlayerScoreField, entity); +.int _scores[MAX_SCORE]; +.string m_name; +.int m_flags; + +#define scores(this) _scores[(this).m_id] +#define scores_label(this) ((this).m_name) +#define scores_flags(this) ((this).m_flags) + +REGISTER_SP(END); + +REGISTER_SP(PING); +REGISTER_SP(NAME); +REGISTER_SP(KDRATIO); +REGISTER_SP(CLRATIO); +REGISTER_SP(PL); +REGISTER_SP(SUM); + +REGISTER_SP(SEPARATOR); + +REGISTER_SP(SCORE); + +REGISTER_SP(DMG); +REGISTER_SP(DMGTAKEN); + +REGISTER_SP(KILLS); +REGISTER_SP(DEATHS); +REGISTER_SP(SUICIDES); +REGISTER_SP(FRAGS); + +REGISTER_SP(ELO); + +// TODO: move to common mutators + +REGISTER_SP(RACE_TIME); +REGISTER_SP(RACE_LAPS); +REGISTER_SP(RACE_FASTEST); + +REGISTER_SP(CTS_TIME); +REGISTER_SP(CTS_LAPS); +REGISTER_SP(CTS_FASTEST); + +REGISTER_SP(ASSAULT_OBJECTIVES); + +REGISTER_SP(CTF_PICKUPS); +REGISTER_SP(CTF_FCKILLS); +REGISTER_SP(CTF_RETURNS); +REGISTER_SP(CTF_CAPS); +REGISTER_SP(CTF_CAPTIME); +REGISTER_SP(CTF_DROPS); + +REGISTER_SP(DOM_TAKES); +REGISTER_SP(DOM_TICKS); + +REGISTER_SP(FREEZETAG_REVIVALS); + +REGISTER_SP(KEEPAWAY_PICKUPS); +REGISTER_SP(KEEPAWAY_BCTIME); +REGISTER_SP(KEEPAWAY_CARRIERKILLS); + +REGISTER_SP(KH_PICKUPS); +REGISTER_SP(KH_CAPS); +REGISTER_SP(KH_KCKILLS); +REGISTER_SP(KH_PUSHES); +REGISTER_SP(KH_DESTROYS); +REGISTER_SP(KH_LOSSES); + +REGISTER_SP(LMS_RANK); +REGISTER_SP(LMS_LIVES); + +REGISTER_SP(NEXBALL_GOALS); +REGISTER_SP(NEXBALL_FAULTS); + +REGISTER_SP(ONS_TAKES); +REGISTER_SP(ONS_CAPS); + #define MAX_TEAMSCORE 2 +USING(ScoreTeam, string); +.int _teamscores[MAX_TEAMSCORE]; +#define teamscores(i) _teamscores[i] +string _teamscores_label[MAX_TEAMSCORE]; +#define teamscores_label(i) _teamscores_label[i] +int _teamscores_flags[MAX_TEAMSCORE]; +#define teamscores_flags(i) _teamscores_flags[i] + +#endif const int ST_SCORE = 0; -const int SP_KILLS = 0; -const int SP_DEATHS = 1; -const int SP_SUICIDES = 2; -const int SP_SCORE = 3; -const int SP_DMG = 10; -const int SP_DMGTAKEN = 11; + // game mode specific indices are not in common/, but in server/scores_rules.qc! // WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc @@ -230,4 +325,3 @@ const int SPAWN_PRIO_GOOD_DISTANCE = 10; const int GTV_FORBIDDEN = 0; // Cannot be voted const int GTV_AVAILABLE = 1; // Can be voted const int GTV_CUSTOM = 2; // Custom entry -#endif