Xonotic
freezetag.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/mapinfo.qh>
4 #if defined(CSQC)
6 #endif
7 
8 #ifdef CSQC
9 void HUD_Mod_FreezeTag(vector myPos, vector mySize);
10 void HUD_Mod_FreezeTag_Export(int fh);
11 #endif
14  {
15  this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill enemies to freeze them, stand next to frozen teammates to revive them; freeze all enemies to win"));
16  }
17  METHOD(FreezeTag, m_parse_mapinfo, bool(string k, string v))
18  {
19  if (!k) {
20  cvar_set("g_freezetag_teams", cvar_defstring("g_freezetag_teams"));
21  return true;
22  }
23  switch (k) {
24  case "teams":
25  cvar_set("g_freezetag_teams", v);
26  return true;
27  }
28  return false;
29  }
30  METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
31  {
32  if(spawnpoints >= 8 && diameter > 4096)
33  return true;
34  return false;
35  }
36  METHOD(FreezeTag, m_setTeams, void(string sa))
37  {
38  cvar_set("g_freezetag_teams", sa);
39  }
40  METHOD(FreezeTag, 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))
41  {
42  TC(Gametype, this);
43  returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_freezetag_teams_override", _("The amount of frags needed before the match will end"));
44  }
45 #ifdef CSQC
46  ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_FreezeTag);
47  ATTRIB(FreezeTag, m_modicons_export, void(int fh), HUD_Mod_FreezeTag_Export);
48 #endif
49  ATTRIB(FreezeTag, m_legacydefaults, string, "10 20 0");
51 REGISTER_GAMETYPE(FREEZETAG, NEW(FreezeTag));
52 #define g_freezetag IS_GAMETYPE(FREEZETAG)
#define NEW(cname,...)
Definition: oo.qh:105
CLASS(Object) Object
Definition: oo.qh:318
void HUD_Mod_FreezeTag(vector myPos, vector mySize)
Definition: cl_freezetag.qc:10
entity() spawn
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
const int GAMETYPE_FLAG_TEAMPLAY
Definition: mapinfo.qh:19
#define ATTRIB(...)
Definition: oo.qh:136
REGISTER_GAMETYPE(FREEZETAG, NEW(FreezeTag))
#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
#define ENDCLASS(cname)
Definition: oo.qh:269
void HUD_Mod_FreezeTag_Export(int fh)
Definition: cl_freezetag.qc:5