]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/ca_arena_freezetag_bugfixes' into terencehill/ca_arena_mutators
authorterencehill <piuntn@gmail.com>
Fri, 8 Feb 2013 13:48:56 +0000 (14:48 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 8 Feb 2013 13:48:56 +0000 (14:48 +0100)
1  2 
qcsrc/client/autocvars.qh
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/teamplay.qc

index ef9a3125c4ea1bcf11da5f0e9cf54130ffb6ece3,49506aefbb691cb2d45ddeaa7008d3c628353572..506764227e7a969b090fcd10f2ab0bb8f315e7b4
@@@ -63,6 -63,9 +63,9 @@@ var float autocvar_cl_reticle = 1
  float autocvar_cl_reticle_item_nex;
  float autocvar_cl_reticle_item_normal;
  float autocvar_cl_reticle_stretch;
+ var float autocvar_cl_spawnzoom = 1;
+ var float autocvar_cl_spawnzoom_speed = 1;
+ var float autocvar_cl_spawnzoom_factor = 2;
  float autocvar_cl_stripcolorcodes;
  var float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
  var float autocvar_cl_vehicle_spiderbot_cross_size = 1;
@@@ -246,9 -249,7 +249,9 @@@ float autocvar_hud_panel_healtharmor_te
  float autocvar_hud_panel_infomessages;
  float autocvar_hud_panel_infomessages_flip;
  float autocvar_hud_panel_modicons;
 +float autocvar_hud_panel_modicons_ca_layout;
  float autocvar_hud_panel_modicons_dom_layout;
 +float autocvar_hud_panel_modicons_freezetag_layout;
  float autocvar_hud_panel_notify;
  float autocvar_hud_panel_notify_fadetime;
  float autocvar_hud_panel_notify_flip;
@@@ -386,6 -387,9 +389,9 @@@ float autocvar_cl_hitsound_antispam_tim
  var float autocvar_cl_eventchase_death = 1;
  var float autocvar_cl_eventchase_distance = 140;
  var float autocvar_cl_eventchase_speed = 1.3;
+ var vector autocvar_cl_eventchase_maxs = '12 12 8';
+ var vector autocvar_cl_eventchase_mins = '-12 -12 -8';
+ var vector autocvar_cl_eventchase_viewoffset = '0 0 20';
  float autocvar_cl_lerpexcess;
  string autocvar__togglezoom;
  float autocvar_cl_damageeffect;
index fc29da99e7e716a4cae1fb192a3ed4045e39c6c4,520488f4d6e2fc3fe7c99f9dd3fa6d29b305537e..4e604cd04aa79b289c29c4f9165197b9dce55f82
@@@ -293,7 -293,7 +293,7 @@@ entity SelectSpawnPoint (float anypoint
        else
        {
                float mindist;
 -              if (arena_roundbased && !g_ca)
 +              if (g_arena && arena_roundbased)
                        mindist = 800;
                else
                        mindist = 100;
@@@ -401,24 -401,6 +401,24 @@@ void PutObserverInServer (void
                WriteEntity(MSG_ONE, self);
        }
  
 +      if(g_lms)
 +      {
 +              // Only if the player cannot play at all
 +              if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
 +                      self.frags = FRAGS_SPECTATOR;
 +              else
 +                      self.frags = FRAGS_LMS_LOSER;
 +      }
 +      else if((g_race && g_race_qualifying) || g_cts)
 +      {
 +              if(PlayerScore_Add(self, SP_RACE_FASTEST, 0))
 +                      self.frags = FRAGS_LMS_LOSER;
 +              else
 +                      self.frags = FRAGS_SPECTATOR;
 +      }
 +      else
 +              self.frags = FRAGS_SPECTATOR;
 +
        DropAllRunes(self);
        MUTATOR_CALLHOOK(MakePlayerObserver);
  
        self.punchvector = '0 0 0';
        self.oldvelocity = self.velocity;
        self.fire_endtime = -1;
 -
 -      if(g_arena)
 -      {
 -              if(self.version_mismatch)
 -              {
 -                      self.frags = FRAGS_SPECTATOR;
 -                      Spawnqueue_Unmark(self);
 -                      Spawnqueue_Remove(self);
 -              }
 -              else
 -              {
 -                      self.frags = FRAGS_LMS_LOSER;
 -                      Spawnqueue_Insert(self);
 -              }
 -      }
 -      else if(g_lms)
 -      {
 -              // Only if the player cannot play at all
 -              if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
 -                      self.frags = FRAGS_SPECTATOR;
 -              else
 -                      self.frags = FRAGS_LMS_LOSER;
 -      }
 -      else if(g_ca)
 -      {
 -              if(self.caplayer)
 -                      self.frags = FRAGS_LMS_LOSER;
 -              else
 -                      self.frags = FRAGS_SPECTATOR;
 -      }
 -      else if((g_race && g_race_qualifying) || g_cts)
 -      {
 -              if(PlayerScore_Add(self, SP_RACE_FASTEST, 0))
 -                      self.frags = FRAGS_LMS_LOSER;
 -              else
 -                      self.frags = FRAGS_SPECTATOR;
 -      }
 -      else
 -              self.frags = FRAGS_SPECTATOR;
  }
  
  .float model_randomizer;
@@@ -632,7 -653,11 +632,7 @@@ Called when a client spawns in the serv
  void PutClientInServer (void)
  {
        if(clienttype(self) == CLIENTTYPE_BOT)
 -      {
                self.classname = "player";
 -              if(g_ca)
 -                      self.caplayer = 1;
 -      }
        else if(clienttype(self) == CLIENTTYPE_REAL)
        {
                msg_entity = self;
                        self.classname = "observer";
        }
  
 -      if((g_arena && !self.spawned) || (g_ca && !allowed_to_spawn))
 -              self.classname = "observer";
 +      MUTATOR_CALLHOOK(PutClientInServer);
  
        if(gameover)
                self.classname = "observer";
  
 -      if(self.classname == "player" && (!g_ca || (g_ca && allowed_to_spawn))) {
 +      if(self.classname == "player") {
                entity spot, oldself;
                float j;
  
                self.lastteleporttime = time; // prevent insane speeds due to changing origin
          self.hud = HUD_NORMAL;
  
 -              if(g_arena)
 -              {
 -                      Spawnqueue_Remove(self);
 -                      Spawnqueue_Mark(self);
 -              }
 -              else if(g_ca)
 -                      self.caplayer = 1;
 -
                self.event_damage = PlayerDamage;
  
                self.bot_attack = TRUE;
@@@ -1229,12 -1263,19 +1229,12 @@@ void ClientKill_TeamChange (float targe
  
  void ClientKill (void)
  {
 -      if (gameover)
 -              return;
 +      if(gameover) return;
 +      if(g_ca && player_count == 1) return;
 +      if(self.player_blocked) return;
 +      if(self.freezetag_frozen) return;
  
 -      if((g_arena || g_ca) && ((champion && champion.classname == "player" && player_count > 1) || player_count == 1)) // don't allow a kill in this case either
 -      {
 -              // do nothing
 -      }
 -    else if(self.freezetag_frozen)
 -    {
 -        // do nothing
 -    }
 -      else
 -              ClientKill_TeamChange(0);
 +      ClientKill_TeamChange(0);
  }
  
  void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
@@@ -1351,9 -1392,6 +1351,6 @@@ void ClientConnect (void
  
        race_PreSpawnObserver();
  
-       //if(g_domination)
-       //      dom_player_join_team(self);
        // identify the right forced team
        if(autocvar_g_campaign)
        {
        else
                stuffcmd(self, "set _teams_available 0\n");
  
 -      if(g_arena || g_ca)
 -      {
 -              self.classname = "observer";
 -              if(g_arena)
 -                      Spawnqueue_Insert(self);
 -      }
 -
        attach_entcs();
  
        bot_relinkplayerlist();
        else if(autocvar_sv_teamnagger && !(autocvar_bot_vs_human && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
                send_CSQC_teamnagger();
  
-       if (g_domination)
-               set_dom_state(self);
        CheatInitClient();
  
        if(!autocvar_g_campaign)
        CSQCMODEL_AUTOINIT();
  
        self.model_randomizer = random();
 -    
 -    if(clienttype(self) != CLIENTTYPE_REAL)
 -        return;
 -        
 -    sv_notice_join();
 -    
 -    MUTATOR_CALLHOOK(ClientConnect);
 +
 +      if(clienttype(self) == CLIENTTYPE_REAL)
 +              sv_notice_join();
 +
 +      MUTATOR_CALLHOOK(ClientConnect);
  }
  /*
  =============
@@@ -1615,6 -1659,12 +1609,6 @@@ void ClientDisconnect (void
  
        bot_relinkplayerlist();
  
 -      if(g_arena)
 -      {
 -              Spawnqueue_Unmark(self);
 -              Spawnqueue_Remove(self);
 -      }
 -
        accuracy_free(self);
        ClientData_Detach();
        PlayerScore_Detach(self);
@@@ -2501,11 -2551,13 +2495,11 @@@ void PlayerPreThink (void
        WarpZone_PlayerPhysics_FixVAngle();
  
        self.stat_game_starttime = game_starttime;
 +      self.stat_round_starttime = round_starttime;
        self.stat_allow_oldnexbeam = autocvar_g_allow_oldnexbeam;
        self.stat_leadlimit = autocvar_leadlimit;
  
 -      if(g_arena || (g_ca && !allowed_to_spawn))
 -              self.stat_respawn_time = 0;
 -      else
 -              self.stat_respawn_time = self.respawn_time;
 +      self.stat_respawn_time = self.respawn_time;
  
        if(frametime)
        {
diff --combined qcsrc/server/g_world.qc
index bbca5e6001a3106f0b0c09dc881c56554199ce8f,c178ecc69001c4d81ad63211a5f98d85c9016eb2..e6193ae46363084bf316d6e15616b55fe386875a
@@@ -667,9 -667,6 +667,6 @@@ void spawnfunc_worldspawn (void
  
        WaypointSprite_Init();
  
-       //if (g_domination)
-       //      dom_init();
        GameLogInit(); // prepare everything
        // NOTE for matchid:
        // changing the logic generating it is okay. But:
        addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon);
        addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon);
        addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);
 +      addstat(STAT_ROUNDSTARTTIME, AS_FLOAT, stat_round_starttime);
        addstat(STAT_ALLOW_OLDNEXBEAM, AS_INT, stat_allow_oldnexbeam);
        Nagger_Init();
  
  
        addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load);
  
 -      if(g_ca)
 -      {
 -              addstat(STAT_REDALIVE, AS_INT, redalive_stat);
 -              addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
 -      }
 -
        // g_movementspeed hack
        addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
        addstat(STAT_MOVEVARS_MAXSPEED, AS_FLOAT, stat_sv_maxspeed);
                modname = "MinstaGib";
        // extra mutators that deserve to count as mod
        MUTATOR_CALLHOOK(SetModname);
-       // weird game types that deserve to count as mod
-       if(g_cts)
-               modname = "CTS";
        // save it for later
        modname = strzone(modname);
  
index bca29eab8e327934d068371bb60c7c50081f3982,4bdcbb28234834629ecc13f8f52767fcd1e4ce90..617155b27286ff046a08ae43bcf6e3a076d8d8bf
@@@ -1,11 -1,10 +1,12 @@@
 +MUTATOR_DECLARATION(gamemode_arena);
 +MUTATOR_DECLARATION(gamemode_ca);
  MUTATOR_DECLARATION(gamemode_keyhunt);
  MUTATOR_DECLARATION(gamemode_freezetag);
  MUTATOR_DECLARATION(gamemode_keepaway);
  MUTATOR_DECLARATION(gamemode_ctf);
  MUTATOR_DECLARATION(gamemode_nexball);
  MUTATOR_DECLARATION(gamemode_onslaught);
+ MUTATOR_DECLARATION(gamemode_domination);
  
  MUTATOR_DECLARATION(mutator_dodging);
  MUTATOR_DECLARATION(mutator_invincibleprojectiles);
diff --combined qcsrc/server/progs.src
index 7c3f23e3e7688efa2129a0bb31501aa1905ac722,340487ae5dde450cc902f644d0a0310722f08136..654b77f2936faf1dc61c0a6673a28dfd4909b07c
@@@ -29,9 -29,8 +29,10 @@@ defs.qh              // Should rename this, it has 
  
  mutators/base.qh
  mutators/mutators.qh
 +mutators/gamemode_arena.qh
 +mutators/gamemode_ca.qh
  mutators/gamemode_ctf.qh
+ mutators/gamemode_domination.qh
  mutators/gamemode_keyhunt.qh // TODO fix this
  mutators/gamemode_keepaway.qh
  mutators/gamemode_nexball.qh 
@@@ -99,6 -98,7 +100,6 @@@ g_subs.q
  g_tetris.qc
  
  runematch.qc
 -arena.qc
  
  g_violence.qc
  g_damage.qc
@@@ -144,7 -144,7 +145,7 @@@ t_plats.q
  antilag.qc
  
  //ctf.qc
- domination.qc
//domination.qc
  //mode_onslaught.qc
  //nexball.qc
  g_hook.qc
@@@ -212,9 -212,8 +213,10 @@@ round_handler.q
  ../common/explosion_equation.qc
  
  mutators/base.qc
 +mutators/gamemode_arena.qc
 +mutators/gamemode_ca.qc
  mutators/gamemode_ctf.qc
+ mutators/gamemode_domination.qc
  mutators/gamemode_freezetag.qc
  mutators/gamemode_keyhunt.qc
  mutators/gamemode_keepaway.qc
diff --combined qcsrc/server/teamplay.qc
index 48ae80951118f938d06b6b29543f5286a1bad1d7,49b733ca31b41ac4748f8d87fc0519c6e032c6a0..98a524bca3cee0c628b94f9e6c52abde0d774ad2
@@@ -52,7 -52,6 +52,6 @@@ string TeamNoName(float t
        return "Neutral Team";
  }
  
- void dom_init();
  void runematch_init();
  void tdm_init();
  void entcs_init();
@@@ -134,7 -133,7 +133,7 @@@ void InitGameplayMode(
                ActivateTeamplay();
                fraglimit_override = autocvar_g_domination_point_limit;
                leadlimit_override = autocvar_g_domination_point_leadlimit;
-               dom_init();
+               MUTATOR_ADD(gamemode_domination);
                have_team_spawns = -1; // request team spawns
        }
  
        {
                fraglimit_override = autocvar_g_arena_point_limit;
                leadlimit_override = autocvar_g_arena_point_leadlimit;
 -              maxspawned = autocvar_g_arena_maxspawned;
 -              if(maxspawned < 2)
 -                      maxspawned = 2;
 -              arena_roundbased = autocvar_g_arena_roundbased;
 +              MUTATOR_ADD(gamemode_arena);
        }
  
        if(g_ca)
                ActivateTeamplay();
                fraglimit_override = autocvar_g_ca_point_limit;
                leadlimit_override = autocvar_g_ca_point_leadlimit;
 -              allowed_to_spawn = TRUE;
 -              precache_sound("ctf/red_capture.wav");
 -              precache_sound("ctf/blue_capture.wav");
 +              MUTATOR_ADD(gamemode_ca);
        }
 +
        if(g_keyhunt)
        {
                ActivateTeamplay();