Code for my last commit
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 12 Jul 2011 14:37:33 +0000 (17:37 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 12 Jul 2011 14:37:33 +0000 (17:37 +0300)
data/qcsrc/server/g_grabber.qc
data/qcsrc/server/miscfunctions.qc
data/qcsrc/server/w_grabber.qc

index f8ce6c0..264ce29 100644 (file)
@@ -102,10 +102,13 @@ void GrabberThink();
 void Grabber_Stop()\r
 {\r
        pointparticles(particleeffectnum("grabber_impact"), self.origin, '0 0 0', 1);\r
 void Grabber_Stop()\r
 {\r
        pointparticles(particleeffectnum("grabber_impact"), self.origin, '0 0 0', 1);\r
-       sound (self, CHAN_PROJECTILE, "weapons/grabber_impact.wav", VOL_BASE, ATTN_NORM);\r
+       if(other.classname == "player")\r
+               sound (self, CHAN_PROJECTILE, "weapons/grabber_impact_player.wav", VOL_BASE, ATTN_NORM);\r
+       else\r
+               sound (self, CHAN_PROJECTILE, "weapons/grabber_impact_world.wav", VOL_BASE, ATTN_NORM);\r
 \r
        self.state = 1;\r
 \r
        self.state = 1;\r
-       self.think =GrabberThink;\r
+       self.think = GrabberThink;\r
        self.nextthink = time;\r
        self.touch = SUB_Null;\r
        self.velocity = '0 0 0';\r
        self.nextthink = time;\r
        self.touch = SUB_Null;\r
        self.velocity = '0 0 0';\r
index 0ccaa0f..3a97b62 100644 (file)
@@ -1442,9 +1442,6 @@ void precache()
     // common weapon precaches\r
     precache_sound ("weapons/weapon_switch.wav");\r
     precache_sound ("weapons/weaponpickup.wav");\r
     // common weapon precaches\r
     precache_sound ("weapons/weapon_switch.wav");\r
     precache_sound ("weapons/weaponpickup.wav");\r
-    precache_sound ("weapons/grabber_fire.wav"); // grabber\r
-       precache_sound ("weapons/grabber_altfire.wav"); // grabber\r
-    precache_sound ("weapons/grabber_impact.wav"); // grabber\r
 \r
        float i;\r
        for(i = 0; i < 8; i += 1)\r
 \r
        float i;\r
        for(i = 0; i < 8; i += 1)\r
index dbf470f..50b6add 100644 (file)
@@ -47,6 +47,11 @@ void W_Grabber_Attack2()
        {\r
                Damage(trace_ent, self, self, cvar("g_balance_grabber_secondary_damage"), WEP_GRABBER | HITTYPE_SECONDARY, trace_endpos, cvar("g_balance_grabber_secondary_force") * w_shotdir);\r
                pointparticles(particleeffectnum("grabber_impact2"), trace_endpos, '0 0 0', 1);\r
        {\r
                Damage(trace_ent, self, self, cvar("g_balance_grabber_secondary_damage"), WEP_GRABBER | HITTYPE_SECONDARY, trace_endpos, cvar("g_balance_grabber_secondary_force") * w_shotdir);\r
                pointparticles(particleeffectnum("grabber_impact2"), trace_endpos, '0 0 0', 1);\r
+               if(trace_ent.classname == "player")\r
+                       sound (self, CHAN_PROJECTILE, "weapons/grabber_impact2_player.wav", VOL_BASE, ATTN_NORM);\r
+               else\r
+                       sound (self, CHAN_PROJECTILE, "weapons/grabber_impact2_world.wav", VOL_BASE, ATTN_NORM);\r
+\r
                W_Grabber_UpdateStats(self, FALSE, TRUE); // the shot is recorded above\r
        }\r
 \r
                W_Grabber_UpdateStats(self, FALSE, TRUE); // the shot is recorded above\r
        }\r
 \r
@@ -200,7 +205,10 @@ float w_grabber(float req)
                precache_model ("models/weapons/g_grabber.md3");\r
                precache_model ("models/weapons/v_grabber.md3");\r
                precache_model ("models/weapons/h_grabber.iqm");\r
                precache_model ("models/weapons/g_grabber.md3");\r
                precache_model ("models/weapons/v_grabber.md3");\r
                precache_model ("models/weapons/h_grabber.iqm");\r
-               precache_sound ("weapons/grabber_impact.wav"); // done by g_grabber.qc\r
+               precache_sound ("weapons/grabber_impact_player.wav");\r
+               precache_sound ("weapons/grabber_impact_world.wav");\r
+               precache_sound ("weapons/grabber_impact2_player.wav");\r
+               precache_sound ("weapons/grabber_impact2_world.wav");\r
                precache_sound ("weapons/grabber_fire.wav");\r
                precache_sound ("weapons/grabber_altfire.wav");\r
                precache_sound ("weapons/grabber_swing.wav");\r
                precache_sound ("weapons/grabber_fire.wav");\r
                precache_sound ("weapons/grabber_altfire.wav");\r
                precache_sound ("weapons/grabber_swing.wav");\r