]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/cts/cts.qh
Move gametype registers into their own files, fallback now selects a supported gamety...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / cts / cts.qh
1 #pragma once
2
3 #include <common/mapinfo.qh>
4 #if defined(CSQC)
5         #include <common/gamemodes/gamemode/race/cl_race.qh>
6 #endif
7
8 CLASS(RaceCTS, Gametype)
9     INIT(RaceCTS)
10     {
11         this.gametype_init(this, _("Race CTS"),"cts","g_cts",0,"cloaked","timelimit=20",_("Race for fastest time."));
12     }
13     METHOD(RaceCTS, m_generate_mapinfo, void(Gametype this, string v))
14     {
15         if(v == "target_startTimer")
16             MapInfo_Map_supportedGametypes |= this.m_flags;
17     }
18     METHOD(RaceCTS, m_setTeams, void(string sa))
19     {
20         // this is the skill of the map
21         // not parsed by anything yet
22         // for map databases
23         //  cvar_set("fraglimit", sa);
24     }
25     METHOD(RaceCTS, 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))
26     {
27         TC(Gametype, this);
28         returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
29     }
30 #ifdef CSQC
31     ATTRIB(RaceCTS, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
32 #endif
33     ATTRIB(RaceCTS, m_legacydefaults, string, "20 0 0");
34 ENDCLASS(RaceCTS)
35 REGISTER_GAMETYPE(CTS, NEW(RaceCTS));
36 #define g_cts IS_GAMETYPE(CTS)