X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapinfo.qh;h=f37e2db060881e23088652e012926e668b731216;hb=4ee2807b2d8f808928ef14b3e814945b3edb4350;hp=03909cf46c1c1b2008197c5bda83a5dc91951ba7;hpb=7dd35df7fcc43c09fec57a8bc60685e6aaea592d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 03909cf46..f37e2db06 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -42,6 +42,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); @@ -57,6 +58,10 @@ CLASS(Gametype, Object) { return false; } + METHOD(Gametype, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + return false; + } METHOD(Gametype, describe, string(Gametype this)) { @@ -98,6 +103,10 @@ CLASS(Deathmatch, Gametype) { this.gametype_init(this, _("Deathmatch"),"dm","g_dm",false,"","timelimit=20 pointlimit=30 leadlimit=0",_("Score as many frags as you can")); } + METHOD(Deathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + return true; + } ENDCLASS(Deathmatch) REGISTER_GAMETYPE(DEATHMATCH, NEW(Deathmatch)); @@ -106,6 +115,10 @@ CLASS(LastManStanding, Gametype) { this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",false,"","timelimit=20 lives=9 leadlimit=0",_("Survive and kill until the enemies have no lives left")); } + METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + return true; + } ENDCLASS(LastManStanding) REGISTER_GAMETYPE(LMS, NEW(LastManStanding)); @@ -156,6 +169,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 @@ -181,12 +201,23 @@ CLASS(TeamDeathmatch, Gametype) } return false; } + METHOD(TeamDeathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + if(spawnpoints >= 8 && diameter > 4096) + 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) @@ -202,8 +233,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)); @@ -230,6 +266,16 @@ CLASS(ClanArena, Gametype) } return false; } + METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + if(spawnpoints >= 8 && diameter > 4096) + 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 @@ -290,11 +336,15 @@ CLASS(KeyHunt, Gametype) } return false; } - METHOD(KeyHunt, m_modicons, void(vector pos, vector mySize)) + METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + if(spawnpoints >= 12 && diameter > 5120) + return true; + return false; + } + METHOD(KeyHunt, m_setTeams, void(string sa)) { - #ifdef CSQC - HUD_Mod_KH(pos, mySize); - #endif + cvar_set("g_keyhunt_teams", sa); } #ifdef CSQC ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH); @@ -375,6 +425,16 @@ CLASS(FreezeTag, Gametype) } return false; } + METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + if(spawnpoints >= 8 && diameter > 4096) + 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 @@ -390,6 +450,10 @@ CLASS(Keepaway, Gametype) { this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",true,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills")); } + METHOD(Keepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + return true; + } #ifdef CSQC ATTRIB(Keepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_Keepaway); #endif