Xonotic
CaptureTheFlag Class Reference
+ Inheritance diagram for CaptureTheFlag:
+ Collaboration diagram for CaptureTheFlag:

Public Member Functions

 ATTRIB (Gametype, netname, string)
 game type name as in cvar (with g_ prefix) More...
 
 ATTRIB (Gametype, mdl, string)
 game type short name More...
 
 ATTRIB (Gametype, message, string)
 human readable name More...
 
 ATTRIB (Gametype, model2, string)
 game type defaults More...
 
 ATTRIB (Gametype, gametype_description, string)
 game type description More...
 
 ATTRIB (Gametype, m_mutators, string)
 
 CaptureTheFlag ::CaptureTheFlag ()
 
virtual void CaptureTheFlag ::m_configuremenu ()
 
virtual void CaptureTheFlag ::m_generate_mapinfo ()
 
virtual void CaptureTheFlag ::m_isTwoBaseMode ()
 
virtual void CaptureTheFlag ::m_setTeams ()
 
virtual void Gametype ::describe ()
 
virtual void Gametype ::display ()
 
virtual void Gametype ::gametype_init ()
 
virtual void Gametype ::m_configuremenu ()
 
virtual void Gametype ::m_generate_mapinfo ()
 
virtual void Gametype ::m_isAlwaysSupported ()
 
virtual void Gametype ::m_isForcedSupported ()
 
virtual void Gametype ::m_isTwoBaseMode ()
 
virtual void Gametype ::m_parse_mapinfo ()
 

Public Attributes

bool frags = true
 does this gametype use a point limit? More...
 
int items = 0
 game type ID More...
 
bool m_hidelimits = false
 should this gametype display a score limit in the scoreboard? More...
 
int m_id = 0
 
string m_legacydefaults = "300 20 10 0"
 
int m_priority = 0
 game type priority in random selections More...
 
bool m_weaponarena = false
 does this gametype enforce its own weapon arena? More...
 
bool team = false
 does this gametype support teamplay? More...
 

Detailed Description

Definition at line 9 of file ctf.qh.

Member Function Documentation

◆ ATTRIB() [1/6]

Gametype::ATTRIB ( Gametype  ,
netname  ,
string   
)
inherited

game type name as in cvar (with g_ prefix)

◆ ATTRIB() [2/6]

Gametype::ATTRIB ( Gametype  ,
mdl  ,
string   
)
inherited

game type short name

◆ ATTRIB() [3/6]

Gametype::ATTRIB ( Gametype  ,
message  ,
string   
)
inherited

human readable name

◆ ATTRIB() [4/6]

Gametype::ATTRIB ( Gametype  ,
model2  ,
string   
)
inherited

game type defaults

◆ ATTRIB() [5/6]

Gametype::ATTRIB ( Gametype  ,
gametype_description  ,
string   
)
inherited

game type description

◆ ATTRIB() [6/6]

Gametype::ATTRIB ( Gametype  ,
m_mutators  ,
string   
)
inherited

◆ CaptureTheFlag ::CaptureTheFlag()

CaptureTheFlag::CaptureTheFlag ::CaptureTheFlag ( )
inline

Definition at line 10 of file ctf.qh.

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  }
const int GAMETYPE_FLAG_TEAMPLAY
Definition: mapinfo.qh:19
const int GAMETYPE_FLAG_USEPOINTS
Definition: mapinfo.qh:20
const int GAMETYPE_FLAG_PRIORITY
Definition: mapinfo.qh:22

◆ CaptureTheFlag ::m_configuremenu()

virtual void CaptureTheFlag::CaptureTheFlag ::m_configuremenu ( )
inlinevirtual

Definition at line 27 of file ctf.qh.

References TC.

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  }
string string_null
Definition: nil.qh:9
#define TC(T, sym)
Definition: _all.inc:82

◆ CaptureTheFlag ::m_generate_mapinfo()

virtual void CaptureTheFlag::CaptureTheFlag ::m_generate_mapinfo ( )
inlinevirtual

Definition at line 14 of file ctf.qh.

References m_flags, and MapInfo_Map_supportedGametypes.

15  {
16  if(v == "item_flag_team2" || v == "team_CTF_blueflag")
18  }
int m_flags
Definition: mapinfo.qh:27
int MapInfo_Map_supportedGametypes
Definition: mapinfo.qh:13
vector v
Definition: ent_cs.qc:116

◆ CaptureTheFlag ::m_isTwoBaseMode()

virtual void CaptureTheFlag::CaptureTheFlag ::m_isTwoBaseMode ( )
inlinevirtual

Definition at line 19 of file ctf.qh.

20  {
21  return true;
22  }

◆ CaptureTheFlag ::m_setTeams()

virtual void CaptureTheFlag::CaptureTheFlag ::m_setTeams ( )
inlinevirtual

Definition at line 23 of file ctf.qh.

References cvar_set().

24  {
25  cvar_set("fraglimit", sa);
26  }
+ Here is the call graph for this function:

◆ Gametype ::describe()

virtual void Gametype::Gametype ::describe ( )
inlinevirtualinherited

Definition at line 89 of file mapinfo.qh.

References TC.

90  {
91  TC(Gametype, this);
92  return this.gametype_description;
93  }
#define TC(T, sym)
Definition: _all.inc:82

◆ Gametype ::display()

virtual void Gametype::Gametype ::display ( )
inlinevirtualinherited

Definition at line 95 of file mapinfo.qh.

References strcat(), and TC.

96  {
97  TC(Gametype, this);
98  returns(this.message, strcat("gametype_", this.mdl));
99  }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
string message
Definition: powerups.qc:19
#define TC(T, sym)
Definition: _all.inc:82
+ Here is the call graph for this function:

◆ Gametype ::gametype_init()

virtual void Gametype::Gametype ::gametype_init ( )
inlinevirtualinherited

Definition at line 101 of file mapinfo.qh.

References cons(), ENDCLASS, GAMETYPE_FLAG_HIDELIMITS, GAMETYPE_FLAG_PREFERRED, GAMETYPE_FLAG_PRIORITY, GAMETYPE_FLAG_TEAMPLAY, GAMETYPE_FLAG_USEPOINTS, GAMETYPE_FLAG_WEAPONARENA, m_flags, MAPINFO_TYPE_ALL, NULL, REGISTER_REGISTRY, REGISTRY, REGISTRY_CHECK, REGISTRY_DEFINE_GET, and REGISTRY_SORT().

102  {
103  this.netname = g_name;
104  this.mdl = sname;
105  this.message = hname;
106  this.team = (gflags & GAMETYPE_FLAG_TEAMPLAY);
107  this.m_mutators = cons(sname, mutators);
108  this.model2 = defaults;
109  this.gametype_description = gdescription;
110  this.frags = (gflags & GAMETYPE_FLAG_USEPOINTS);
111  this.m_priority = ((gflags & GAMETYPE_FLAG_PREFERRED) ? 2 : ((gflags & GAMETYPE_FLAG_PRIORITY) ? 1 : 0));
112  this.m_hidelimits = (gflags & GAMETYPE_FLAG_HIDELIMITS);
113  this.m_weaponarena = (gflags & GAMETYPE_FLAG_WEAPONARENA);
114 
115  // same as `1 << m_id`
116  MAPINFO_TYPE_ALL |= this.items = this.m_flags = (MAPINFO_TYPE_ALL + 1);
117  }
int MAPINFO_TYPE_ALL
Definition: mapinfo.qh:26
const int GAMETYPE_FLAG_HIDELIMITS
Definition: mapinfo.qh:23
bool m_hidelimits
should this gametype display a score limit in the scoreboard?
Definition: mapinfo.qh:44
string netname
Definition: powerups.qc:20
const int GAMETYPE_FLAG_WEAPONARENA
Definition: mapinfo.qh:24
int m_flags
Definition: mapinfo.qh:27
const int GAMETYPE_FLAG_TEAMPLAY
Definition: mapinfo.qh:19
bool frags
does this gametype use a point limit?
Definition: mapinfo.qh:42
string message
Definition: powerups.qc:19
const int GAMETYPE_FLAG_PREFERRED
Definition: mapinfo.qh:21
bool team
does this gametype support teamplay?
Definition: mapinfo.qh:40
bool m_weaponarena
does this gametype enforce its own weapon arena?
Definition: mapinfo.qh:46
const int GAMETYPE_FLAG_USEPOINTS
Definition: mapinfo.qh:20
ERASEABLE string cons(string a, string b)
Definition: string.qh:257
const int GAMETYPE_FLAG_PRIORITY
Definition: mapinfo.qh:22
int m_priority
game type priority in random selections
Definition: mapinfo.qh:52
int items
game type ID
Definition: mapinfo.qh:32
+ Here is the call graph for this function:

◆ Gametype ::m_configuremenu()

virtual void Gametype::Gametype ::m_configuremenu ( )
inlinevirtualinherited

Definition at line 83 of file mapinfo.qh.

References TC.

84  {
85  TC(Gametype, this);
86  returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", string_null, _("The amount of frags needed before the match will end"));
87  }
string string_null
Definition: nil.qh:9
#define TC(T, sym)
Definition: _all.inc:82

◆ Gametype ::m_generate_mapinfo()

virtual void Gametype::Gametype ::m_generate_mapinfo ( )
inlinevirtualinherited

Definition at line 67 of file mapinfo.qh.

References TC.

68  {
69  TC(Gametype, this);
70  }
#define TC(T, sym)
Definition: _all.inc:82

◆ Gametype ::m_isAlwaysSupported()

virtual void Gametype::Gametype ::m_isAlwaysSupported ( )
inlinevirtualinherited

Definition at line 75 of file mapinfo.qh.

76  {
77  return false;
78  }

◆ Gametype ::m_isForcedSupported()

virtual void Gametype::Gametype ::m_isForcedSupported ( )
inlinevirtualinherited

Definition at line 79 of file mapinfo.qh.

80  {
81  return false;
82  }

◆ Gametype ::m_isTwoBaseMode()

virtual void Gametype::Gametype ::m_isTwoBaseMode ( )
inlinevirtualinherited

Definition at line 71 of file mapinfo.qh.

72  {
73  return false;
74  }

◆ Gametype ::m_parse_mapinfo()

virtual void Gametype::Gametype ::m_parse_mapinfo ( )
inlinevirtualinherited

Definition at line 63 of file mapinfo.qh.

64  {
65  return false;
66  }

Member Data Documentation

◆ frags

bool Gametype::frags = true
inherited

does this gametype use a point limit?

Definition at line 42 of file mapinfo.qh.

Referenced by _MapInfo_Map_ApplyGametype().

◆ items

int Gametype::items = 0
inherited

game type ID

Definition at line 32 of file mapinfo.qh.

◆ m_hidelimits

bool Gametype::m_hidelimits = false
inherited

should this gametype display a score limit in the scoreboard?

Definition at line 44 of file mapinfo.qh.

◆ m_id

int Gametype::m_id = 0
inherited

Definition at line 30 of file mapinfo.qh.

◆ m_legacydefaults

string CaptureTheFlag::m_legacydefaults = "300 20 10 0"

Definition at line 36 of file ctf.qh.

◆ m_priority

int Gametype::m_priority = 0
inherited

game type priority in random selections

Definition at line 52 of file mapinfo.qh.

◆ m_weaponarena

bool Gametype::m_weaponarena = false
inherited

does this gametype enforce its own weapon arena?

Definition at line 46 of file mapinfo.qh.

◆ team

bool Gametype::team = false
inherited

does this gametype support teamplay?

Definition at line 40 of file mapinfo.qh.

Referenced by _MapInfo_GetTeamPlayBool().


The documentation for this class was generated from the following file: