]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use SND_RIC_RANDOM
authorMario <mario@smbclan.net>
Wed, 4 Nov 2015 00:12:30 +0000 (10:12 +1000)
committerMario <mario@smbclan.net>
Wed, 4 Nov 2015 00:12:30 +0000 (10:12 +1000)
qcsrc/client/damage.qc
qcsrc/common/weapons/weapon/hmg.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/shotgun.qc

index 803b241d09b7529bf4872fb4918c7c8cf7bc6556..35d36d1f00c7f547303e633ff19fe3fb3b01a655 100644 (file)
@@ -320,7 +320,7 @@ void Ent_DamageInfo(float isNew)
                                break;
 
                         case DEATH_TURRET_WALK_MELEE:
-                               sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_MIN);
+                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_MIN);
                                pointparticles(EFFECT_TE_SPARK, self.origin, w_backoff * 1000, 1);
                                break;
 
index a46f19eb0425265d51d865eff0d588fa188e34b1..d701870eca11e8b25f5dacb47df55d3a08964fdc 100644 (file)
@@ -163,12 +163,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone
                        org2 = w_org + w_backoff * 2;
                        pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
                        if(!w_issilent)
-                               if(w_random < 0.05)
-                                       sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_NORM);
-                               else if(w_random < 0.1)
-                                       sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTEN_NORM);
-                               else if(w_random < 0.2)
-                                       sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM);
+                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
                }
 
 #endif
index 71f7ac3a85742fd31908d828221de7bda863aa99..b8f4854936604b645cc11cef7ed40ec009e9e0d4 100644 (file)
@@ -369,12 +369,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit
                        org2 = w_org + w_backoff * 2;
                        pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
                        if(!w_issilent)
-                               if(w_random < 0.05)
-                                       sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTN_NORM);
-                               else if(w_random < 0.1)
-                                       sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTN_NORM);
-                               else if(w_random < 0.2)
-                                       sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
                }
 
 #endif
index 5aed6a7d473fff31f1a2208c7061a78f66839365..be7e34abfe8da8378891c062b2e1de0528c1496c 100644 (file)
@@ -258,12 +258,7 @@ void W_Rifle_BulletHail(.entity weaponentity, float mode, void(void) AttackFunc,
                        pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1);
                        if(!w_issilent)
                        {
-                               if(w_random < 0.2)
-                                       sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTN_NORM);
-                               else if(w_random < 0.4)
-                                       sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTN_NORM);
-                               else if(w_random < 0.5)
-                                       sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
                        }
                }
                METHOD(Rifle, wr_init, void(entity thiswep))
index 2de55865a4e3373e75bd05839d6324d12ed5a0cd..7279973dd173efeba03d34a7796ca9d98bdbd3b9 100644 (file)
@@ -342,12 +342,7 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity
                        pointparticles(EFFECT_SHOTGUN_IMPACT, org2, w_backoff * 1000, 1);
                        if(!w_issilent && time - self.prevric > 0.25)
                        {
-                               if(w_random < 0.0165)
-                                       sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_NORM);
-                               else if(w_random < 0.033)
-                                       sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTEN_NORM);
-                               else if(w_random < 0.05)
-                                       sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM);
+                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
                                self.prevric = time;
                        }
                }