]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qh
e91c7780ca63f5fbc3943ac4c9a277be9aa91a1d
[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 int HUD_Scores_CA(int team);
9 #endif
10 CLASS(ClanArena, Gametype)
11     INIT(ClanArena)
12     {
13         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"));
14     }
15     METHOD(ClanArena, m_parse_mapinfo, bool(string k, string v))
16     {
17         if (!k) {
18             cvar_set("g_ca_teams", cvar_defstring("g_ca_teams"));
19             return true;
20         }
21         switch (k) {
22             case "teams":
23                 cvar_set("g_ca_teams", v);
24                 return true;
25         }
26         return false;
27     }
28     METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
29     {
30         if(spawnpoints >= 8 && diameter > 3250)
31             return true;
32         return false;
33     }
34     METHOD(ClanArena, m_setTeams, void(string sa))
35     {
36         cvar_set("g_ca_teams", sa);
37     }
38     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))
39     {
40         TC(Gametype, this);
41         returns(menu, _("Frag limit:"),      5,  100,  5, "fraglimit_override",        "g_ca_teams_override",          _("The amount of frags needed before the match will end"));
42     }
43 #ifdef CSQC
44     //ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
45     //ATTRIB(ClanArena, m_modicons_export, void(int fh), HUD_Mod_CA_Export);
46     ATTRIB(ClanArena, m_modscores, int(int team), HUD_Scores_CA);
47 #endif
48     ATTRIB(ClanArena, m_legacydefaults, string, "10 20 0");
49 ENDCLASS(ClanArena)
50 REGISTER_GAMETYPE(CA, NEW(ClanArena));
51 #define g_ca IS_GAMETYPE(CA)