X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhook.qc;h=a537cbae6e87ad7e080feafb7f2b56ec22a82d80;hb=7d31226bcb7eb09c889f3a817562270573f32c66;hp=196730a72dde016cbe3fd28308955ed2c2de6ee1;hpb=b56d8435ab6710d101761c6c2b9746e38e3cc813;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 196730a72..a537cbae6 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -75,32 +75,28 @@ void Draw_GrapplingHook() case ENT_CLIENT_HOOK: vs = hook_shotorigin[s]; break; - case ENT_CLIENT_LGBEAM: - vs = electro_shotorigin[s]; - break; - case ENT_CLIENT_GAUNTLET: - vs = gauntlet_shotorigin[s]; + case ENT_CLIENT_ARC_BEAM: + vs = lightning_shotorigin[s]; break; } - if((self.owner.sv_entnum == player_localentnum - 1)) + if((self.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0) { switch(self.HookType) { default: case ENT_CLIENT_HOOK: - a = view_origin + view_forward * vs_x + view_right * -vs_y + view_up * vs_z; + a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; b = self.origin; break; - case ENT_CLIENT_LGBEAM: - case ENT_CLIENT_GAUNTLET: + case ENT_CLIENT_ARC_BEAM: if(self.HookRange) b = view_origin + view_forward * self.HookRange; else b = view_origin + view_forward * vlen(self.velocity - self.origin); // honor original length of beam! WarpZone_TraceLine(view_origin, b, MOVE_NORMAL, world); b = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); - a = view_origin + view_forward * vs_x + view_right * -vs_y + view_up * vs_z; + a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; break; } } @@ -113,8 +109,7 @@ void Draw_GrapplingHook() a = self.velocity; b = self.origin; break; - case ENT_CLIENT_LGBEAM: - case ENT_CLIENT_GAUNTLET: + case ENT_CLIENT_ARC_BEAM: a = self.origin; b = self.velocity; break; @@ -129,44 +124,21 @@ void Draw_GrapplingHook() case ENT_CLIENT_HOOK: intensity = 1; offset = 0; - if(t == NUM_TEAM_1) - { - tex = "particles/hook_red"; - rgb = '1 .3 .3'; - } - else if(t == NUM_TEAM_2) - { - tex = "particles/hook_blue"; - rgb = '.3 .3 1'; - } - else if(t == NUM_TEAM_3) - { - tex = "particles/hook_yellow"; - rgb = '1 1 .3'; - } - else if(t == NUM_TEAM_4) + switch(t) { - tex = "particles/hook_pink"; - rgb = '1 .3 1'; - } - else - { - tex = "particles/hook_green"; - rgb = '.3 1 .3'; + case NUM_TEAM_1: tex = "particles/hook_red"; rgb = '1 0.3 0.3'; break; + case NUM_TEAM_2: tex = "particles/hook_blue"; rgb = '0.3 0.3 1'; break; + case NUM_TEAM_3: tex = "particles/hook_yellow"; rgb = '1 1 0.3'; break; + case NUM_TEAM_4: tex = "particles/hook_pink"; rgb = '1 0.3 1'; break; + default: tex = "particles/hook_white"; rgb = getcsqcplayercolor(self.sv_entnum); break; } break; - case ENT_CLIENT_LGBEAM: + case ENT_CLIENT_ARC_BEAM: // todo intensity = bound(0.2, 1 + Noise_Pink(self, frametime) * 1 + Noise_Burst(self, frametime, 0.03) * 0.3, 2); offset = Noise_Brown(self, frametime) * 10; tex = "particles/lgbeam"; rgb = '1 1 1'; break; - case ENT_CLIENT_GAUNTLET: - intensity = 1; - offset = Noise_White(self, frametime); - tex = "particles/gauntletbeam"; - rgb = '1 1 1'; - break; } Draw_GrapplingHook_trace_callback_tex = tex; @@ -193,8 +165,7 @@ void Draw_GrapplingHook() self.drawmask = 0; } break; - case ENT_CLIENT_LGBEAM: - case ENT_CLIENT_GAUNTLET: + case ENT_CLIENT_ARC_BEAM: setorigin(self, a); // beam origin! break; } @@ -204,11 +175,8 @@ void Draw_GrapplingHook() default: case ENT_CLIENT_HOOK: break; - case ENT_CLIENT_LGBEAM: - pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); - break; - case ENT_CLIENT_GAUNTLET: - pointparticles(particleeffectnum("gauntlet_lightning"), b, normalize(a - b), frametime * intensity); + case ENT_CLIENT_ARC_BEAM: + pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect break; } } @@ -222,8 +190,7 @@ void Ent_ReadHook(float bIsNew, float type) { self.HookType = type; - float sf; - sf = ReadByte(); + int sf = ReadByte(); self.HookSilent = (sf & 0x80); self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN; @@ -232,15 +199,16 @@ void Ent_ReadHook(float bIsNew, float type) if(sf & 1) { - self.owner = playerslots[ReadByte() - 1]; + int myowner = ReadByte(); + self.owner = playerslots[myowner - 1]; + self.sv_entnum = myowner; switch(self.HookType) { default: case ENT_CLIENT_HOOK: - case ENT_CLIENT_GAUNTLET: self.HookRange = 0; break; - case ENT_CLIENT_LGBEAM: + case ENT_CLIENT_ARC_BEAM: self.HookRange = ReadCoord(); break; } @@ -274,12 +242,9 @@ void Ent_ReadHook(float bIsNew, float type) setmodel(self, "models/hook.md3"); self.drawmask = MASK_NORMAL; break; - case ENT_CLIENT_LGBEAM: + case ENT_CLIENT_ARC_BEAM: sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM); break; - case ENT_CLIENT_GAUNTLET: - sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTEN_NORM); - break; } } @@ -289,7 +254,6 @@ void Ent_ReadHook(float bIsNew, float type) void Hook_Precache() { precache_sound("weapons/lgbeam_fly.wav"); - precache_sound("weapons/gauntletbeam_fly.wav"); precache_model("models/hook.md3"); }