]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/cts/cts.qh
Merge branch 'master' into Lyberta/WaypointIcons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / cts / cts.qh
diff --git a/qcsrc/common/gamemodes/gamemode/cts/cts.qh b/qcsrc/common/gamemodes/gamemode/cts/cts.qh
new file mode 100644 (file)
index 0000000..c59b73c
--- /dev/null
@@ -0,0 +1,36 @@
+#pragma once
+
+#include <common/mapinfo.qh>
+#if defined(CSQC)
+       #include <common/gamemodes/gamemode/race/cl_race.qh>
+#endif
+
+CLASS(RaceCTS, Gametype)
+    INIT(RaceCTS)
+    {
+        this.gametype_init(this, _("Race CTS"),"cts","g_cts",0,"cloaked","timelimit=20",_("Race for fastest time."));
+    }
+    METHOD(RaceCTS, m_generate_mapinfo, void(Gametype this, string v))
+    {
+        if(v == "target_startTimer")
+            MapInfo_Map_supportedGametypes |= this.m_flags;
+    }
+    METHOD(RaceCTS, m_setTeams, void(string sa))
+    {
+        // this is the skill of the map
+        // not parsed by anything yet
+        // for map databases
+        //  cvar_set("fraglimit", sa);
+    }
+    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))
+    {
+        TC(Gametype, this);
+        returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
+    }
+#ifdef CSQC
+    ATTRIB(RaceCTS, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
+#endif
+    ATTRIB(RaceCTS, m_legacydefaults, string, "20 0 0");
+ENDCLASS(RaceCTS)
+REGISTER_GAMETYPE(CTS, NEW(RaceCTS));
+#define g_cts IS_GAMETYPE(CTS)