]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix starting the gametype
authorFruitieX <fruitiex@gmail.com>
Mon, 15 Nov 2010 21:49:35 +0000 (23:49 +0200)
committerFruitieX <fruitiex@gmail.com>
Mon, 15 Nov 2010 21:49:35 +0000 (23:49 +0200)
defaultXonotic.cfg
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/util.qc
qcsrc/server/arena.qc
qcsrc/server/teamplay.qc

index e1670b137608947ec0e11a042b37f59968d9964a..b5958a8ab2511eea80fd76d1d741f9c2a3939551 100644 (file)
@@ -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"
 
 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
 // 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_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"
 
 // overtime
 seta timelimit_overtime 2 "duration in minutes of one added overtime, added to the timelimit"
index 5192b75ac24ea37fd4a67cc72bc885b80dd3ea60..895639e54dc25a4d836fd32eb1170cd93757d244 100644 (file)
@@ -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;
 
                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)
                        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_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 "";
        }
 }
                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_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 "";
        }
 }
                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 == "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;
 }
        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_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 "";
 }
        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;
                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;
 }
        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_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 "";
        }
                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_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)
 }
 
 void MapInfo_LoadMap(string s)
index 1fcc0dc662783ebd056281a5732a9d75ca98a31f..641de1b8a1e1ad812cd5370713e11fdc0b9ac369 100644 (file)
@@ -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_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
 
 
 float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
 
index 42be955f0c48d0b851c56077442b4c3cfecb9f59..2618d09fd69bca0bf4cea60ddf05918a8c5ccd3f 100644 (file)
@@ -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_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";
 }
 
        return "dm";
 }
 
index b80a2830cd9748383a6b604ac4da56e887f7400d..2fad0959774bf2345cd3fb722ad3a902aaf952de 100644 (file)
@@ -39,6 +39,10 @@ void reset_map(float dorespawn)
                warmup = time + cvar("g_ca_warmup");
                allowed_to_spawn = 1;
        }
                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;
 
        lms_lowest_lives = 999;
        lms_next_place = player_count;
@@ -364,6 +368,12 @@ void Spawnqueue_Check()
                        next_round = 0;
                        reset_map(TRUE);
                }
                        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)
        } else { // arena
                //extend next_round if it isn't set yet and only 1 player is spawned
                if(!next_round)
index 78891a29d2f877182ded6a22883f26c6ddeeba23..003ca27427cf81de8baad925733b58759e5ccfaf 100644 (file)
@@ -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_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()
 }
 
 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_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;
 
                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");
                        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");
        }
                else
                        error("Too few teams available for team deathmatch\n");
        }