Xonotic
race.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/mapinfo.qh>
4 
5 #ifdef CSQC
6 void HUD_Mod_Race(vector pos, vector mySize);
7 #endif
10  {
11  this.gametype_init(this, _("Race"),"rc","g_race",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0",_("Race against other players to the finish line"));
12  }
13  METHOD(Race, m_parse_mapinfo, bool(string k, string v))
14  {
15  if (!k) {
16  cvar_set("g_race_qualifying_timelimit", cvar_defstring("g_race_qualifying_timelimit"));
17  return true;
18  }
19  switch (k) {
20  case "qualifying_timelimit":
21  cvar_set("g_race_qualifying_timelimit", v);
22  return true;
23  }
24  return false;
25  }
26  METHOD(Race, m_generate_mapinfo, void(Gametype this, string v))
27  {
28  if(v == "trigger_race_checkpoint")
30  }
31  METHOD(Race, m_isTwoBaseMode, bool())
32  {
33  return true;
34  }
35  METHOD(Race, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
36  {
37  TC(Gametype, this);
38  returns(menu, _("Laps:"), 1, 25, 1, "g_race_laps_limit", string_null, string_null);
39  }
40 #ifdef CSQC
41  ATTRIB(Race, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
42 #endif
43  ATTRIB(Race, m_legacydefaults, string, "20 5 7 15 0");
45 REGISTER_GAMETYPE(RACE, NEW(Race));
46 #define g_race IS_GAMETYPE(RACE)
string string_null
Definition: nil.qh:9
#define NEW(cname,...)
Definition: oo.qh:105
CLASS(Object) Object
Definition: oo.qh:318
entity() spawn
REGISTER_GAMETYPE(RACE, NEW(Race))
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
int m_flags
Definition: mapinfo.qh:27
#define ATTRIB(...)
Definition: oo.qh:136
#define INIT(cname)
Definition: oo.qh:198
int MapInfo_Map_supportedGametypes
Definition: mapinfo.qh:13
#define TC(T, sym)
Definition: _all.inc:82
Definition: race.qh:8
void HUD_Mod_Race(vector pos, vector mySize)
Definition: cl_race.qc:41
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector v
Definition: ent_cs.qc:116
const int GAMETYPE_FLAG_USEPOINTS
Definition: mapinfo.qh:20
#define ENDCLASS(cname)
Definition: oo.qh:269