X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhook.qc;h=9f690d5bc884dc3692b1ebb172cdd6089e74775f;hb=24c2148c1ceb17186cc4e77279d7810d9f398f36;hp=8644847b3f92efc78a38f75e5a7801359e153423;hpb=bea0e7fc9e503bb0ef95152d3f73343cc0d49e6c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 8644847b3..9f690d5bc 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -6,6 +6,12 @@ .float LGBeamKillTime; .float LGBeamSound; .float LGBeamSilent; +.vector GauntletBeamStart; +.vector GauntletBeamEnd; +.float GauntletBeamKillTime; +.float GauntletBeamSound; +.float GauntletBeamSilent; + void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag) { @@ -138,6 +144,38 @@ void Draw_GrapplingHook() setorigin(self, a); } + if(time < self.GauntletBeamKillTime) + { + s = cvar("cl_gunalign"); + if(s != 1 && s != 2 && s != 4) + s = 3; // default value + --s; + vs = gauntlet_shotorigin[s]; + + if(self.sv_entnum == player_localentnum - 1) + { + b = view_origin + view_forward * MAX_SHOT_DISTANCE; + WarpZone_TraceLine(view_origin, b, MOVE_NORMAL, world); + a = view_origin + view_forward * vs_x + view_right * -vs_y + view_up * vs_z; + } + else + { + a = self.GauntletBeamStart; + b = self.GauntletBeamEnd; + } + + tex = "particles/gauntletbeam"; + rgb = '1 1 1'; + + Draw_GrapplingHook_trace_callback_tex = tex; + Draw_GrapplingHook_trace_callback_rnd = random(); + WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, MOVE_NORMAL, world, world, Draw_GrapplingHook_trace_callback); + Draw_GrapplingHook_trace_callback_tex = string_null; + + // helps the sound + setorigin(self, a); + } + if(time < self.LGBeamKillTime && !self.LGBeamSilent) { if(!self.LGBeamSound) @@ -154,6 +192,23 @@ void Draw_GrapplingHook() self.LGBeamSound = 0; } } + + if(time < self.GauntletBeamKillTime && !self.GauntletBeamSilent) + { + if(!self.GauntletBeamSound) + { + sound (self, CHAN_PROJECTILE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTN_NORM); + self.GauntletBeamSound = 1; + } + } + else + { + if(self.GauntletBeamSound) + { + sound (self, CHAN_PROJECTILE, "misc/null.wav", VOL_BASE, ATTN_NORM); + self.GauntletBeamSound = 0; + } + } } void Net_GrapplingHook() @@ -201,10 +256,18 @@ void Net_GrapplingHook() p.LGBeamSilent = 1; p.draw = Draw_GrapplingHook; break; + case 3: // gauntlet beam + p.GauntletBeamKillTime = time + 0.1; + p.GauntletBeamStart = start; + p.GauntletBeamEnd = end; + p.GauntletBeamSilent = 0; + p.draw = Draw_GrapplingHook; + break; } } void Hook_Precache() { precache_sound("weapons/lgbeam_fly.wav"); + precache_sound("weapons/gauntletbeam_fly.wav"); }