]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/invasion/invasion.qh
Merge branch 'master' into Lyberta/WaypointIcons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / invasion / invasion.qh
diff --git a/qcsrc/common/gamemodes/gamemode/invasion/invasion.qh b/qcsrc/common/gamemodes/gamemode/invasion/invasion.qh
new file mode 100644 (file)
index 0000000..2195b84
--- /dev/null
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <common/mapinfo.qh>
+
+CLASS(Invasion, Gametype)
+    INIT(Invasion)
+    {
+        this.gametype_init(this, _("Invasion"),"inv","g_invasion",GAMETYPE_FLAG_USEPOINTS,"","pointlimit=50 teams=0 type=0",_("Survive against waves of monsters"));
+    }
+    METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
+    {
+        switch (k) {
+            case "teams":
+                cvar_set("g_invasion_teams", v);
+                return true;
+            case "type":
+                cvar_set("g_invasion_type", v);
+                return true;
+        }
+        return false;
+    }
+    METHOD(Invasion, m_generate_mapinfo, void(Gametype this, string v))
+    {
+        if(v == "invasion_spawnpoint")
+            MapInfo_Map_supportedGametypes |= this.m_flags;
+    }
+    METHOD(Invasion, 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);
+    }
+ENDCLASS(Invasion)
+REGISTER_GAMETYPE(INVASION, NEW(Invasion));