Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
tmayhem.qh
Go to the documentation of this file.
1#pragma once
2
5#include <common/mapinfo.qh>
6
9 {
10 this.gametype_init(this, _("Team Mayhem"),"tmayhem","g_tmayhem",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=1500 teams=2 leadlimit=0",_("Compete with your team for the most damage dealt and frags in this chaotic mayhem"));
11 }
12 METHOD(tmayhem, m_parse_mapinfo, bool(string k, string v))
13 {
14 if (!k)
15 {
16 cvar_set("g_tmayhem_teams", cvar_defstring("g_tmayhem_teams"));
17 return true;
18 }
19 switch (k)
20 {
21 case "teams":
22 cvar_set("g_tmayhem_teams", v);
23 return true;
24 }
25 return false;
26 }
27 METHOD(tmayhem, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
28 {
29 return true;
30 }
32 {
33 if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.gametype_flags)){
34 return true;
35 }
36 if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH.gametype_flags)){
37 return true;
38 }
39 return false;
40 }
41 METHOD(tmayhem, m_setTeams, void(string sa))
42 {
43 cvar_set("g_tmayhem_teams", sa);
44 }
45 METHOD(tmayhem, 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))
46 {
47 TC(Gametype, this);
48 returns(menu, _("Point limit:"), 200, 3000, 100, "g_tmayhem_point_limit", "g_tmayhem_teams_override", _("How much score is needed before the match will end"));
49 }
50 ATTRIB(tmayhem, m_legacydefaults, string, "1500 20 2 0");
53#define g_tmayhem IS_GAMETYPE(TEAM_MAYHEM)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
virtual void gametype_init()
Definition mapinfo.qh:117
string m_legacydefaults
Definition tmayhem.qh:50
virtual void m_configuremenu()
Definition tmayhem.qh:45
virtual void m_parse_mapinfo()
Definition tmayhem.qh:12
tmayhem()
Definition tmayhem.qh:8
virtual void m_isAlwaysSupported()
Definition tmayhem.qh:27
virtual void m_isForcedSupported()
Definition tmayhem.qh:31
virtual void m_setTeams()
Definition tmayhem.qh:41
#define TC(T, sym)
Definition _all.inc:82
vector MapInfo_Map_supportedGametypes
Definition mapinfo.qh:13
const int GAMETYPE_FLAG_USEPOINTS
Definition mapinfo.qh:20
#define REGISTER_GAMETYPE(NAME, inst)
Definition mapinfo.qh:149
const int GAMETYPE_FLAG_TEAMPLAY
Definition mapinfo.qh:19
vector gametype_flags
Definition mapinfo.qh:28
void cvar_set(string name, string value)
const string cvar_defstring(string name)
#define NEW(cname,...)
Definition oo.qh:117
#define INIT(cname)
Definition oo.qh:210
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define ATTRIB(...)
Definition oo.qh:148