]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qh
Merge branch 'terencehill/noclip_death_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / clanarena / clanarena.qh
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
9 CLASS(ClanArena, Gametype)
10     INIT(ClanArena)
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");
47 ENDCLASS(ClanArena)
48 REGISTER_GAMETYPE(CA, NEW(ClanArena));
49 #define g_ca IS_GAMETYPE(CA)