Merge branch 'samual/keepaway' into fruitiex/freezetag_vs_keepaway
authorFruitieX <fruitiex@gmail.com>
Tue, 30 Nov 2010 14:51:41 +0000 (16:51 +0200)
committerFruitieX <fruitiex@gmail.com>
Tue, 30 Nov 2010 14:51:41 +0000 (16:51 +0200)
Conflicts:
defaultXonotic.cfg
qcsrc/client/hud.qc
qcsrc/common/constants.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/util.qc
qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c
qcsrc/server/defs.qh
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/teamplay.qc

16 files changed:
1  2 
defaultXonotic.cfg
qcsrc/client/hud.qc
qcsrc/common/constants.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/util.qc
qcsrc/menu/xonotic/dialog_multiplayer_create.c
qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/teamplay.qc

index 13e5b7d673bb6d3856e9d57fb063f4ac2ec84580,cd16e4029841597fe4fa1e46a70555858e4ffaf3..8a241f75a121dd140669fef42089d9b715e19019
@@@ -616,8 -607,8 +616,10 @@@ set g_cts_respawn_waves 
  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
+ set g_ka_respawn_delay 0
+ set g_ka_respawn_waves 0
  
  // overtime
  seta timelimit_overtime 2 "duration in minutes of one added overtime, added to the timelimit"
index 74fa29c6eb6e203f2517bc3c538d037d1d9d49a6,d518e75491774814356ce613f341145fc3b7750b..f66e417489ba815bcd3fedfe40be2a600739f082
@@@ -4549,7 -4607,7 +4607,7 @@@ void HUD_ModIcons(void
        if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
                return;
  
-       if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && !autocvar__hud_configure)
 -      if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_KEEPAWAY && !autocvar__hud_configure)
++      if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && gametype != GAME_KEEPAWAY && !autocvar__hud_configure)
                return;
  
        active_panel = HUD_PANEL_MODICONS;
                HUD_Mod_NexBall(pos, mySize);
        else if(gametype == GAME_CTS || gametype == GAME_RACE)
                HUD_Mod_Race(pos, mySize);
 -      else if(gametype == GAME_CA)
 +      else if(gametype == GAME_CA || gametype == GAME_FREEZETAG)
                HUD_Mod_CA(pos, mySize);
+       else if(gametype == GAME_KEEPAWAY)
+               HUD_Mod_Keepaway(pos, mySize);
  }
  
  // Draw pressed keys (#11)
index 839f702919e2281942075b31131361e5a2ad3b22,576be7c56832b762ec854735fd5dee82f9c16e9d..b3929c7cda9ffc057e2a6dd495bea87eac8e5d9e
@@@ -34,12 -34,12 +34,13 @@@ const float GAME_LMS                       = 6
  const float GAME_ARENA                = 7;
  const float GAME_KEYHUNT              = 8;
  const float GAME_ASSAULT              = 9;
 -const float GAME_ONSLAUGHT            = 10;
 -const float GAME_RACE                 = 11;
 -const float GAME_NEXBALL              = 12;
 -const float GAME_CTS                  = 13;
 -const float GAME_CA                   = 14;
 -const float GAME_KEEPAWAY             = 15;
 +const float GAME_ONSLAUGHT    = 10;
 +const float GAME_RACE = 11;
 +const float GAME_NEXBALL = 12;
 +const float GAME_CTS = 13;
 +const float GAME_CA           = 14;
 +const float GAME_FREEZETAG            = 15;
++const float GAME_KEEPAWAY             = 16;
  
  const float AS_STRING         = 1;
  const float AS_INT            = 2;
index 895639e54dc25a4d836fd32eb1170cd93757d244,187bf63be8db373576d92ebc1a320f0527d35dcb..35a827f90035438c33b7a6ce60b25d19e5629008
@@@ -407,7 -407,7 +408,8 @@@ 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";
+               case MAPINFO_TYPE_KEEPAWAY:        return "30 20 0";
                default:                           return "";
        }
  }
@@@ -528,7 -536,7 +538,8 @@@ 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";
+               case MAPINFO_TYPE_KEEPAWAY:        return "timelimit=20 pointlimit=30";
                default:                           return "";
        }
  }
@@@ -653,7 -661,7 +664,8 @@@ 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 == "keepaway") return MAPINFO_TYPE_KEEPAWAY;
        else if(t == "all")     return MAPINFO_TYPE_ALL;
        else                    return 0;
  }
@@@ -674,7 -682,7 +686,8 @@@ 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_KEEPAWAY)        return "keepaway";
        else if(t == MAPINFO_TYPE_ALL)             return "all";
        else                                       return "";
  }
@@@ -1139,8 -1147,8 +1152,10 @@@ 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 if(cvar("g_keepaway"))
+               return MAPINFO_TYPE_KEEPAWAY;
        else
                return MAPINFO_TYPE_DEATHMATCH;
  }
@@@ -1168,21 -1176,21 +1183,22 @@@ string MapInfo_GetGameTypeCvar(float t
  {
        switch(t)
        {
 -              case MAPINFO_TYPE_DEATHMATCH:           return "g_dm";
 -              case MAPINFO_TYPE_TEAM_DEATHMATCH:      return "g_tdm";
 -              case MAPINFO_TYPE_DOMINATION:           return "g_domination";
 -              case MAPINFO_TYPE_CTF:                  return "g_ctf";
 -              case MAPINFO_TYPE_RUNEMATCH:            return "g_runematch";
 -              case MAPINFO_TYPE_LMS:                  return "g_lms";
 -              case MAPINFO_TYPE_ARENA:                        return "g_arena";
 -              case MAPINFO_TYPE_CA:                   return "g_ca";
 -              case MAPINFO_TYPE_KEYHUNT:              return "g_kh";
 -              case MAPINFO_TYPE_ASSAULT:              return "g_assault";
 -              case MAPINFO_TYPE_ONSLAUGHT:            return "g_onslaught";
 -              case MAPINFO_TYPE_RACE:                         return "g_race";
 -              case MAPINFO_TYPE_NEXBALL:              return "g_nexball";
 -              case MAPINFO_TYPE_CTS:                  return "g_cts";
 +              case MAPINFO_TYPE_DEATHMATCH: return "g_dm";
 +              case MAPINFO_TYPE_TEAM_DEATHMATCH: return "g_tdm";
 +              case MAPINFO_TYPE_DOMINATION: return "g_domination";
 +              case MAPINFO_TYPE_CTF: return "g_ctf";
 +              case MAPINFO_TYPE_RUNEMATCH: return "g_runematch";
 +              case MAPINFO_TYPE_LMS: return "g_lms";
 +              case MAPINFO_TYPE_ARENA: return "g_arena";
 +              case MAPINFO_TYPE_CA: return "g_ca";
 +              case MAPINFO_TYPE_KEYHUNT: return "g_kh";
 +              case MAPINFO_TYPE_ASSAULT: return "g_assault";
 +              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";
+               case MAPINFO_TYPE_KEEPAWAY:             return "g_keepaway";
                default: return "";
        }
  }
@@@ -1204,7 -1212,7 +1220,8 @@@ 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");
+       cvar_set("g_keepaway",   (t == MAPINFO_TYPE_KEEPAWAY)        ? "1" : "0");
  }
  
  void MapInfo_LoadMap(string s)
index 641de1b8a1e1ad812cd5370713e11fdc0b9ac369,64076e7121a5f91f7d4432b107aeb29cf5d90b6a..12026689b8b3195e21ef40db0079c70fe50dacaf
@@@ -12,8 -12,8 +12,9 @@@ float MAPINFO_TYPE_KEYHUNT            = 1024
  float MAPINFO_TYPE_ASSAULT            = 2048;
  float MAPINFO_TYPE_ONSLAUGHT          = 4096;
  float MAPINFO_TYPE_NEXBALL            = 8192;
 -float MAPINFO_TYPE_KEEPAWAY   = 16384;
 -float MAPINFO_TYPE_ALL                        = 32767; // 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_TYPE_KEEPAWAY   = 32768;
++float MAPINFO_TYPE_ALL                        = 65535; // this has to include all above bits
  
  float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
  
index 76d602dec9bb3849a7976b69d0c537d5504c3073,176ac8fc64660c37037b321de6dc3786049ed54b..44f8751733aab62e96406a890da8cee451966806
@@@ -399,7 -399,7 +399,8 @@@ 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";
+       else if (g == GAME_KEEPAWAY) return "ka";
        return "dm";
  }
  
index 5664eee0abc16b45fefbe39dc12c19a61cddd97f,4abb65ae3f7ebc60ae78ed926f12813066974b03..f3f620d7318bad17a6b00edc8ae5cac4e20f8c0f
@@@ -28,7 -28,7 +28,8 @@@ CLASS(XonoticMapInfoDialog) EXTENDS(Xon
        ATTRIB(XonoticMapInfoDialog, typeRaceLabel, entity, NULL)
        ATTRIB(XonoticMapInfoDialog, typeCTSLabel, entity, NULL)
        ATTRIB(XonoticMapInfoDialog, typeNexballLabel, entity, NULL)
 +      ATTRIB(XonoticMapInfoDialog, typeFreezetagLabel, entity, NULL)
+       ATTRIB(XonoticMapInfoDialog, typeKeepawayLabel, entity, NULL)
  
        ATTRIB(XonoticMapInfoDialog, currentMapIndex, float, 0)
        ATTRIB(XonoticMapInfoDialog, currentMapBSPName, string, string_null)
@@@ -84,7 -84,7 +85,8 @@@ void XonoticMapInfoDialog_loadMapInfo(e
        me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE);
        me.typeCTSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS);
        me.typeNexballLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_NEXBALL);
 +      me.typeFreezetagLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_FREEZETAG);
+       me.typeKeepawayLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY);
  
        MapInfo_ClearTemps();
  }
@@@ -148,8 -148,8 +150,10 @@@ void XonoticMapInfoDialog_fill(entity m
                        me.typeCTSLabel = e;
                me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Nexball"));
                        me.typeNexballLabel = e;
 +              me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Freezetag"));
 +                      me.typeFreezetagLabel = e;
+               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Keepaway"));
+                       me.typeKeepawayLabel = e;
  
        me.gotoRC(me, me.rows - 2, 0);
                me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, ""));
Simple merge
Simple merge
Simple merge
index 29e0cab0244e9359e191fdc390a9543edf3bb71c,cff78f1919ac0347c55eb3022d2912867f01bcae..381543fae3b9aa38110085740fc688e253a85584
@@@ -17,7 -17,7 +17,7 @@@ float require_spawnfunc_prefix; // if t
  
  float ctf_score_value(string parameter);
  
- float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_runematch, g_race, g_nexball, g_cts, g_freezetag;
 -float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_runematch, g_race, g_nexball, g_cts, g_keepaway;
++float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_runematch, g_race, g_nexball, g_cts, g_freezetag, g_keepaway;
  float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_pinata, g_norecoil, g_minstagib_invis_alpha, g_bloodloss;
  float g_warmup_limit;
  float g_warmup_allguns;
Simple merge
index a57db07fd2f256099c587e2839dae87a52ea56af,d0cf0f7213372eea4d7e6560b5fe81f8b95b6246..d9fff4490467b77fd2f146dd68ec4a416882d6bb
@@@ -1,5 -1,5 +1,6 @@@
  MUTATOR_DECLARATION(gamemode_keyhunt);
 +MUTATOR_DECLARATION(gamemode_freezetag);
+ MUTATOR_DECLARATION(gamemode_keepaway);
  
  MUTATOR_DECLARATION(mutator_nix);
  MUTATOR_DECLARATION(mutator_dodging);
index 3c1e4f521f6f2c07226cc01dd513ce3000fb3896,9d40e069259afe3868d44ce74d706556d57754a0..c76395fdbc27df7bdd26371a491fe1da65064276
@@@ -181,7 -181,7 +181,8 @@@ playerstats.q
  
  mutators/base.qc
  mutators/gamemode_keyhunt.qc
 +mutators/gamemode_freezetag.qc
+ mutators/gamemode_keepaway.qc
  mutators/mutator_nix.qc
  mutators/mutator_dodging.qc
  mutators/mutator_rocketflying.qc
index 003ca27427cf81de8baad925733b58759e5ccfaf,7e73bc142f93c76f9ea3a3e1263a9c9c859631b8..7df082c8747475d3b6d8fd0e3fb116ecca519fee
@@@ -101,7 -101,7 +101,8 @@@ 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));
+       cvar_set("g_keepaway", ftos(g_keepaway));
  }
  
  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")));
+               found += (g_keepaway = (!found && (prev != GAME_KEEPAWAY) && cvar("g_keepaway")));
  
                if(found)
                        break;