]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/divVerent/fruitbalance' into fruitiex/fruitbalance
authorFruitieX <rasse@rasse-lappy.localdomain>
Sat, 24 Jul 2010 12:48:08 +0000 (15:48 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sat, 24 Jul 2010 12:48:08 +0000 (15:48 +0300)
1  2 
qcsrc/client/hud.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_grenadelauncher.qc

diff --combined qcsrc/client/hud.qc
index c5cc244f9fa3b6baad33dd29aca210641551dbc4,60a510af213226684c67ed4021341c0aaeb5818b..b348ff0d7fc601984a1ea2c9934a71bbcf6a13a3
@@@ -421,13 -421,13 +421,13 @@@ void HUD_Panel_ExportCfg(string cfgname
        if(fh >= 0)
        {
                fputs(fh, strcat("seta hud_skin \"", cvar_string("hud_skin"), "\"", "\n"));
 -              fputs(fh, strcat("seta hud_bg \"", cvar_string("hud_bg"), "\"", "\n"));
 -              fputs(fh, strcat("seta hud_bg_color \"", cvar_string("hud_bg_color"), "\"", "\n"));
 -              fputs(fh, strcat("seta hud_bg_color_team \"", cvar_string("hud_bg_color_team"), "\"", "\n"));
 -              fputs(fh, strcat("seta hud_bg_alpha \"", cvar_string("hud_bg_alpha"), "\"", "\n"));
 -              fputs(fh, strcat("seta hud_bg_border \"", cvar_string("hud_bg_border"), "\"", "\n"));
 -              fputs(fh, strcat("seta hud_bg_padding \"", cvar_string("hud_bg_padding"), "\"", "\n"));
 -              fputs(fh, strcat("seta hud_fg_alpha \"", cvar_string("hud_fg_alpha"), "\"", "\n"));
 +              fputs(fh, strcat("seta hud_panel_bg \"", cvar_string("hud_panel_bg"), "\"", "\n"));
 +              fputs(fh, strcat("seta hud_panel_bg_color \"", cvar_string("hud_panel_bg_color"), "\"", "\n"));
 +              fputs(fh, strcat("seta hud_panel_bg_color_team \"", cvar_string("hud_panel_bg_color_team"), "\"", "\n"));
 +              fputs(fh, strcat("seta hud_panel_bg_alpha \"", cvar_string("hud_panel_bg_alpha"), "\"", "\n"));
 +              fputs(fh, strcat("seta hud_panel_bg_border \"", cvar_string("hud_panel_bg_border"), "\"", "\n"));
 +              fputs(fh, strcat("seta hud_panel_bg_padding \"", cvar_string("hud_panel_bg_padding"), "\"", "\n"));
 +              fputs(fh, strcat("seta hud_panel_fg_alpha \"", cvar_string("hud_panel_fg_alpha"), "\"", "\n"));
                fputs(fh, "\n");
  
                fputs(fh, strcat("seta hud_dock \"", cvar_string("hud_dock"), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_complainbubble_color_unavailable \"", cvar_string(strcat("hud_panel_", panel_name, "_complainbubble_color_unavailable")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_ammo_color \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_color")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_ammo_alpha \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_alpha")), "\"", "\n"));
 -                                      fputs(fh, strcat("seta hud_panel_", panel_name, "_aspect \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_alpha")), "\"", "\n"));
 +                                      fputs(fh, strcat("seta hud_panel_", panel_name, "_aspect \"", cvar_string(strcat("hud_panel_", panel_name, "_aspect")), "\"", "\n"));
                                        break;
                                case HUD_PANEL_AMMO:
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_onlycurrent \"", cvar_string(strcat("hud_panel_", panel_name, "_onlycurrent")), "\"", "\n"));
@@@ -1380,6 -1380,10 +1380,6 @@@ float GetAmmoTypeForWep(float i
        }
  }
  
 -#define acc_color(i) stov(cvar_string(strcat("hud_panel_weapons_accuracy_color", ftos(i))))
 -#define MAX_ACCURACY_LEVELS 10
 -float acc_lev[MAX_ACCURACY_LEVELS];
 -
  void HUD_Weapons(void)
  {
        if(!autocvar_hud_panel_weapons && !autocvar__hud_configure)
        vector wpnpos;
        vector wpnsize;
  
 -      float acc_levels;
 -      if(autocvar_hud_panel_weapons_accuracy && !(gametype == GAME_RACE || gametype == GAME_CTS))
 -      {
 -              acc_levels = tokenize(cvar_string("hud_panel_weapons_accuracy_color_levels"));
 -              if (acc_levels > MAX_ACCURACY_LEVELS)
 -                      acc_levels = MAX_ACCURACY_LEVELS;
 -
 -              for (i = 0; i < acc_levels; ++i)
 -                      acc_lev[i] = stof(argv(i));
 -      }
 -
        for(i = 0; i < weapon_cnt; ++i)
        {
                wpnpos = pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows);
@@@ -2397,7 -2412,7 +2397,7 @@@ void HUD_KillNotify(string s1, string s
                if(WEP_VALID(w)) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
                        if (alsoprint)
-                               print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
+                               print("^1", sprintf(Weapon_SuicideMessage(type), strcat(s1, "^1")), "\n");
                } else if (type == DEATH_KILL) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_KILL);
                        if (alsoprint)
                
                if (stof(s2) > 2) // killcount > 2
                        print ("^1",s1,"^1 ended it all after a ",s2," kill spree\n");
 +      } else if(msg == MSG_KILL_MELEE) { // handle melee types separately
 +              if(type == KILL_FRAG_GAUNTLET) {
 +                      if(alsoprint)
 +                      {
 +                              if(gentle) {
 +                                      print ("^1", s1, "^1 got too close to", s2, "^1's gauntlet\n");
 +                              } else {
 +                                      print ("^1", s1, "^1 was cut in half by", s2, "^1's gauntlet\n");
 +                              }
 +                      }
 +              }
 +              else if(type == KILL_FRAG_SHOTGUN_MELEE)
 +              {
 +                      if(alsoprint)
 +                      {
 +                              print ("^7", s2, "^7 slapped ", s1, "^7 around a bit with a large ^2shotgun\n");
 +                      }
 +              }
 +              HUD_KillNotify_Push(s1, s2, 1, type);
        } else if(msg == MSG_KILL) {
                w = DEATH_WEAPONOF(type);
                if(WEP_VALID(w)) {
                        HUD_KillNotify_Push(s2, s1, 1, w);
                        if (alsoprint)
-                               print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+                               print("^1", sprintf(Weapon_KillMessage(type), strcat(s2, "^1"), strcat(s1, "^1")), "\n"); // default order: victim, killer
                }
                else if(type == KILL_TEAM_RED || type == KILL_TEAM_BLUE || type == KILL_TEAM_SPREE) {
                        HUD_KillNotify_Push(s1, s2, 1, type);
@@@ -3018,14 -3014,6 +3018,14 @@@ void HUD_Notify (void
                                self = get_weaponinfo(killnotify_deathtype[j]);
                                s = strcat("weapon", self.netname);
                        }
 +                      else if(killnotify_deathtype[j] == KILL_FRAG_GAUNTLET)
 +                      {
 +                              s = "notify_melee";
 +                      }
 +                      else if(killnotify_deathtype[j] == KILL_FRAG_SHOTGUN_MELEE)
 +                      {
 +                              s = "notify_melee";
 +                      }
                        else if(killnotify_deathtype[j] == KILL_TEAM_RED)
                        {
                                s = "notify_teamkill_red";
index 2824b96d58622b2e04f98fd865a6ff1bc5dbba32,099fa298434ff62794c88eba2c9d17a26d9f892f..92ed5e75a94888f6414aba480ee475986483533e
@@@ -243,8 -243,8 +243,8 @@@ void lgbeam_think(
                vector force;
                force = w_shotdir * cvar("g_balance_electro_primary_force") + '0 0 1' * cvar("g_balance_electro_primary_force_up");
                Damage (trace_ent, self.owner, self.owner, cvar("g_balance_electro_primary_damage") * dt, WEP_ELECTRO, trace_endpos, force * dt);
 -              W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);
        }
 +      W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);
  
        // draw effect
        if(w_shotorg != self.hook_start)
@@@ -447,27 -447,27 +447,27 @@@ float w_electro(float req
        else if (req == WR_SUICIDEMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = "could not remember where they put plasma";
+                       w_deathtypestring = "%s could not remember where they put plasma";
                else
-                       w_deathtypestring = "played with plasma";
+                       w_deathtypestring = "%s played with plasma";
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
                {
                        if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
-                               w_deathtypestring = "just noticed #'s blue ball";
+                               w_deathtypestring = "%s just noticed %s's blue ball";
                        else // unchecked: BOUNCE
-                               w_deathtypestring = "got in touch with #'s blue ball";
+                               w_deathtypestring = "%s got in touch with %s's blue ball";
                }
                else
                {
                        if(w_deathtype & HITTYPE_BOUNCE) // combo
-                               w_deathtypestring = "felt the electrifying air of #'s combo";
+                               w_deathtypestring = "%s felt the electrifying air of %s's combo";
                        else if(w_deathtype & HITTYPE_SPLASH)
-                               w_deathtypestring = "got too close to #'s blue beam";
+                               w_deathtypestring = "%s got too close to %s's blue beam";
                        else
-                               w_deathtypestring = "was blasted by #'s blue beam";
+                               w_deathtypestring = "%s was blasted by %s's blue beam";
                }
        }
        return TRUE;
index 1afec7618bdfe4b4ca443cb3bfbc79460be2202b,a8930cd41d9fce14b1a23f6db259f69a1625346e..6848b2a5ad90a8fdd3bef7a70c86f1f22138845e
@@@ -74,46 -74,27 +74,46 @@@ void W_Grenade_Touch1 (void
  void W_Grenade_Touch2 (void)
  {
        PROJECTILE_TOUCH;
 -      if (other.takedamage == DAMAGE_AIM)
 +      if(cvar("g_balance_grenadelauncher_secondary_sticky") && other.takedamage != DAMAGE_AIM)
        {
 -              self.use ();
 +              spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
 +
 +              // let it stick whereever it is
 +              self.oldvelocity = self.velocity;
 +              self.velocity = '0 0 0';
 +              self.movetype = MOVETYPE_NONE; // also disables gravity
 +              self.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
 +              UpdateCSQCProjectile(self);
 +
 +              // do not respond to any more touches
 +              self.solid = SOLID_NOT;
 +
 +              self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_secondary_lifetime2"));
        }
        else
        {
 -              float r;
 -              r = random() * 6;
 -              if(r < 1)
 -                      spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
 -              else if(r < 2)
 -                      spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
 -              else if(r < 3)
 -                      spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
 -              else if(r < 4)
 -                      spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
 -              else if(r < 5)
 -                      spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
 +              if (other.takedamage == DAMAGE_AIM)
 +              {
 +                      self.use ();
 +              }
                else
 -                      spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
 -              self.projectiledeathtype |= HITTYPE_BOUNCE;
 +              {
 +                      float r;
 +                      r = random() * 6;
 +                      if(r < 1)
 +                              spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
 +                      else if(r < 2)
 +                              spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
 +                      else if(r < 3)
 +                              spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
 +                      else if(r < 4)
 +                              spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
 +                      else if(r < 5)
 +                              spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
 +                      else
 +                              spamsound (self, CHAN_PROJECTILE, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
 +                      self.projectiledeathtype |= HITTYPE_BOUNCE;
 +              }
        }
  }
  
@@@ -193,10 -174,7 +193,10 @@@ void W_Grenade_Attack2 (void
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
  
 -      CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
 +      if(cvar("g_balance_grenadelauncher_secondary_sticky"))
 +              CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
 +      else
 +              CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
  }
  
  void spawnfunc_weapon_grenadelauncher (void)
@@@ -287,19 -265,19 +287,19 @@@ float w_glauncher(float req
        else if (req == WR_SUICIDEMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = "tried out his own grenade";
+                       w_deathtypestring = "%s tried out his own grenade";
                else
-                       w_deathtypestring = "detonated";
+                       w_deathtypestring = "%s detonated";
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SPLASH)
                        if(w_deathtype & HITTYPE_BOUNCE) // (must be secondary then)
-                               w_deathtypestring = "didn't see #'s grenade";
+                               w_deathtypestring = "%s didn't see %s's grenade";
                        else // unchecked: SECONDARY
-                               w_deathtypestring = "almost dodged #'s grenade";
+                               w_deathtypestring = "%s almost dodged %s's grenade";
                else // unchecked: SECONDARY, BOUNCE
-                       w_deathtypestring = "ate #'s grenade";
+                       w_deathtypestring = "%s ate %s's grenade";
        }
        return TRUE;
  }