From 1c948fe6e092f455e0aa1afbcbee65f00d89afe8 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Mon, 15 Nov 2010 23:49:35 +0200 Subject: [PATCH] fix starting the gametype --- defaultXonotic.cfg | 9 +++++++++ qcsrc/common/mapinfo.qc | 9 +++++++++ qcsrc/common/mapinfo.qh | 3 ++- qcsrc/common/util.qc | 1 + qcsrc/server/arena.qc | 10 ++++++++++ qcsrc/server/teamplay.qc | 4 ++++ 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e1670b1376..b5958a8ab2 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -602,6 +602,13 @@ seta g_nexball_goalleadlimit -1 "Nexball goal lead limit overriding the mapinfo seta g_ctf_win_mode 0 "0: captures only, 1: captures, then points, 2: points only" seta g_ctf_ignore_frags 0 "1: regular frags give no points" +set g_freezetag 0 "Freeze Tag: Freeze the opposing team(s) to win, unfreeze teammates by standing next to them" +seta g_freezetag_warmup 5 "Time players get to run around before the round starts" +seta g_freezetag_point_limit -1 "Freeze Tag point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" +seta g_freezetag_point_leadlimit -1 "Freeze Tag point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" +seta g_freezetag_revive_time 5 "Time it takes to revive a frozen teammate" +seta g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him" + // 50% of the spawns shall be far away from any players set g_spawn_furthest 0.5 // respawn delay @@ -641,6 +648,8 @@ set g_cts_respawn_waves 0 set g_cts_respawn_delay 0.25 set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts" set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible" +set g_freezetag_respawn_waves 0 +set g_freezetag_respawn_delay 0.25 // overtime seta timelimit_overtime 2 "duration in minutes of one added overtime, added to the timelimit" diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 5192b75ac2..895639e54d 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -350,6 +350,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp if(spawnpoints >= 8 && diameter > 4096) { MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_TEAM_DEATHMATCH; + MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_FREEZETAG; MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CA; } if( diameter < 4096) @@ -406,6 +407,7 @@ string _MapInfo_GetDefault(float t) case MAPINFO_TYPE_ONSLAUGHT: return "20 0"; case MAPINFO_TYPE_NEXBALL: return "5 20 0"; case MAPINFO_TYPE_CTS: return "20 0 0"; + case MAPINFO_TYPE_FREEZETAG: return "10 20 0"; default: return ""; } } @@ -526,6 +528,7 @@ string _MapInfo_GetDefaultEx(float t) case MAPINFO_TYPE_ONSLAUGHT: return "timelimit=20"; case MAPINFO_TYPE_NEXBALL: return "timelimit=20 pointlimit=5 leadlimit=0"; case MAPINFO_TYPE_CTS: return "timelimit=20 skill=-1"; + case MAPINFO_TYPE_FREEZETAG: return "timelimit=20 pointlimit=10 teams=2 leadlimit=0"; default: return ""; } } @@ -650,6 +653,7 @@ float MapInfo_Type_FromString(string t) else if(t == "rc") return MAPINFO_TYPE_RACE; else if(t == "nexball") return MAPINFO_TYPE_NEXBALL; else if(t == "cts") return MAPINFO_TYPE_CTS; + else if(t == "freezetag") return MAPINFO_TYPE_FREEZETAG; else if(t == "all") return MAPINFO_TYPE_ALL; else return 0; } @@ -670,6 +674,7 @@ string MapInfo_Type_ToString(float t) else if(t == MAPINFO_TYPE_RACE) return "rc"; else if(t == MAPINFO_TYPE_NEXBALL) return "nexball"; else if(t == MAPINFO_TYPE_CTS) return "cts"; + else if(t == MAPINFO_TYPE_FREEZETAG) return "freezetag"; else if(t == MAPINFO_TYPE_ALL) return "all"; else return ""; } @@ -1134,6 +1139,8 @@ float MapInfo_CurrentGametype() return MAPINFO_TYPE_NEXBALL; else if(cvar("g_cts")) return MAPINFO_TYPE_CTS; + else if(cvar("g_freezetag")) + return MAPINFO_TYPE_FREEZETAG; else return MAPINFO_TYPE_DEATHMATCH; } @@ -1174,6 +1181,7 @@ string MapInfo_GetGameTypeCvar(float t) case MAPINFO_TYPE_ONSLAUGHT: return "g_onslaught"; case MAPINFO_TYPE_RACE: return "g_race"; case MAPINFO_TYPE_NEXBALL: return "g_nexball"; + case MAPINFO_TYPE_FREEZETAG: return "g_freezetag"; case MAPINFO_TYPE_CTS: return "g_cts"; default: return ""; } @@ -1196,6 +1204,7 @@ void MapInfo_SwitchGameType(float t) cvar_set("g_race", (t == MAPINFO_TYPE_RACE) ? "1" : "0"); cvar_set("g_nexball", (t == MAPINFO_TYPE_NEXBALL) ? "1" : "0"); cvar_set("g_cts", (t == MAPINFO_TYPE_CTS) ? "1" : "0"); + cvar_set("g_freezetag", (t == MAPINFO_TYPE_FREEZETAG) ? "1" : "0"); } void MapInfo_LoadMap(string s) diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 1fcc0dc662..641de1b8a1 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -12,7 +12,8 @@ float MAPINFO_TYPE_KEYHUNT = 1024; float MAPINFO_TYPE_ASSAULT = 2048; float MAPINFO_TYPE_ONSLAUGHT = 4096; float MAPINFO_TYPE_NEXBALL = 8192; -float MAPINFO_TYPE_ALL = 16383; // this has to include all above bits +float MAPINFO_TYPE_FREEZETAG = 16384; +float MAPINFO_TYPE_ALL = 32767; // this has to include all above bits float MAPINFO_FEATURE_WEAPONS = 1; // not defined for minstagib-only maps diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 42be955f0c..2618d09fd6 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -439,6 +439,7 @@ string GametypeNameFromType(float g) else if (g == GAME_RACE) return "rc"; else if (g == GAME_NEXBALL) return "nexball"; else if (g == GAME_CTS) return "cts"; + else if (g == GAME_FREEZETAG) return "freezetag"; return "dm"; } diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc index b80a2830cd..2fad095977 100644 --- a/qcsrc/server/arena.qc +++ b/qcsrc/server/arena.qc @@ -39,6 +39,10 @@ void reset_map(float dorespawn) warmup = time + cvar("g_ca_warmup"); allowed_to_spawn = 1; } + else if(g_freezetag) + { + warmup = time + cvar("g_freezetag_warmup"); + } lms_lowest_lives = 999; lms_next_place = player_count; @@ -364,6 +368,12 @@ void Spawnqueue_Check() next_round = 0; reset_map(TRUE); } + } else if(g_freezetag) { + if((next_round && next_round < time)) + { + next_round = 0; + reset_map(TRUE); + } } else { // arena //extend next_round if it isn't set yet and only 1 player is spawned if(!next_round) diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 78891a29d2..003ca27427 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -101,6 +101,7 @@ void WriteGameCvars() cvar_set("g_race", ftos(g_race)); cvar_set("g_nexball", ftos(g_nexball)); cvar_set("g_cts", ftos(g_cts)); + cvar_set("g_freezetag", ftos(g_freezetag)); } void ReadGameCvars() @@ -127,6 +128,7 @@ void ReadGameCvars() found += (g_race = (!found && (prev != GAME_RACE) && cvar("g_race"))); found += (g_nexball = (!found && (prev != GAME_NEXBALL) && cvar("g_nexball"))); found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts"))); + found += (g_freezetag = (!found && (prev != GAME_FREEZETAG) && cvar("g_freezetag"))); if(found) break; @@ -826,6 +828,8 @@ float FindSmallestTeam(entity pl, float ignore_pl) error("Too few teams available for ctf\n"); else if(g_keyhunt) error("Too few teams available for key hunt\n"); + else if(g_freezetag) + error("Too few teams available for freeze tag\n"); else error("Too few teams available for team deathmatch\n"); } -- 2.39.2