Better Grabber impact effects
[voretournament/voretournament.git] / data / qcsrc / server / w_grabber.qc
index 30d7131..dbf470f 100644 (file)
@@ -46,6 +46,7 @@ void W_Grabber_Attack2()
        if (trace_fraction < 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
                W_Grabber_UpdateStats(self, FALSE, TRUE); // the shot is recorded above\r
        }\r
 \r
@@ -62,7 +63,7 @@ void spawnfunc_weapon_grabber (void)
 \r
 float w_grabber(float req)\r
 {\r
-       if(self.predator.classname == "player") // we can't use weapons while in the stomach\r
+       if(self.stat_eaten) // we can't use weapons while in the stomach\r
        {\r
                self.grabber_state |= GRABBER_REMOVING;\r
                return FALSE;\r
@@ -141,7 +142,13 @@ float w_grabber(float req)
                                {\r
                                        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
                                        {\r
-                                               if ( self.ammo_fuel >= (time - self.grabber_time_fueldecrease) * grabbered_fuel )\r
+                                               float active_ammo;\r
+                                               if(cvar("g_balance_grabber_reload_ammo"))\r
+                                                       active_ammo = self.clip_load;\r
+                                               else\r
+                                                       active_ammo = self.ammo_fuel;\r
+\r
+                                               if (active_ammo >= (time - self.grabber_time_fueldecrease) * grabbered_fuel )\r
                                                {\r
                                                        W_DecreaseAmmo(ammo_fuel, (time - self.grabber_time_fueldecrease) * grabbered_fuel, cvar("g_balance_grabber_reload_ammo"));\r
                                                        self.grabber_time_fueldecrease = time;\r