From adbb9de0f5e795bc74e5fcb00bcd54e7e8b87d43 Mon Sep 17 00:00:00 2001 From: Jakob MG Date: Wed, 15 Aug 2012 18:46:54 +0200 Subject: [PATCH] Healing gun target lock for bumblebee, make healray fatter, remove gunner static crosshair --- qcsrc/client/vehicles/vehicles.qc | 51 +++++++----------------------- qcsrc/server/vehicles/bumblebee.qc | 33 +++++++++++++++++-- qcsrc/server/vehicles/vehicles.qc | 4 ++- 3 files changed, 45 insertions(+), 43 deletions(-) diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc index 0cf543e9c..cbf8bda39 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -203,17 +203,17 @@ void Net_VehicleSetup() break; case HUD_BUMBLEBEE: - // Raygun + // Raygun-locked AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga"; - AuxiliaryXhair[0].axh_scale = 0.25; + AuxiliaryXhair[0].axh_scale = 0.5; // Gunner1 - AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga"; - AuxiliaryXhair[1].axh_scale = 0.25; + AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga"; + AuxiliaryXhair[1].axh_scale = 0.75; // Gunner2 - AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-ring.tga"; - AuxiliaryXhair[2].axh_scale = 0.25; + AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga"; + AuxiliaryXhair[2].axh_scale = 0.75; break; case HUD_BUMBLEBEE_GUN: // Plasma cannons @@ -360,22 +360,7 @@ void CSQC_BUMBLE_HUD() drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); else drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); -/* -/* -// Bomb bar - picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight); - drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - if(reload1 != 1) - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); -*/ + if (scoreboard_showscores) HUD_DrawScoreboard(); else @@ -383,10 +368,9 @@ void CSQC_BUMBLE_HUD() picsize = draw_getimagesize(waki_xhair); picsize_x *= 0.5; picsize_y *= 0.5; - - drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); } + } void CSQC_BUMBLE_GUN_HUD() @@ -485,6 +469,7 @@ void CSQC_BUMBLE_GUN_HUD() drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight); drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); + // .. and icon picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; @@ -492,23 +477,10 @@ void CSQC_BUMBLE_GUN_HUD() drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); else drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); -/* -// Bomb bar - picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight); - drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - if(reload1 != 1) - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); -*/ + if (scoreboard_showscores) HUD_DrawScoreboard(); + /* else { picsize = draw_getimagesize(waki_xhair); @@ -518,6 +490,7 @@ void CSQC_BUMBLE_GUN_HUD() drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); } + */ } diff --git a/qcsrc/server/vehicles/bumblebee.qc b/qcsrc/server/vehicles/bumblebee.qc index 94c9c040a..ce43a60ea 100644 --- a/qcsrc/server/vehicles/bumblebee.qc +++ b/qcsrc/server/vehicles/bumblebee.qc @@ -463,11 +463,39 @@ float bumb_pilot_frame() pilot.velocity = pilot.movement = vehic.velocity; setorigin(pilot, vehic.origin + '0 0 32'); + if(vehic.tur_head.lock_time < time || vehic.tur_head.enemy.deadflag) + vehic.tur_head.enemy = world; + + if(trace_ent) + if(trace_ent.movetype) + if(trace_ent.takedamage) + if(!trace_ent.deadflag) + { + if(teamplay) + { + if(trace_ent.team == pilot.team) + { + vehic.tur_head.enemy = trace_ent; + vehic.tur_head.lock_time = time + 1; + } + } + else + { + vehic.tur_head.enemy = trace_ent; + vehic.tur_head.lock_time = time + 0.5; + } + } + + if(vehic.tur_head.enemy) + { + trace_endpos = real_origin(vehic.tur_head.enemy); + UpdateAuxiliaryXhair(pilot, trace_endpos, '0 0.5 0', 0); + } + vehicle_aimturret(vehic, trace_endpos, self.gun3, "fire", autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides, autocvar_g_vehicle_bumblebee_raygun_turnspeed); - if((pilot.BUTTON_ATCK || pilot.BUTTON_ATCK2) && vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime) { @@ -824,7 +852,7 @@ void bumble_raygun_draw() for(i = -0.1; i < 0.2; i += 0.1) { df = DRAWFLAG_NORMAL; //((random() < 0.5) ? DRAWFLAG_ADDITIVE : DRAWFLAG_SCREEN); - sz = 2 + random() * 6; + sz = 5 + random() * 5; al = 0.25 + random() * 0.5; _vtmp1 = self.origin + _dir * _len * (0.25 + i); _vtmp1 += (randomvec() * (_len * 0.2) * (frametime * 2)); //self.raygun_l1; @@ -840,7 +868,6 @@ void bumble_raygun_draw() Draw_CylindricLine(_vtmp1, self.move_origin + randomvec() * 32, sz, "gfx/colors/white.tga", 1, 1, self.colormod, al, df, view_origin); } - } void bumble_raygun_read(float bIsNew) diff --git a/qcsrc/server/vehicles/vehicles.qc b/qcsrc/server/vehicles/vehicles.qc index 17007f7ff..7ea09861f 100644 --- a/qcsrc/server/vehicles/vehicles.qc +++ b/qcsrc/server/vehicles/vehicles.qc @@ -1332,9 +1332,11 @@ void vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _t vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles; vtmp = AnglesTransform_Normalize(vtmp, TRUE); - ftmp = _aimspeed * sys_frametime; + ftmp = _aimspeed * frametime; + vtmp_y = bound(-ftmp, vtmp_y, ftmp); vtmp_x = bound(-ftmp, vtmp_x, ftmp); + _turrret.angles_y = bound(_rotlimit_min, _turrret.angles_y + vtmp_y, _rotlimit_max); _turrret.angles_x = bound(_pichlimit_min, _turrret.angles_x + vtmp_x, _pichlimit_max); } -- 2.39.2