]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qh
Properly support team field on trigger_multiple
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qh
index 28e0cfe237800b209fca58b63ef268b4bad076ef..2dd84596e46991e8f3f75daeb63b524273825d01 100644 (file)
@@ -1,10 +1,5 @@
 #pragma once
 
-bool autocvar_developer_mapper;
-
-#define LOG_MAPWARN(...) MACRO_BEGIN { if (autocvar_developer_mapper) LOG_WARN(__VA_ARGS__); } MACRO_END
-#define LOG_MAPWARNF(...) MACRO_BEGIN { if (autocvar_developer_mapper) LOG_WARNF(__VA_ARGS__); } MACRO_END
-
 #include "util.qh"
 
 // info about a map that MapInfo loads
@@ -42,6 +37,7 @@ CLASS(Gametype, Object)
     ATTRIB(Gametype, gametype_description, string);
 #ifdef CSQC
     ATTRIB(Gametype, m_modicons, void(vector pos, vector mySize));
+    ATTRIB(Gametype, m_modicons_reset, void());
 #endif
 
     ATTRIB(Gametype, m_mutators, string);
@@ -168,6 +164,13 @@ CLASS(RaceCTS, Gametype)
         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);
+    }
 #ifdef CSQC
     ATTRIB(RaceCTS, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
 #endif
@@ -199,12 +202,17 @@ CLASS(TeamDeathmatch, Gametype)
             return true;
         return false;
     }
+    METHOD(TeamDeathmatch, m_setTeams, void(string sa))
+    {
+        cvar_set("g_tdm_teams", sa);
+    }
 ENDCLASS(TeamDeathmatch)
 REGISTER_GAMETYPE(TEAM_DEATHMATCH, NEW(TeamDeathmatch));
 #define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)
 
 #ifdef CSQC
 void HUD_Mod_CTF(vector pos, vector mySize);
+void HUD_Mod_CTF_Reset();
 #endif
 CLASS(CaptureTheFlag, Gametype)
     INIT(CaptureTheFlag)
@@ -220,8 +228,13 @@ CLASS(CaptureTheFlag, Gametype)
     {
         return true;
     }
+    METHOD(CaptureTheFlag, m_setTeams, void(string sa))
+    {
+        cvar_set("fraglimit", sa);
+    }
 #ifdef CSQC
     ATTRIB(CaptureTheFlag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CTF);
+    ATTRIB(CaptureTheFlag, m_modicons_reset, void(), HUD_Mod_CTF_Reset);
 #endif
 ENDCLASS(CaptureTheFlag)
 REGISTER_GAMETYPE(CTF, NEW(CaptureTheFlag));
@@ -254,6 +267,10 @@ CLASS(ClanArena, Gametype)
             return true;
         return false;
     }
+    METHOD(ClanArena, m_setTeams, void(string sa))
+    {
+        cvar_set("g_ca_teams", sa);
+    }
 #ifdef CSQC
     ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
 #endif
@@ -320,6 +337,10 @@ CLASS(KeyHunt, Gametype)
             return true;
         return false;
     }
+    METHOD(KeyHunt, m_setTeams, void(string sa))
+    {
+        cvar_set("g_keyhunt_teams", sa);
+    }
 #ifdef CSQC
     ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH);
 #endif
@@ -384,7 +405,7 @@ REGISTER_GAMETYPE(NEXBALL, NEW(NexBall));
 CLASS(FreezeTag, Gametype)
     INIT(FreezeTag)
     {
-        this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",true,"","timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill enemies to freeze them, stand next to teammates to revive them, freeze the most enemies to win"));
+        this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",true,"","timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill enemies to freeze them, stand next to frozen teammates to revive them; freeze all enemies to win"));
     }
     METHOD(FreezeTag, m_parse_mapinfo, bool(string k, string v))
     {
@@ -405,6 +426,10 @@ CLASS(FreezeTag, Gametype)
             return true;
         return false;
     }
+    METHOD(FreezeTag, m_setTeams, void(string sa))
+    {
+        cvar_set("g_freezetag_teams", sa);
+    }
 #ifdef CSQC
     ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
 #endif
@@ -418,7 +443,7 @@ void HUD_Mod_Keepaway(vector pos, vector mySize);
 CLASS(Keepaway, Gametype)
     INIT(Keepaway)
     {
-        this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",true,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
+        this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",false,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
     }
     METHOD(Keepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
     {
@@ -433,7 +458,7 @@ REGISTER_GAMETYPE(KEEPAWAY, NEW(Keepaway));
 CLASS(Invasion, Gametype)
     INIT(Invasion)
     {
-        this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,"","pointlimit=50 teams=0",_("Survive against waves of monsters"));
+        this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,"","pointlimit=50 teams=0 type=0",_("Survive against waves of monsters"));
     }
     METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
     {
@@ -441,6 +466,9 @@ CLASS(Invasion, Gametype)
             case "teams":
                 cvar_set("g_invasion_teams", v);
                 return true;
+            case "type":
+                cvar_set("g_invasion_type", v);
+                return true;
         }
         return false;
     }