]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'fruitiex/newpanelhud' into fruitiex/fruitbalance
authorFruitieX <rasse@rasse-lappy.localdomain>
Sat, 24 Jul 2010 11:15:49 +0000 (14:15 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sat, 24 Jul 2010 11:15:49 +0000 (14:15 +0300)
1  2 
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/common/constants.qh
qcsrc/server/g_damage.qc

diff --combined defaultXonotic.cfg
index 8e4d45d364413adbf0c88777f28a36b996d5526f,2e5b56cd14fccfd30703d33850cd912f2858c744..8d6b38e3845a22daa79813fedb362292e434796c
@@@ -298,8 -298,6 +298,8 @@@ set sv_ready_restart 0 "if set to 1 all
  set sv_ready_restart_after_countdown 0        "if set to 1 the players and map items are reset after the countdown ended, otherwise they're reset already at the beginning of the countdown"
  set sv_ready_restart_repeatable 0     "allows the players to restart the game as often as needed"
  
 +set sv_hitsound_antispam_time 0.05 "don't play the hitsound more often than this for the electro lightning gun or the laser gauntlet"
 +
  //nifreks lockonrestart feature, used in team-based game modes, if set to 1 and all players readied up no other player can then join the game anymore, useful to block spectators from joining
  set teamplay_lockonrestart 0 "it set to 1 in a team-based game, the teams are locked once all players readied up and the game restarted (no new players can join after restart unless using the server-command unlockteams)"
  
@@@ -345,7 -343,7 +345,7 @@@ set sv_fragmessage_information_typefra
  
  // use default physics
  set sv_friction_on_land 0
- exec physicsNoQWBunny.cfg
+ exec physicsNoQWBunny-nexbased.cfg
  
  set sv_player_viewoffset "0 0 35" "view offset of the player model"
  set sv_player_mins "-16 -16 -24" "playermodel mins"
@@@ -1350,10 -1348,10 +1350,10 @@@ seta hud_panel_weapons_accuracy_color1 
  seta hud_panel_weapons_accuracy_color2 "0 1 0"
  seta hud_panel_weapons_accuracy_color_levels "0 20 100" "accuracy values at which a specified color (hud_panel_weapons_accuracy_color<X>) will be used. If your accuracy is between 2 of these values then a mix of the Xth and X+1th colors will be used. You can specify up to 10 values, in increasing order"
  seta hud_panel_weapons_ammo 1 "show ammo as a status bar"
- seta hud_panel_weapons_ammo_full_shells 40 "show 100% of the status bar at this ammo count"
- seta hud_panel_weapons_ammo_full_nails 100 "show 100% of the status bar at this ammo count"
- seta hud_panel_weapons_ammo_full_cells 60 "show 100% of the status bar at this ammo count"
- seta hud_panel_weapons_ammo_full_rockets 60 "show 100% of the status bar at this ammo count"
+ seta hud_panel_weapons_ammo_full_shells 50 "show 100% of the status bar at this ammo count"
+ seta hud_panel_weapons_ammo_full_nails 200 "show 100% of the status bar at this ammo count"
+ seta hud_panel_weapons_ammo_full_cells 80 "show 100% of the status bar at this ammo count"
+ seta hud_panel_weapons_ammo_full_rockets 80 "show 100% of the status bar at this ammo count"
  seta hud_panel_weapons_ammo_full_fuel 100 "show 100% of the status bar at this ammo count"
  
  seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
diff --combined qcsrc/client/View.qc
index db41d55d96ec571062d3c3357b8aa73e5208b54a,6d89e8d899cf2fa9a55697653f7e0bb847eb85e8..3033cfa78a7cc3b6de68a8d84ca3c73eb98ccbd5
@@@ -137,7 -137,7 +137,7 @@@ vector GetCurrentFov(float fov
                        zoomspeed = 3.5;
  
        zoomdir = button_zoom;
 -      if(getstati(STAT_ACTIVEWEAPON) == WEP_NEX) // do NOT use switchweapon here
 +      if(getstati(STAT_ACTIVEWEAPON) == WEP_NEX || (getstati(STAT_ACTIVEWEAPON) == WEP_CAMPINGRIFLE && campingrifle_scope)) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
        {
@@@ -478,7 -478,6 +478,6 @@@ void CSQC_UpdateView(float w, float h
                weapontime = time;
                last_weapon = activeweapon;
  
-               entity e;
                e = get_weaponinfo(activeweapon);
                if(e.netname != "")
                        localcmd(strcat("\ncl_hook_activeweapon ", e.netname), "\n");
                reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
        else if(button_zoom)
                reticle_type = 1; // normal zoom
 -      else if(activeweapon == WEP_NEX && button_attack2)
 +      else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_CAMPINGRIFLE && button_attack2)
                reticle_type = 2; // nex zoom
  
        if(cvar("cl_reticle_stretch"))
                                        bullets = 0;
  
  #define CROSSHAIR_DRAW_RING(i,j,sz,wcross_name,wcross_alpha) \
-                               drawpic(wcross_origin - ('0.5 0 0' * (sz * wcross_size_x * ring_scale + i * wcross_blur) + '0 0.5 0' * (sz * wcross_size_y * ring_scale + j * wcross_blur)), strcat("gfx/hud/", cvar_string("hud_skin"), "/rifle_ring_", ftos(bullets)), sz * wcross_size * ring_scale, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)
+                               drawpic(wcross_origin - ('0.5 0 0' * (sz * wcross_size_x * ring_scale + i * wcross_blur) + '0 0.5 0' * (sz * wcross_size_y * ring_scale + j * wcross_blur)), strcat("gfx/rifle_ring_", ftos(bullets)), sz * wcross_size * ring_scale, wcross_color, wcross_alpha, DRAWFLAG_NORMAL)
  
  #define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
                                do \
@@@ -1190,6 -1189,18 +1189,18 @@@ void CSQC_common_hud(void
        switch(hud)
        {
                case HUD_NORMAL:
+                       // do some accuracy var caching
+                       float i;
+                       if(!(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));
+                       }
                        // hud first
                        HUD_Main();
  
index 7a5cf3447b1a29d502953812c276d533bb8fbb78,dfd20972ef0433ec9a153ca91365bf6f6d17f2e9..61ce6900affe5f0a682cc23e324de42c2c94f2c5
@@@ -59,7 -59,6 +59,7 @@@ const float TE_CSQC_ANNOUNCE = 110
  const float TE_CSQC_TARGET_MUSIC = 111;
  const float TE_CSQC_NOTIFY = 112;
  const float TE_CSQC_WEAPONCOMPLAIN = 113;
 +const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115;
  
  const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
  const float RACE_NET_CHECKPOINT_CLEAR = 1;
@@@ -106,9 -105,6 +106,9 @@@ const float ENT_CLIENT_TUBANOTE = 23
  const float ENT_CLIENT_WARPZONE = 24;
  const float ENT_CLIENT_WARPZONE_CAMERA = 25;
  const float ENT_CLIENT_TRIGGER_MUSIC = 26;
 +const float ENT_CLIENT_HOOK = 27;
 +const float ENT_CLIENT_LGBEAM = 28;
 +const float ENT_CLIENT_GAUNTLET = 29;
  
  const float ENT_CLIENT_TURRET = 40;
  
@@@ -550,11 -546,12 +550,12 @@@ float MAX_SHOT_DISTANCE = 32768
  
  // CSQC centerprint/notify message types
  float MSG_SUICIDE = 0;
- float MSG_KILL = 1;
- float MSG_SPREE = 2;
- float MSG_KILL_ACTION = 3;
- float MSG_KILL_ACTION_SPREE = 4;
- float MSG_INFO = 5;
+ float MSG_KILL_MELEE = 1;
+ float MSG_KILL = 2;
+ float MSG_SPREE = 3;
+ float MSG_KILL_ACTION = 4;
+ float MSG_KILL_ACTION_SPREE = 5;
+ float MSG_INFO = 6;
  
  float KILL_TEAM_RED = 10301;
  float KILL_TEAM_BLUE = 10302;
@@@ -564,22 -561,24 +565,24 @@@ float KILL_FIRST_VICTIM = 10305
  float KILL_TYPEFRAG = 10306;
  float KILL_TYPEFRAGGED = 10307;
  float KILL_FRAG = 10308;
- float KILL_FRAGGED = 10309;
- float KILL_SPREE = 10310;
- float KILL_END_SPREE = 10311;
- float KILL_SPREE_3 = 10312;
- float KILL_SPREE_5 = 10313;
- float KILL_SPREE_10 = 10314;
- float KILL_SPREE_15 = 10315;
- float KILL_SPREE_20 = 10316;
- float KILL_SPREE_25 = 10317;
- float KILL_SPREE_30 = 10318;
- float INFO_GOTFLAG = 10319;
- float INFO_PICKUPFLAG = 10320;
- float INFO_LOSTFLAG = 10321;
- float INFO_RETURNFLAG = 10322;
- float INFO_CAPTUREFLAG = 10323;
+ float KILL_FRAG_GAUNTLET = 10309;
+ float KILL_FRAG_SHOTGUN_MELEE = 10310;
+ float KILL_FRAGGED = 10311;
+ float KILL_SPREE = 10312;
+ float KILL_END_SPREE = 10313;
+ float KILL_SPREE_3 = 10314;
+ float KILL_SPREE_5 = 10315;
+ float KILL_SPREE_10 = 10316;
+ float KILL_SPREE_15 = 10317;
+ float KILL_SPREE_20 = 10318;
+ float KILL_SPREE_25 = 10319;
+ float KILL_SPREE_30 = 10320;
+ float INFO_GOTFLAG = 10321;
+ float INFO_PICKUPFLAG = 10322;
+ float INFO_LOSTFLAG = 10323;
+ float INFO_RETURNFLAG = 10324;
+ float INFO_CAPTUREFLAG = 10325;
  
  // weapon requests
  float WR_SETUP                = 1; // (SVQC) setup weapon data
diff --combined qcsrc/server/g_damage.qc
index def4829de5ee1dd62ea87e0e00db87ea8571e0d4,e11a6d428fb9cda2031061b86a48a927ccf55443..5ed980b2306b968d0a17f5226cc80186f1a7474c
@@@ -363,13 -363,27 +363,27 @@@ void Obituary (entity attacker, entity 
                                attacker.taunt_soundtime = time + 1;
  
                                // TODO: fix this?
-                                       if (deathtype == DEATH_CUSTOM)
-                                               msg = strcat(deathmessage, " by ^1", msg);
-                                       else if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "")
-                                       {
-                                               msg = ftos(strstrofs(inflictor.message2, "#", 0));
-                                       }
-                                       Send_KillNotification(s, a, msg, deathtype, MSG_KILL);
+                               if (deathtype == DEATH_CUSTOM)
+                                       msg = strcat(deathmessage, " by ^1", msg);
+                               else if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "")
+                               {
+                                       msg = ftos(strstrofs(inflictor.message2, "#", 0));
+                               }
+                               float msgtype;
+                               w = DEATH_WEAPONOF(deathtype);
+                               if(w == WEP_LASER && ((cvar("g_balance_laser_secondary_gauntlet") && w & HITTYPE_SECONDARY) || (cvar("g_balance_laser_primary_gauntlet") && !(w & HITTYPE_SECONDARY))))
+                               {
+                                       msgtype = MSG_KILL_MELEE;
+                                       deathtype = KILL_FRAG_GAUNTLET;
+                               }
+                               else if(w == WEP_SHOTGUN && (cvar("g_balance_shotgun_secondary_melee") && w & HITTYPE_SECONDARY))
+                               {
+                                       msgtype = MSG_KILL_MELEE;
+                                       deathtype = KILL_FRAG_SHOTGUN_MELEE;
+                               }
+                               Send_KillNotification(s, a, msg, deathtype, MSG_KILL);
  
                                if(g_ctf && targ.flagcarried)
                                {
                                if (attacker.killcount > 2) {
                                        Send_KillNotification(a, ftos(attacker.killcount), "", KILL_SPREE, MSG_SPREE);
                                }
-                               LogDeath("frag", deathtype, attacker, targ);
-                               if (attacker.killcount == 3)
+                               else if (attacker.killcount == 3)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_3, MSG_SPREE);
                                        AnnounceTo(attacker, "03kills");
                                        Send_KillNotification(a, "", "", KILL_SPREE_30, MSG_SPREE);
                                        AnnounceTo(attacker, "30kills");
                                }
+                               LogDeath("frag", deathtype, attacker, targ);
                        }
                }
                else
  entity damage_targ;
  entity damage_inflictor;
  entity damage_attacker;
 +.float prevhitsound;
  
  void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
  {
                                {
                                        if(damage > 0)
                                        {
 -                                              if(targ.BUTTON_CHAT)
 -                                                      attacker.typehitsound += 1;
 -                                              else
 -                                                      attacker.hitsound += 1;
 +                                              if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && cvar("g_balance_electro_lightning") || attacker.weapon == WEP_LASER) && attacker.prevhitsound + cvar("sv_hitsound_antispam_time") < time))
 +                                              {
 +                                                      if(targ.BUTTON_CHAT)
 +                                                              attacker.typehitsound += 1;
 +                                                      else
 +                                                              attacker.hitsound += 1;
 +                                                      attacker.prevhitsound = time;
 +                                              }
  
                                                damage_goodhits += 1;
                                                damage_gooddamage += damage;