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