Xonotic
ctf.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_CTF(vector pos, vector mySize);
7 void HUD_Mod_CTF_Reset();
8 #endif
11  {
12  this.gametype_init(this, _("Capture the Flag"),"ctf","g_ctf",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PRIORITY,"","timelimit=20 caplimit=10 leadlimit=6",_("Find and bring the enemy flag to your base to capture it, defend your base from the other team"));
13  }
14  METHOD(CaptureTheFlag, m_generate_mapinfo, void(Gametype this, string v))
15  {
16  if(v == "item_flag_team2" || v == "team_CTF_blueflag")
18  }
19  METHOD(CaptureTheFlag, m_isTwoBaseMode, bool())
20  {
21  return true;
22  }
23  METHOD(CaptureTheFlag, m_setTeams, void(string sa))
24  {
25  cvar_set("fraglimit", sa);
26  }
27  METHOD(CaptureTheFlag, 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))
28  {
29  TC(Gametype, this);
30  returns(menu, _("Capture limit:"), 1, 20, 1, "capturelimit_override", string_null, _("The amount of captures needed before the match will end"));
31  }
32 #ifdef CSQC
33  ATTRIB(CaptureTheFlag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CTF);
34  ATTRIB(CaptureTheFlag, m_modicons_reset, void(), HUD_Mod_CTF_Reset);
35 #endif
36  ATTRIB(CaptureTheFlag, m_legacydefaults, string, "300 20 10 0");
39 #define g_ctf IS_GAMETYPE(CTF)
40 
41 #ifdef GAMEQC
42 const int CTF_RED_FLAG_TAKEN = 1;
43 const int CTF_RED_FLAG_LOST = 2;
44 const int CTF_RED_FLAG_CARRYING = 3;
45 const int CTF_BLUE_FLAG_TAKEN = 4;
46 const int CTF_BLUE_FLAG_LOST = 8;
47 const int CTF_BLUE_FLAG_CARRYING = 12;
48 const int CTF_YELLOW_FLAG_TAKEN = 16;
49 const int CTF_YELLOW_FLAG_LOST = 32;
50 const int CTF_YELLOW_FLAG_CARRYING = 48;
51 const int CTF_PINK_FLAG_TAKEN = 64;
52 const int CTF_PINK_FLAG_LOST = 128;
53 const int CTF_PINK_FLAG_CARRYING = 192;
54 const int CTF_NEUTRAL_FLAG_TAKEN = 256;
55 const int CTF_NEUTRAL_FLAG_LOST = 512;
56 const int CTF_NEUTRAL_FLAG_CARRYING = 768;
57 const int CTF_FLAG_NEUTRAL = 2048;
58 const int CTF_SHIELDED = 4096;
59 const int CTF_STALEMATE = 8192;
60 #endif
string string_null
Definition: nil.qh:9
#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
int m_flags
Definition: mapinfo.qh:27
const int GAMETYPE_FLAG_TEAMPLAY
Definition: mapinfo.qh:19
#define ATTRIB(...)
Definition: oo.qh:136
void HUD_Mod_CTF(vector pos, vector mySize)
Definition: cl_ctf.qc:21
#define INIT(cname)
Definition: oo.qh:198
int MapInfo_Map_supportedGametypes
Definition: mapinfo.qh:13
REGISTER_GAMETYPE(CTF, NEW(CaptureTheFlag))
#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
const int GAMETYPE_FLAG_PRIORITY
Definition: mapinfo.qh:22
void HUD_Mod_CTF_Reset()
Definition: cl_ctf.qc:13