Merge branch 'master' into mario/mutator_minstagib
authorMario <mario.mario@y7mail.com>
Thu, 7 Mar 2013 06:22:48 +0000 (17:22 +1100)
committerMario <mario.mario@y7mail.com>
Thu, 7 Mar 2013 06:22:48 +0000 (17:22 +1100)
14 files changed:
1  2 
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/t_items.qc
qcsrc/server/teamplay.qc
qcsrc/server/w_common.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minstanex.qc

@@@ -404,11 -404,14 +404,12 @@@ void PutObserverInServer (void
        DropAllRunes(self);
        MUTATOR_CALLHOOK(MakePlayerObserver);
  
 -      minstagib_stop_countdown(self);
 -
        Portal_ClearAll(self);
+       
        if(self.alivetime)
        {
-               PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+               if(!inWarmupStage)
+                       PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
                self.alivetime = 0;
        }
  
Simple merge
Simple merge
Simple merge
@@@ -618,12 -661,17 +661,12 @@@ void Damage (entity targ, entity inflic
                                        {
                                                if(targ.classname == "player" && targ.deadflag == DEAD_NO)
                                                {
-                                                       teamdamage0 = max(attacker.dmg_team, autocvar_g_teamdamage_threshold);
                                                        attacker.dmg_team = attacker.dmg_team + damage;
-                                                       if(attacker.dmg_team > teamdamage0 && !g_ca)
-                                                               mirrordamage = autocvar_g_mirrordamage * (attacker.dmg_team - teamdamage0);
+                                                       complainteamdamage = attacker.dmg_team - autocvar_g_teamdamage_threshold;
+                                                       if(complainteamdamage > 0 && !g_ca) // FIXME why is g_ca ruled out here? Why not just g_mirrordamage 0 on CA servers?
+                                                               mirrordamage = autocvar_g_mirrordamage * complainteamdamage;
                                                        mirrorforce = autocvar_g_mirrordamage * vlen(force);
 -                                                      if(g_minstagib)
 -                                                      {
 -                                                              if(autocvar_g_friendlyfire == 0)
 -                                                                      damage = 0;
 -                                                      }
 -                                                      else if(g_ca)
 +                                                      if(g_ca)
                                                                damage = 0;
                                                        else
                                                                damage = autocvar_g_friendlyfire * damage;
                                                        if(IsFlying(victim))
                                                                yoda = 1;
  
++<<<<<<< HEAD
 +                                                      if(deathtype & HITTYPE_HEADSHOT)
 +                                                              headshot = 1;
++=======
+                                                       if(g_minstagib)
+                                                       if(victim.items & IT_STRENGTH)
+                                                               yoda = 1;
++>>>>>>> master
                                                }
                                        }
                                }
@@@ -932,11 -939,12 +932,9 @@@ void spawnfunc_worldspawn (void
                modname = cvar_string("g_mod_balance");
        if(cvar_string("g_mod_config") != cvar_defstring("g_mod_config"))
                modname = cvar_string("g_mod_config");
 -      // weird mutators that deserve to count as mod
 -      if(autocvar_g_minstagib)
 -              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);
  
Simple merge
Simple merge
Simple merge
@@@ -600,7 -614,72 +600,7 @@@ float Item_GiveTo(entity item, entity p
        // if nothing happens to player, just return without taking the item
        pickedup = FALSE;
        _switchweapon = FALSE;
-       
 -      if (g_minstagib)
 -      {
 -              float prevcells = player.ammo_cells;
 -
 -              pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
 -              pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, 999, ITEM_MODE_NONE);
 -
 -              if(player.ammo_cells > prevcells)
 -              {
 -                      _switchweapon = TRUE;
 -
 -                      // play some cool sounds ;)
 -                      if (clienttype(player) == CLIENTTYPE_REAL)
 -                      {
 -                              if(player.health <= 5)
 -                                      AnnounceTo(player, "lastsecond");
 -                              else if(player.health < 50)
 -                                      AnnounceTo(player, "narrowly");
 -                      }
 -                      // sound not available
 -                      // else if(item.items == IT_CELLS)
 -                      //      AnnounceTo(player, "ammo");
 -
 -                      if (WEPSET_CONTAINS_EW(item, WEP_MINSTANEX))
 -                              W_GiveWeapon (player, WEP_MINSTANEX);
 -                      player.health = 100;
 -              }
 -
 -              if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
 -              {
 -                      pickedup = TRUE;
 -                      player.items |= it;
 -                      sprint (player, strcat("You got the ^2", item.netname, "\n"));
 -              }
 -
 -              // extralife powerup
 -              if (item.max_health)
 -              {
 -                      pickedup = TRUE;
 -                      // sound not available
 -                      // AnnounceTo(player, "_lives");
 -                      player.armorvalue = bound(player.armorvalue, 999, player.armorvalue + autocvar_g_minstagib_extralives);
 -                      sprint(player, "^3You picked up some extra lives\n");
 -              }
 -
 -              // invis powerup
 -              if (item.strength_finished)
 -              {
 -                      pickedup = TRUE;
 -                      // sound not available
 -                      // AnnounceTo(player, "invisible");
 -                      player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
 -              }
 -
 -              // speed powerup
 -              if (item.invincible_finished)
 -              {
 -                      pickedup = TRUE;
 -                      // sound not available
 -                      // AnnounceTo(player, "speed");
 -                      player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
 -              }
 -      }
 -      else
 -      {
                // in case the player has autoswitch enabled do the following:
                // if the player is using their best weapon before items are given, they
                // probably want to switch to an even better weapon after items are given
Simple merge
@@@ -11,12 -11,9 +11,8 @@@ void W_GiveWeapon (entity e, float wep
        oldself = self;
        self = e;
  
-       if (other.classname == "player")
-       {
-               sprint (other, "You got the ^2");
-               sprint (other, name);
-               sprint (other, "\n");
-       }
 -      if not(g_minstagib)
+       if(other.classname == "player")
+               { Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_WEAPON_GOT, wep); }
  
        self = oldself;
  }
Simple merge
@@@ -14,21 -14,22 +14,21 @@@ void W_MinstaNex_Attack (void
  
        yoda = 0;
        damage_goodhits = 0;
-       headshot = 0;
-       damage_headshotbonus = -1; // no extra damage, just count
        FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
-       damage_headshotbonus = 0;
  
-       if(yoda && flying)
-               AnnounceTo(self, "yoda");
 -      if(g_minstagib)
 +      if(headshot)
        {
 -              if(yoda)
 -                      AnnounceTo(self, "yoda");
 +              AnnounceTo(self, "headshot");
        }
 -      else
 +      if(damage_goodhits && self.minstanex_lasthit)
        {
-               AnnounceTo(self, "impressive");
-               damage_goodhits = 0; // only every second time
+               if(yoda && flying)
+                       AnnounceTo(self, "yoda");
+               if(damage_goodhits && self.minstanex_lasthit)
+               {
+                       AnnounceTo(self, "impressive");
+                       damage_goodhits = 0; // only every second time
+               }
        }
  
        self.minstanex_lasthit = damage_goodhits;