From: MirceaKitsune Date: Tue, 19 Jul 2011 12:02:57 +0000 (+0300) Subject: Grabber firing type now depends on distance, rather than being used on the alt fire... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=94a25dff7ea59a325f204251a4a0fc5c68669f52;p=voretournament%2Fvoretournament.git Grabber firing type now depends on distance, rather than being used on the alt fire button. --- diff --git a/data/effectinfo.txt b/data/effectinfo.txt index d0d93e57..f4d92003 100644 --- a/data/effectinfo.txt +++ b/data/effectinfo.txt @@ -4751,26 +4751,6 @@ velocityjitter 256 256 256 velocitymultiplier -0.1 -// grabber melee -// based off morphed's cl_gentle -// used in qcsrc/server/w_grabber.qc -effect grabber_melee -tex 43 43 -count 3 -type spark -color 0xffffff 0x0033ff -size 8 16 -sizeincrease 34 -alpha 128 128 292 -gravity 0 -airfriction 5 -liquidfriction 10 -velocityjitter 25 25 25 -lightradius 200 -lightradiusfade 200 -lightcolor 0.4 0.7 0.9 - - //torch flame, spawn it as fast as you can 20 times per second or more, supports direction but not required //fast fire // used nowhere in code, meant for maps diff --git a/data/qcsrc/server/w_grabber.qc b/data/qcsrc/server/w_grabber.qc index 7e931f33..26f37948 100644 --- a/data/qcsrc/server/w_grabber.qc +++ b/data/qcsrc/server/w_grabber.qc @@ -41,9 +41,7 @@ void W_Grabber_Attack2() WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), FALSE, self, ANTILAG_LATENCY(self)); - pointparticles(particleeffectnum("grabber_melee"), w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), '0 0 0', 1); - - if (trace_fraction < 1) + if(trace_fraction < 1) // should always be true, but just in case { 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); pointparticles(particleeffectnum("grabber_impact2"), trace_endpos, '0 0 0', 1); @@ -80,6 +78,14 @@ float w_grabber(float req) } else if (req == WR_THINK) { + // determine by distance if this will be primary fire or alternate fire + W_SetupShot (self, TRUE, 0, "", 0); // do this to update w_shotorg + WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), FALSE, self, ANTILAG_LATENCY(self)); + if(trace_fraction < 1) + dprint("!!!!!!!!!!!!!!!!!!!!!!!\n"); + else + dprint("#######################\n"); + grabbered_fuel = cvar("g_balance_grabber_primary_grabbered_fuel"); // forced reload if(cvar("g_balance_grabber_reload_ammo") && self.clip_load < min(cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_secondary_ammo")) @@ -88,12 +94,10 @@ float w_grabber(float req) if(self.ammo_fuel >= 1) // we only have one weapon in VT, so nothing else to switch to if we're out of ammo weapon_action(self.weapon, WR_RELOAD); } - else if not(self.clip_load < 0) // we're not currently reloading + else if(self.clip_load >= 0 && !self.stat_eaten) // we're not currently reloading or eaten { - if (self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO1)) + if(trace_fraction >= 1 && self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO1)) // primary attack { - if(self.stat_eaten) // we can't use weapons while in the stomach - return FALSE; if(time < self.weapon_delay) return FALSE; @@ -110,11 +114,8 @@ float w_grabber(float req) weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grabber_primary_animtime"), w_ready); } } - if (self.BUTTON_ATCK2 && weapon_action(self.weapon, WR_CHECKAMMO2)) + else if (self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO2)) // secondary attack { - - if(self.stat_eaten) // we can't use weapons while in the stomach - return FALSE; if (weapon_prepareattack(1, cvar("g_balance_grabber_secondary_refire"))) { W_Grabber_Attack2();