Merge remote branch 'refs/remotes/origin/fruitiex/silencedriflesec'
authorRudolf Polzer <divverent@alientrap.org>
Tue, 19 Oct 2010 05:44:14 +0000 (07:44 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 19 Oct 2010 05:44:14 +0000 (07:44 +0200)
12 files changed:
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceXonotic.cfg
defaultXonotic.cfg
qcsrc/server/cl_physics.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/g_triggers.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/w_nex.qc
sound/weapons/dryfire.wav [new file with mode: 0644]

index 158f676844e4c348a85e9015853fee0a21b20b86..8fb2e008abe24d533d1283178d548505fa736b70 100644 (file)
@@ -444,6 +444,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 0
 set g_balance_nex_charge 0
 set g_balance_nex_charge_start 0
 set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_shot_multiplier 0.5
 set g_balance_nex_charge_velocity_rate 0.2
 set g_balance_nex_charge_minspeed 400
index 11d85e4335640df92ab106a87df097491e73372a..eaff81828b33d704520959dabc0e8083ff37f725 100644 (file)
@@ -455,6 +455,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 9999999
 set g_balance_nex_charge 0
 set g_balance_nex_charge_start 0
 set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_shot_multiplier 0.5
 set g_balance_nex_charge_velocity_rate 0.2
 set g_balance_nex_charge_minspeed 400
index 654ec6cc10a4baad704f416a09b2d777133f0144..445e8b156bbde7da0e87cb2859f21a235cc64b68 100644 (file)
@@ -443,6 +443,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
 set g_balance_nex_charge 0
 set g_balance_nex_charge_start 0
 set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_shot_multiplier 0.5
 set g_balance_nex_charge_velocity_rate 0.2
 set g_balance_nex_charge_minspeed 400
index 9a49f3da96d7918954d3e9171b4466486252a640..517f5c9cfbcb15c5daef1f99b74f27ed4e68ea0a 100644 (file)
@@ -444,6 +444,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
 set g_balance_nex_charge 0
 set g_balance_nex_charge_start 0
 set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_shot_multiplier 0.5
 set g_balance_nex_charge_velocity_rate 0.2
 set g_balance_nex_charge_minspeed 400
index 9d4f67a94c6206a08a75c354f20aea20324fc239..66c1e991a7c0e2a8f5fdd05168c383faecd5b25f 100644 (file)
@@ -430,22 +430,23 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 2000
 
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_rate 0.15
 set g_balance_nex_secondary_damage 0
 set g_balance_nex_secondary_force 0
 set g_balance_nex_secondary_refire 0
 set g_balance_nex_secondary_animtime 0
-set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_ammo 4
 set g_balance_nex_secondary_damagefalloff_mindist 0
 set g_balance_nex_secondary_damagefalloff_maxdist 0
 set g_balance_nex_secondary_damagefalloff_halflife 0
 set g_balance_nex_secondary_damagefalloff_forcehalflife 0
 
 set g_balance_nex_charge 1
-set g_balance_nex_charge_start 0.25
-set g_balance_nex_charge_rate 0.025
+set g_balance_nex_charge_start 0.2
+set g_balance_nex_charge_rate 0.05
+set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_shot_multiplier 0.675
-set g_balance_nex_charge_velocity_rate 0.175
+set g_balance_nex_charge_velocity_rate 0.15
 set g_balance_nex_charge_minspeed 400
 set g_balance_nex_charge_maxspeed 1000
 // }}}
index 050a2915df005d8183456c873e5d9adfb720ccc2..2a0a24b19202b74ac1a0fbde01820dffcb45084e 100644 (file)
@@ -1968,3 +1968,7 @@ r_shadow_glossexact 1
 
 // use fake light if map has no lightmaps
 r_fakelight 1
+
+// strength sound settings
+set sv_strengthsound_antispam_time 0.1 "minimum distance of strength sounds"
+set sv_strengthsound_antispam_refire_threshold 0.04 "apply minimum distance only if refire of the gun is smaller than this"
index f41620f7c0d567fd35c16200dee56128fc9c76b3..1d2117defffb0388fe023f9bf4ec7db3fd1ea6c0 100644 (file)
@@ -1335,7 +1335,7 @@ void SV_PlayerPhysics()
                float f;
                f = (xyspeed - cvar("g_balance_nex_charge_minspeed")) / (cvar("g_balance_nex_charge_maxspeed") - cvar("g_balance_nex_charge_minspeed"));
                // add the extra charge
-               self.nex_charge += cvar("g_balance_nex_charge_velocity_rate") * f * frametime;
+               self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_velocity_rate") * f * frametime);
        }
 :end
        if(self.flags & FL_ONGROUND)
index c9a5dfc4aa1b9d61236355e94824506004053edb..4537573c5d57b28c6ed7757a4aea131bcd78d109 100644 (file)
@@ -130,6 +130,8 @@ vector w_shotend;
 // this function calculates w_shotorg and w_shotdir based on the weapon model
 // offset, trueaim and antilag, and won't put w_shotorg inside a wall.
 // make sure you call makevectors first (FIXME?)
+.float prevstrengthsound;
+.float prevstrengthsoundattempt;
 void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float maxdamage, float range)
 {
        float nudge = 1; // added to traceline target and subtracted from result
@@ -245,9 +247,18 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
                sound (ent, CHAN_WEAPON, snd, VOL_BASE, ATTN_NORM);
        }
 
-       if (ent.items & IT_STRENGTH)
-       if (!g_minstagib)
-               sound (ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+       if(ent.items & IT_STRENGTH)
+       if(!g_minstagib)
+       if(
+               (time > ent.prevstrengthsound + cvar("sv_strengthsound_antispam_time"))
+               ||
+               (time > ent.prevstrengthsoundattempt + cvar("sv_strengthsound_antispam_refire_threshold"))
+       ) // prevent insane sound spam
+       {
+               sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+               ent.prevstrengthsound = time;
+       }
+       ent.prevstrengthsoundattempt = time;
 
        // nudge w_shotend so a trace to w_shotend hits
        w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
@@ -1106,6 +1117,9 @@ float weapon_prepareattack_checkammo(float secondary)
                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                        return FALSE;
 
+               if(self.weapon == self.switchweapon) // only play once BEFORE starting to switch weapons
+                       sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+
                W_SwitchToOtherWeapon(self);
                return FALSE;
        }
index d97413f10efb94ff15770a6faf4b5af981d0aeb0..8ded34feae4e6fae28e931a5a18f85868c6dc8e0 100644 (file)
@@ -1188,6 +1188,8 @@ void spawnfunc_misc_laser()
                self.scale = 1;
        if(!self.modelscale)
                self.modelscale = 1;
+       else if(self.modelscale < 0)
+               self.modelscale = 0;
        self.think = misc_laser_think;
        self.nextthink = time;
        InitializeEntity(self, misc_laser_init, INITPRIO_FINDTARGET);
index d4232424072f84aa90d2c7fd220371e4a91aa923..59428f65dbca241c03f7b330440cdd8cf75fce98 100644 (file)
@@ -1668,6 +1668,7 @@ void precache()
     precache_sound ("weapons/weapon_switch.wav");
     precache_sound ("weapons/weaponpickup.wav");
     precache_sound ("weapons/unavailable.wav");
+    precache_sound ("weapons/dryfire.wav");
     if (g_grappling_hook)
     {
         precache_sound ("weapons/hook_fire.wav"); // hook
index a50dc11fb9ecb36fc1dfb9a7e029e8d310a5d5a6..b30b2255df9dd28f3147ac26ee870b38736253c0 100644 (file)
@@ -81,7 +81,7 @@ float w_nex(float req)
        }
        else if (req == WR_THINK)
        {
-               if(cvar("g_balance_nex_charge"))
+               if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
                        self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
                if (self.BUTTON_ATCK)
                {
@@ -95,7 +95,7 @@ float w_nex(float req)
                {
                        if(cvar("g_balance_nex_secondary_charge"))
                        {
-                               if(self.ammo_cells)
+                               if(self.ammo_cells && self.nex_charge < 1)
                                {
                                        self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
                                        self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * frametime / W_TICSPERFRAME);
diff --git a/sound/weapons/dryfire.wav b/sound/weapons/dryfire.wav
new file mode 100644 (file)
index 0000000..81e86b1
Binary files /dev/null and b/sound/weapons/dryfire.wav differ