Xonotic
keyhunt.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_KH(vector pos, vector mySize);
7 #endif
10  {
11  this.gametype_init(this, _("Key Hunt"),"kh","g_keyhunt",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round"));
12  }
13  METHOD(KeyHunt, m_parse_mapinfo, bool(string k, string v))
14  {
15  if (!k) {
16  cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
17  return true;
18  }
19  switch (k) {
20  case "teams":
21  cvar_set("g_keyhunt_teams", v);
22  return true;
23  }
24  return false;
25  }
26  METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
27  {
28  if(spawnpoints >= 12 && diameter > 5120)
29  return true;
30  return false;
31  }
32  METHOD(KeyHunt, m_setTeams, void(string sa))
33  {
34  cvar_set("g_keyhunt_teams", sa);
35  }
36  METHOD(KeyHunt, 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))
37  {
38  TC(Gametype, this);
39  returns(menu, _("Point limit:"), 200, 1500, 50, "g_keyhunt_point_limit", "g_keyhunt_teams_override", _("The amount of points needed before the match will end"));
40  }
41 #ifdef CSQC
42  ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH);
43 #endif
44  ATTRIB(KeyHunt, m_legacydefaults, string, "1000 20 3 0");
46 REGISTER_GAMETYPE(KEYHUNT, NEW(KeyHunt));
#define NEW(cname,...)
Definition: oo.qh:105
CLASS(Object) Object
Definition: oo.qh:318
entity() spawn
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
REGISTER_GAMETYPE(KEYHUNT, NEW(KeyHunt))
const int GAMETYPE_FLAG_TEAMPLAY
Definition: mapinfo.qh:19
#define ATTRIB(...)
Definition: oo.qh:136
#define INIT(cname)
Definition: oo.qh:198
#define TC(T, sym)
Definition: _all.inc:82
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
void HUD_Mod_KH(vector pos, vector mySize)
Definition: cl_keyhunt.qc:8
#define ENDCLASS(cname)
Definition: oo.qh:269