Xonotic
clanarena.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_CA(vector pos, vector mySize);
7 void HUD_Mod_CA_Export(int fh);
8 #endif
11  {
12  this.gametype_init(this, _("Clan Arena"),"ca","g_ca",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill all enemy teammates to win the round"));
13  }
14  METHOD(ClanArena, m_parse_mapinfo, bool(string k, string v))
15  {
16  if (!k) {
17  cvar_set("g_ca_teams", cvar_defstring("g_ca_teams"));
18  return true;
19  }
20  switch (k) {
21  case "teams":
22  cvar_set("g_ca_teams", v);
23  return true;
24  }
25  return false;
26  }
27  METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
28  {
29  if(spawnpoints >= 8 && diameter > 4096)
30  return true;
31  return false;
32  }
33  METHOD(ClanArena, m_setTeams, void(string sa))
34  {
35  cvar_set("g_ca_teams", sa);
36  }
37  METHOD(ClanArena, 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))
38  {
39  TC(Gametype, this);
40  returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_ca_teams_override", _("The amount of frags needed before the match will end"));
41  }
42 #ifdef CSQC
43  ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
44  ATTRIB(ClanArena, m_modicons_export, void(int fh), HUD_Mod_CA_Export);
45 #endif
46  ATTRIB(ClanArena, m_legacydefaults, string, "10 20 0");
49 #define g_ca IS_GAMETYPE(CA)
#define NEW(cname,...)
Definition: oo.qh:105
CLASS(Object) Object
Definition: oo.qh:318
REGISTER_GAMETYPE(CA, NEW(ClanArena))
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
#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_CA(vector myPos, vector mySize)
Definition: cl_clanarena.qc:85
#define ENDCLASS(cname)
Definition: oo.qh:269
void HUD_Mod_CA_Export(int fh)
Definition: cl_clanarena.qc:7