3 #include <common/gamemodes/gamemode/deathmatch/deathmatch.qh>
4 #include <common/mapinfo.qh>
6 CLASS(TeamDeathmatch, Gametype)
9 this.gametype_init(this, _("Team Deathmatch"),"tdm","g_tdm",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PRIORITY,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Help your team score the most frags against the enemy team"));
11 METHOD(TeamDeathmatch, m_parse_mapinfo, bool(string k, string v))
14 cvar_set("g_tdm_teams", cvar_defstring("g_tdm_teams"));
19 cvar_set("g_tdm_teams", v);
24 METHOD(TeamDeathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
26 if(spawnpoints >= 8 && diameter > 3250)
30 METHOD(TeamDeathmatch, m_isForcedSupported, bool(Gametype this))
32 if(cvar("g_tdm_on_dm_maps"))
34 // if this is set, all DM maps support TDM too
35 if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
36 return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
40 METHOD(TeamDeathmatch, m_setTeams, void(string sa))
42 cvar_set("g_tdm_teams", sa);
44 METHOD(TeamDeathmatch, 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))
47 returns(menu, _("Point limit:"), 5, 100, 5, "g_tdm_point_limit", "g_tdm_teams_override", _("The amount of points needed before the match will end"));
49 ATTRIB(TeamDeathmatch, m_legacydefaults, string, "50 20 2 0");
50 ENDCLASS(TeamDeathmatch)
51 REGISTER_GAMETYPE(TEAM_DEATHMATCH, NEW(TeamDeathmatch));
52 #define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)