X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fw_grabber.qc;h=98c4a38506a552b1be4955d050eeb775a8ea2b90;hb=1383ce28153c75886cd6358b29a86065131ad943;hp=cbd202b66a864f8dae6107a3a4050975d4cdd14b;hpb=7c7446cd677470ba82acd90301398f7a4f43103b;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/w_grabber.qc b/data/qcsrc/server/w_grabber.qc index cbd202b6..98c4a385 100644 --- a/data/qcsrc/server/w_grabber.qc +++ b/data/qcsrc/server/w_grabber.qc @@ -36,7 +36,8 @@ void W_Grabber_Attack2() if(time < self.weapon_delay) return; - W_SetupShot (self, TRUE, 0, "weapons/grabber_altfire.wav", cvar("g_balance_grabber_secondary_damage")); + W_SetupShot (self, TRUE, cvar("g_balance_grabber_secondary_recoil"), "weapons/grabber_altfire.wav", cvar("g_balance_grabber_secondary_damage")); + pointparticles(particleeffectnum("grabber_muzzleflash"), w_shotorg, '0 0 0', 1); W_Grabber_UpdateStats(self, TRUE, FALSE); // the hit is recorded below WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), FALSE, self, ANTILAG_LATENCY(self)); @@ -48,14 +49,17 @@ void W_Grabber_Attack2() if(trace_ent.classname == "player") sound (self, CHAN_PROJECTILE, "weapons/grabber_impact2_player.wav", VOL_BASE, ATTN_NORM); else + { sound (self, CHAN_PROJECTILE, "weapons/grabber_impact2_world.wav", VOL_BASE, ATTN_NORM); + if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) + pointparticles(particleeffectnum("ground_metal"), trace_endpos, '0 0 0', 1); + else + pointparticles(particleeffectnum("ground_dirt"), trace_endpos, '0 0 0', 1); + } W_Grabber_UpdateStats(self, FALSE, TRUE); // the shot is recorded above } - if (!g_norecoil) - self.punchangle_x -= cvar("g_balance_grabber_secondary_recoil"); - W_DecreaseAmmo(ammo_fuel, cvar("g_balance_grabber_secondary_ammo"), cvar("g_balance_grabber_reload_ammo")); } @@ -81,7 +85,7 @@ float w_grabber(float req) // 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 && !self.grabber) // not if hooked or firing the hook + if(cvar("g_balance_grabber_secondary") && trace_fraction < 1 && !self.grabber) // not if hooked or firing the hook self.stat_crosshair_style = 1; else self.stat_crosshair_style = 0; @@ -89,14 +93,14 @@ float w_grabber(float req) 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")) - && self.clip_load >= 0 && !(self.clip_load >= (time - self.grabber_time_fueldecrease) * grabbered_fuel && self.BUTTON_ATCK)) // not while hooked and still have ammo to stay hooked + && !(self.clip_load >= (time - self.grabber_time_fueldecrease) * grabbered_fuel && self.BUTTON_ATCK2)) // not while hooked and still have ammo to stay hooked { 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(self.clip_load >= 0 && !self.stat_eaten) // we're not currently reloading or eaten { - if(!self.stat_crosshair_style && self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO1)) // primary attack + if(!self.stat_crosshair_style && self.BUTTON_ATCK2 && weapon_action(self.weapon, WR_CHECKAMMO1)) // primary attack { if(time < self.weapon_delay) return FALSE; @@ -107,14 +111,13 @@ float w_grabber(float req) if (time > self.grabber_refire) if (weapon_prepareattack(0, -1)) { - if (!g_norecoil) - self.punchangle_x -= cvar("g_balance_grabber_primary_recoil"); + W_SetupShot (self, TRUE, cvar("g_balance_grabber_primary_recoil"), "", 0); // do this for recoil W_DecreaseAmmo(ammo_fuel, cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_reload_ammo")); self.grabber_state |= GRABBER_FIRING; weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grabber_primary_animtime"), w_ready); } } - else if (self.BUTTON_ATCK && weapon_action(self.weapon, WR_CHECKAMMO2)) // secondary attack + else if (self.BUTTON_ATCK2 && weapon_action(self.weapon, WR_CHECKAMMO2)) // secondary attack { if (weapon_prepareattack(1, cvar("g_balance_grabber_secondary_refire"))) { @@ -180,7 +183,7 @@ float w_grabber(float req) self.grabber_state |= GRABBER_PULLING; self.grabber_state &~= GRABBER_RELEASING; - if (self.BUTTON_ATCK) + if (self.BUTTON_ATCK2) { // already fired if(self.grabber) @@ -211,6 +214,7 @@ float w_grabber(float req) weapon_setup(WEP_GRABBER); self.grabber_state &~= GRABBER_WAITING_FOR_RELEASE; self.current_ammo = ammo_fuel; + W_DisplaySetup(self, 2, 1, 3, 0.75); } else if (req == WR_CHECKAMMO1) {