]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh
Merge branch 'master' into terencehill/glowmod_color_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / freezetag / freezetag.qh
1 #pragma once
2
3 #include <common/mapinfo.qh>
4 #if defined(CSQC)
5         #include <common/gamemodes/gamemode/clanarena/cl_clanarena.qh>
6 #endif
7
8 #ifdef CSQC
9 void HUD_Mod_FreezeTag(vector myPos, vector mySize);
10 void HUD_Mod_FreezeTag_Export(int fh);
11 #endif
12 CLASS(FreezeTag, Gametype)
13     INIT(FreezeTag)
14     {
15         this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill enemies to freeze them, stand next to frozen teammates to revive them; freeze all enemies to win"));
16     }
17     METHOD(FreezeTag, m_parse_mapinfo, bool(string k, string v))
18     {
19         if (!k) {
20             cvar_set("g_freezetag_teams", cvar_defstring("g_freezetag_teams"));
21             return true;
22         }
23         switch (k) {
24             case "teams":
25                 cvar_set("g_freezetag_teams", v);
26                 return true;
27         }
28         return false;
29     }
30     METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
31     {
32         if(spawnpoints >= 8 && diameter > 4096)
33             return true;
34         return false;
35     }
36     METHOD(FreezeTag, m_setTeams, void(string sa))
37     {
38         cvar_set("g_freezetag_teams", sa);
39     }
40     METHOD(FreezeTag, 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))
41     {
42         TC(Gametype, this);
43         returns(menu, _("Frag limit:"),      5,  100,  5, "fraglimit_override",        "g_freezetag_teams_override",   _("The amount of frags needed before the match will end"));
44     }
45 #ifdef CSQC
46     ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_FreezeTag);
47     ATTRIB(FreezeTag, m_modicons_export, void(int fh), HUD_Mod_FreezeTag_Export);
48 #endif
49     ATTRIB(FreezeTag, m_legacydefaults, string, "10 20 0");
50 ENDCLASS(FreezeTag)
51 REGISTER_GAMETYPE(FREEZETAG, NEW(FreezeTag));
52 #define g_freezetag IS_GAMETYPE(FREEZETAG)