From: Jakob MG Date: Wed, 18 May 2011 11:05:13 +0000 (+0200) Subject: New spider hud X-Git-Tag: xonotic-v0.5.0~199^2~11^2~51 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1de3b82da199fe76d62d72b481e2fbc547c89e23;p=xonotic%2Fxonotic-data.pk3dir.git New spider hud --- 1de3b82da199fe76d62d72b481e2fbc547c89e23 diff --cc qcsrc/client/Main.qc index 0cf241161,bac1fdaef..aa2c1c501 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@@ -969,10 -977,9 +979,11 @@@ void(float bIsNewEntity) CSQC_Ent_Updat case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break; case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break; case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break; + case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break; + case ENT_CLIENT_VEHICLE: read_vehicle(bIsNewEntity); break; default: - error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype)); + //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype)); + error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname)); break; } diff --cc qcsrc/client/View.qc index d79888b0f,029b9460f..b92fcef61 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@@ -367,9 -378,10 +369,12 @@@ void CSQC_UpdateView(float w, float h vector v, vo; vector vf_size, vf_min; float a; + float hud; + hud = getstati(STAT_HUD); + button_attack2 = (input_buttons & BUTTON_3); + button_zoom = (input_buttons & BUTTON_4); + #define CHECKFAIL_ASSERT(flag,func,parm,val) { float checkfailv; checkfailv = (func)(parm); if(checkfailv != (val)) { if(!checkfail[(flag)]) localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv)); checkfail[(flag)] = 1; } } ENDS_WITH_CURLY_BRACE CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0); CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0); @@@ -417,34 -427,52 +420,70 @@@ freeze_pmove_org = pmove_org; freeze_input_angles = input_angles; + // event chase camera + if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped + { + if(spectatee_status >= 0 && (autocvar_cl_eventchase_death && getstati(STAT_HEALTH) <= 0 && !intermission) || (autocvar_cl_eventchase_intermission && intermission)) + { + // We must enable chase_active to get a third person view (weapon viewmodel hidden and own player model showing). + // Ideally, there should be another way to enable third person cameras, such as through R_SetView() + if(!autocvar_chase_active) + cvar_set("chase_active", "-1"); // -1 enables chase_active while marking it as set by this code, and not by the user (which would be 1) + + // make the camera smooth back + if(autocvar_cl_eventchase_speed && eventchase_current_distance < autocvar_cl_eventchase_distance) + eventchase_current_distance += autocvar_cl_eventchase_speed * (autocvar_cl_eventchase_distance - eventchase_current_distance) * frametime; // slow down the further we get + else if(eventchase_current_distance != autocvar_cl_eventchase_distance) + eventchase_current_distance = autocvar_cl_eventchase_distance; + + vector eventchase_target_origin; + makevectors(view_angles); + // pass 1, used to check where the camera would go and obtain the trace_fraction + eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance; + + traceline(pmove_org, eventchase_target_origin, MOVE_WORLDONLY, self); + // pass 2, also multiplying view_forward with trace_fraction, to prevent the camera from going through walls + // The 0.1 subtraction is to not limit the camera precisely at the wall surface, as that allows the view to poke through + eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance * (trace_fraction - 0.1); + + R_SetView(VF_ORIGIN, eventchase_target_origin); + R_SetView(VF_ANGLES, view_angles); + } + else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code + { + cvar_set("chase_active", "0"); + eventchase_current_distance = 0; // start from 0 next time + } + } + // Render the Scene - if(!intermission || !view_set) + if(!intermission || !view_set || (intermission && autocvar_cl_eventchase_intermission)) { - view_origin = pmove_org + vo; - view_angles = input_angles; - makevectors(view_angles); - view_forward = v_forward; - view_right = v_right; - view_up = v_up; - view_set = 1; + #ifdef VEHICLES_CSQC + if(hud) + { + view_origin = vehicle_hudmodel.origin; //pmove_org + vo + randomvec() * 20; + view_angles = input_angles; + R_SetView(VF_ORIGIN, view_origin); + makevectors(view_angles); + view_forward = v_forward; + view_right = v_right; + view_up = v_up; + view_set = 1; + } + else + { + #endif + view_origin = pmove_org + vo; + view_angles = input_angles; + makevectors(view_angles); + view_forward = v_forward; + view_right = v_right; + view_up = v_up; + view_set = 1; + #ifdef VEHICLES_CSQC + } + #endif } #ifdef BLURTEST @@@ -1146,8 -1169,15 +1180,15 @@@ ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring.tga"; } + else if (activeweapon == WEP_HAGAR && getstati(STAT_HAGAR_LOAD) && autocvar_crosshair_ring_hagar) + { + ring_value = bound(0, getstati(STAT_HAGAR_LOAD) / hagar_maxrockets, 1); + ring_alpha = autocvar_crosshair_ring_hagar_alpha; + ring_rgb = wcross_color; + ring_image = "gfx/crosshair_ring.tga"; + } - if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring + if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring { ring_value = bound(0, weapon_clipload / weapon_clipsize, 1); ring_scale = autocvar_crosshair_ring_reload_size; @@@ -1281,6 -1311,298 +1322,7 @@@ R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h); } -#define spider_h "gfx/vehicles/hud_bg.tga" -#define spider_b "gfx/vehicles/sbot.tga" -#define spider_r "gfx/vehicles/sbot_rpods.tga" -#define spider_g "gfx/vehicles/sbot_mguns.tga" -#define spider_s "gfx/vehicles/shiled.tga" -#define spider_a1 "gfx/hud/sb_rocket.tga" -#define spider_a2 "gfx/sb_bullets.tga" - -void CSQC_SPIDER_HUD() -{ - float rockets, reload, heat, hp, shield; - vector picsize, hudloc; - - // Fetch health & ammo stats - hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1); - shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1); - heat = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 2); - rockets = getstati(STAT_VEHICLESTAT_AMMO2); - reload = min(getstatf(STAT_VEHICLESTAT_RELOAD2), 1); - - // Draw the crosshairs - picsize = drawgetimagesize(SPIDER_CROSS); - picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size; - picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size; - drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL); - - hudloc_y = 4; - hudloc_x = 4; - - picsize = drawgetimagesize(spider_h) * 0.5; - drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - picsize = drawgetimagesize(spider_a2) * 0.5; - drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - drawstring(hudloc + '145 19 0', strcat(ftos(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '136 102 0', strcat(ftos(100 - rint(heat * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); - - picsize = drawgetimagesize(spider_a1) * 0.85; - if(rockets == 9) - { - drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '179 69 0', strcat(ftos(9 - rockets), "/8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); - } - - picsize = drawgetimagesize(spider_b) * 0.5; - hudloc_y = 10.5; - hudloc_x = 10.5; - - drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); - drawpic(hudloc, spider_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, spider_r, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, spider_g, picsize, '1 1 1' * (1 - heat) + '1 0 0' * heat, 1, DRAWFLAG_NORMAL); - - - /* - // Draw health bar - p = '0.5 0 0' * (vid_conwidth - (rkt_size * 8)); - p = p + '0 1 0' * vid_conheight - '0 32 0'; - //pp = ('0 1 0' * hp) + ('1 0 0' * (1-hp)); - drawfill(p, '256 0 0' * shield + '0 8 0' , '0.5 0.5 1', 0.75, DRAWFLAG_NORMAL); - p_y += 8; - drawfill(p, '256 0 0' * hp + '0 8 0' , '0 1 0', 0.75, DRAWFLAG_NORMAL); - p_x += 256 * hp; - drawfill(p, '256 0 0' * (1-hp) + '0 8 0' , '0 0 0', 0.75, DRAWFLAG_NORMAL); - - // Draw minigun heat indicator - p = '0.5 0 0' * (vid_conwidth - 256); - p = p + '0 1 0' * vid_conheight - '0 34 0'; - drawfill(p, '256 0 0' * (1-heat) + '0 2 0' ,'0 0 1', 0.5, DRAWFLAG_NORMAL); - p_x += 256 * (1-heat); - drawfill(p, '256 0 0' * heat + '0 2 0' , '1 0 0', 0.5, DRAWFLAG_NORMAL); - - - // Draw rocket icons for loaded/empty tubes. - pp = '0.5 0 0' * (vid_conwidth - (rkt_size * 8)); - pp += '0 1 0' * vid_conheight - '0 64 0'; - for(i = 0; i < 8; ++i) - { - p = pp + '1 0 0' * (rkt_size * i); - if(rockets == 8) - { - if(floor(reload * 8) == i) - { - drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '1 0 0' + '0 1 0' * ((reload*8)-i), 0.75 , DRAWFLAG_NORMAL); - } - else if(i < reload * 8) - drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '1 1 0', 0.75 , DRAWFLAG_NORMAL); - else - drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '0.5 0.5 0.5', 0.75, DRAWFLAG_NORMAL); - } - else - { - if(i < rockets) - drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '0 0 0', 0.25, DRAWFLAG_NORMAL); - else - drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '0 1 0' * reload, 0.75, DRAWFLAG_NORMAL); - } - } - */ - - if (scoreboard_showscores) - { - HUD_DrawScoreboard(); - HUD_DrawCenterPrint(); - } - -} - -#define raptor_h "gfx/vehicles/hud_bg.tga" -#define raptor_b "gfx/vehicles/raptor.tga" -#define raptor_g1 "gfx/vehicles/raptor_guns.tga" -#define raptor_g2 "gfx/vehicles/raptor_bombs.tga" -#define raptor_s "gfx/vehicles/shiled.tga" - -void CSQC_RAPTOR_HUD() -{ - float reload, hp, shield, energy; - vector picsize, hudloc; - - // Fetch health & ammo stats - hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1); - shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1); - reload = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 1); - energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1); - - // Draw the crosshairs - picsize = drawgetimagesize(SPIDER_CROSS); - picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size; - picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size; - drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL); - - hudloc_y = 4; - hudloc_x = 4; - - picsize = drawgetimagesize(raptor_h) * 0.5; - drawpic(hudloc, raptor_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - picsize = drawgetimagesize(spider_a2) * 0.5; - drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - drawstring(hudloc + '145 19 0', strcat(ftos(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL); - - - picsize = drawgetimagesize(spider_a1) * 0.85; - if(reload == 1) - { - drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL); - } - - picsize = drawgetimagesize(raptor_b) * 0.5; - hudloc_y = 10.5; - hudloc_x = 10.5; - - drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); - drawpic(hudloc, raptor_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, raptor_g1, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL); - - - if (scoreboard_showscores) - { - HUD_DrawScoreboard(); - HUD_DrawCenterPrint(); - } - -} - -#define waki_h "gfx/vehicles/hud_bg.tga" -#define waki_b "gfx/vehicles/waki.tga" -#define waki_e "gfx/vehicles/waki_e.tga" -#define waki_g "gfx/vehicles/waki_guns.tga" -#define waki_r "gfx/vehicles/waki_rockets.tga" -#define waki_s "gfx/vehicles/shiled.tga" - -#define waki_a1 "gfx/hud/sb_rocket.tga" -#define waki_a2 "gfx/sb_cells.tga" - -void CSQC_WAKIZASHI_HUD() -{ - // 0--1 floats. 1 = 100%, 0.6 = 50%. - float health, shield, energy, rockets; - vector picsize, hudloc; - - picsize = drawgetimagesize(SPIDER_CROSS); - picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size; - picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size; - drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL); - -/* -const float STAT_VEHICLESTAT_HEALTH = 60; -const float STAT_VEHICLESTAT_SHIELD = 61; -const float STAT_VEHICLESTAT_ENERGY = 62; -const float STAT_VEHICLESTAT_AMMO1 = 63; -const float STAT_VEHICLESTAT_RELAOD1 = 64; -const float STAT_VEHICLESTAT_AMMO2 = 65; -const float STAT_VEHICLESTAT_RELOAD2 = 66; -*/ - health = min(getstatf(STAT_VEHICLESTAT_HEALTH), 1); - shield = min(getstatf(STAT_VEHICLESTAT_SHIELD), 1); - energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1); - rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1); - - hudloc_y = 4; - hudloc_x = 4; - - picsize = drawgetimagesize(waki_h) * 0.5; - drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - picsize = drawgetimagesize(waki_a2) * 0.7; - drawpic(hudloc + '116 92 0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - - drawstring(hudloc + '145 19 0', strcat(ftos(rint(health * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL); - - drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL); - - picsize = drawgetimagesize(waki_a1) * 0.75; - if(rockets == 1) - { - drawpic(hudloc + '140 55 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawpic(hudloc + '144 59 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + '140 55 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL); - drawpic(hudloc + '144 59 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL); - drawstring(hudloc + '165 69 0', strcat(ftos(rint(rockets * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); - } - - picsize = drawgetimagesize(waki_b) * 0.5; - hudloc_y = 10.5; - hudloc_x = 10.5; - - drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_r, picsize, '1 1 1' * rockets + '1 0 0' * (1 - rockets), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - - - - /* - p = '0.5 0 0' * (vid_conwidth - (rkt_size * 8)); - p = p + '0 1 0' * vid_conheight - '0 32 0'; - - // Draw health bar - p_y += 8; - drawfill(p, '256 0 0' * health + '0 8 0' , '0 0.7 0', 0.75, DRAWFLAG_NORMAL); - p_x += 256 * health; - drawfill(p, '256 0 0' * (1 - health) + '0 8 0' , '0 0 0', 0.75, DRAWFLAG_NORMAL); - - // Draw shiled bar - p_x -= 256 * health; - p_y += 4; - drawfill(p, '256 0 0' * shield + '0 4 0' , '0.25 0.25 1', 0.5, DRAWFLAG_NORMAL); - - // Draw energy - //p_x -= 256 * health; - p_y -= 8; - drawfill(p, '256 0 0' * energy + '0 4 0' , '1 1 1', 0.75, DRAWFLAG_NORMAL); - - // Draw rockets bar - p_y += 12; - drawfill(p, '256 0 0' * rockets + '0 4 0' , '1 0 0', 0.75, DRAWFLAG_NORMAL); - */ - - - - - if (scoreboard_showscores) - { - HUD_DrawScoreboard(); - HUD_DrawCenterPrint(); - } - -} + void CSQC_common_hud(void) { // HUD_SortFrags(); done in HUD_Draw diff --cc qcsrc/client/progs.src index d67c9490f,4219eef16..eca41f316 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@@ -29,10 -29,9 +29,11 @@@ movetypes.q prandom.qh bgmscript.qh noise.qh + teamplay.qh main.qh +vehicles/vehicles.qh +../server/vehicles/vehicles_def.qh sortlist.qc miscfunctions.qc @@@ -59,11 -59,9 +61,10 @@@ modeleffects.q tuba.qc target_music.qc - -//vehicles/spiderbot.qc -shownames.qh -shownames.qc +vehicles/vehicles.qc +../server/vehicles/network.qc +../server/vehicles/racer.qc + Main.qc View.qc interpolate.qc diff --cc qcsrc/client/vehicles/vehicles.qc index 8889df798,000000000..1fd027893 mode 100644,000000..100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@@ -1,579 -1,0 +1,592 @@@ +#define spider_rocket_icon "gfx/vehicles/rocket_ico.tga" +#define spider_rocket_targ "gfx/vehicles/target.tga" +//#define SPIDER_CROSS "textures/spiderbot/cross.tga" +#define SPIDER_CROSS "gfx/vehicles/axh-special1.tga" + +/* +#define axh1 "gfx/vehicles/sbot-xhair2.tga" +#define axh2 "gfx/vehicles/sbot-xhair2.tga" +#define axh3 "gfx/vehicles/sbot-xhair2.tga" +*/ + +#define hud_bg "gfx/vehicles/frame.tga" +#define hud_sh "gfx/vehicles/vh-shield.tga" + +#define hud_hp_bar "gfx/vehicles/bar_up_left.tga" +#define hud_hp_ico "gfx/vehicles/health.tga" +#define hud_sh_bar "gfx/vehicles/bar_dwn_left.tga" +#define hud_sh_ico "gfx/vehicles/shield.tga" + +#define hud_ammo1_bar "gfx/vehicles/bar_up_right.tga" +#define hud_ammo1_ico "gfx/vehicles/bullets.tga" +#define hud_ammo2_bar "gfx/vehicles/bar_dwn_right.tga" +#define hud_ammo2_ico "gfx/vehicles/rocket.tga" + +#define spider_ico "gfx/vehicles/sbot.tga" +#define spider_rkt "gfx/vehicles/sbot_rpods.tga" +#define spider_mgun "gfx/vehicles/sbot_mguns.tga" + +#define raptor_ico "gfx/vehicles/raptor.tga" +#define raptor_gun "gfx/vehicles/raptor_guns.tga" +#define raptor_bomb "gfx/vehicles/raptor_bombs.tga" +#define raptor_drop "gfx/vehicles/axh-dropcross.tga" + +#define waki_ico "gfx/vehicles/waki.tga" +#define waki_eng "gfx/vehicles/waki_e.tga" +#define waki_gun "gfx/vehicles/waki_guns.tga" +#define waki_rkt "gfx/vehicles/waki_rockets.tga" + +entity dropmark; + +void CSQC_WAKIZASHI_HUD(); +void CSQC_SPIDER_HUD(); +void CSQC_RAPTOR_HUD(); +void CSQC_BUMBLE_HUD(); + +#define MAX_AXH 4 +entity AuxiliaryXhair[MAX_AXH]; +const var void Draw_Not(); + +.string axh_image; +.float axh_fadetime; +.float axh_drawflag; +.float axh_scale; + +void AuxiliaryXhair_Draw2D() +{ + vector loc, psize; + + psize = self.axh_scale * drawgetimagesize(self.axh_image); + loc = project_3d_to_2d(self.origin) - 0.5 * psize; + if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight) + { + loc_z = 0; + psize_z = 0; + drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag); + } + + if(time - self.cnt > self.axh_fadetime) + self.draw2d = Draw_Not; +} + +void Net_AuXair2(float bIsNew) +{ + float axh_id; + entity axh; + + axh_id = bound(0, ReadByte(), MAX_AXH); + axh = AuxiliaryXhair[axh_id]; + + if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) + { + axh = spawn(); + axh.draw2d = Draw_Not; + axh.drawmask = MASK_NORMAL; + axh.axh_drawflag = DRAWFLAG_ADDITIVE; + axh.axh_fadetime = 0.1; + axh.axh_image = "gfx/vehicles/axh-ring.tga"; + axh.axh_scale = 1; + axh.alpha = 1; + AuxiliaryXhair[axh_id] = axh; + } + + axh.draw2d = AuxiliaryXhair_Draw2D; + + axh.origin_x = ReadCoord(); + axh.origin_y = ReadCoord(); + axh.origin_z = ReadCoord(); + + axh.colormod_x = ReadByte() / 255; + axh.colormod_y = ReadByte() / 255; + axh.colormod_z = ReadByte() / 255; + axh.cnt = time; +} + +void Net_VehicleSetup() +{ + + float hud_id, i; + hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR); + + // Init auxiliary crosshairs + entity axh; + for(i = 0; i < MAX_AXH; ++i) + { + axh = AuxiliaryXhair[i]; + if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) + remove(axh); + + axh = spawn(); + axh.draw2d = Draw_Not; + axh.drawmask = MASK_NORMAL; + axh.axh_drawflag = DRAWFLAG_ADDITIVE; + axh.axh_fadetime = 0.1; + axh.axh_image = "gfx/vehicles/axh-ring.tga"; + axh.axh_scale = 1; + axh.alpha = 1; + AuxiliaryXhair[i] = axh; + } + + switch(hud_id) + { + case HUD_SPIDERBOT: + // Minigun1 + AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga"; + AuxiliaryXhair[0].axh_scale = 0.25; + // Minigun2 + AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga"; + AuxiliaryXhair[1].axh_scale = 0.25; + // Rocket + AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga"; + AuxiliaryXhair[2].axh_scale = 0.5; + break; + + case HUD_WAKIZASHI: + AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga"; + AuxiliaryXhair[0].axh_scale = 0.25; + break; + + case HUD_RAPTOR: + AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-cross.tga"; + AuxiliaryXhair[0].axh_scale = 0.5; + AuxiliaryXhair[0].alpha = 0.25; + + AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga"; + AuxiliaryXhair[1].axh_scale = 0.25; + AuxiliaryXhair[1].alpha = 0.75; + AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL; + break; + + case HUD_BUMBLEBEE: + // Plasma cannons + AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga"; + AuxiliaryXhair[0].axh_scale = 0.25; + // Raygun + AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-special1.tga"; + AuxiliaryXhair[1].axh_scale = 0.25; + break; + } +} +#define HUD_GETSTATS \ + float health = getstati(STAT_VEHICLESTAT_HEALTH); \ + float shield = getstati(STAT_VEHICLESTAT_SHIELD); \ + float energy = getstati(STAT_VEHICLESTAT_ENERGY); \ + float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \ + float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \ + float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \ + float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2); + +void CSQC_BUMBLE_HUD() +{ + /* + vector picsize, hudloc; + + // Fetch health & ammo stats + HUD_GETSTATS + + hudloc_y = 4; + hudloc_x = 4; + + picsize = drawgetimagesize(spider_h) * 0.5; + drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + picsize = drawgetimagesize(spider_a2) * 0.5; + drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); + + picsize = drawgetimagesize(spider_a1) * 0.85; + if(ammo2 == 9) + { + drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); + } + + picsize = drawgetimagesize(spider_b) * 0.5; + hudloc_y = 10.5; + hudloc_x = 10.5; + + ammo1 /= 100; + shield /= 100; + health /= 100; + reload2 /= 100; + + drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); + drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, spider_g, picsize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL); + + + if (scoreboard_showscores) + { + HUD_DrawScoreboard(); + HUD_DrawCenterPrint(); + } + else + { + picsize = drawgetimagesize(SPIDER_CROSS); + picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size; + picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size; + + drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE); + */ +} + +float autocvar_cl_vehicles_hudscale; ++float autocvar_cl_vehicles_hudalpha; ++float flashtime; +void CSQC_SPIDER_HUD() +{ + vector picsize, hudloc, pic2size, picloc; + - - + // Fetch health & ammo stats + HUD_GETSTATS + + picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + hudloc_y = vid_conheight - picsize_y; + hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5; + - drawpic(hudloc, hud_bg, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - //picsize = drawgetimagesize(spider_a2) * 0.5; - //drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); ++ drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); + + //drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL); + //drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL); + //drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); ++ //drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); + - pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - if(ammo2 == 9) - { - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '-1 -1 -1', 1, DRAWFLAG_NORMAL); - //drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); - } - else - { - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); - //drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); - } - - ammo1 /= 100; - shield /= 100; - health /= 100; - reload2 /= 100; ++ ammo1 *= 0.01; ++ shield *= 0.01; ++ health *= 0.01; ++ reload2 *= 0.01; + - pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale - 0.1); ++ pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + picloc = picsize * 0.5 - pic2size * 0.5; - drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL); ++ drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); ++ drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL); ++ drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); + - - // Health icon & bar - picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; - picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; - drawpic(hudloc + picloc, hud_hp_ico, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); - ++// Health bar + picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; - //drawsetcliparea(0, 0, hudloc_x + (picsize_x * shield), vid_conheight); - drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', health, DRAWFLAG_NORMAL); - //drawresetcliparea(); - - // Shield icon & bar - picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; - drawpic(hudloc + picloc, hud_sh_ico, picsize,'0.15 0.25 1' * shield + '0 0 0' * (1 - shield), 1, DRAWFLAG_NORMAL); ++ drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - health)), 0, vid_conwidth, vid_conheight); ++ drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); ++ drawresetcliparea(); ++// .. and icon ++ picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; ++ picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; ++ if(health < 0.25) ++ drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); ++ else ++ drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + ++// Shield bar + picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; - //drawsetcliparea(0, 0, hudloc_x + (picsize_x * shield), vid_conheight); - drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); - //drawresetcliparea(); - - - // Minigun ammo icon & bar - picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; - drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL); ++ drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight); ++ drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); ++ drawresetcliparea(); ++// .. and icon ++ picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; ++ picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; ++ if(shield < 0.25) ++ drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); ++ else ++ drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + ++ // Minigun bar + picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(picloc_x, picloc_y, hudloc_x + (picsize_x * ammo1), vid_conheight); - drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', health, DRAWFLAG_NORMAL); ++ drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight); ++ drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); ++ // .. and icon ++ picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; ++ picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; ++ if(ammo1 < 0.2) ++ drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); ++ else ++ drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + ++ // Rocket ammo bar ++ float i; ++ picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; ++ ammo1 = picsize_x / 8; ++ picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; ++ drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight); ++ drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); ++ drawresetcliparea(); + - // Rocket ammo icon and bar - /* ++ // .. and icon/s ++ pic2size = 0.35 * drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; ++ picloc_x -= pic2size_x; ++ picloc_y += pic2size_y * 2.25; ++ if(ammo2 == 9) ++ { ++ for(i = 1; i < 9; ++i) ++ { ++ picloc_x += ammo1; ++ drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL); ++ } ++ } ++ else ++ { ++ for(i = 1; i < 9; ++i) ++ { ++ picloc_x += ammo1; ++ drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL); ++ } ++ } ++ pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - picsize = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - drawpic(hudloc + picloc, hud_ammo2_ico, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL); - */ ++ if(ammo2 == 9) ++ 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); + - picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; - //drawsetcliparea(0, 0, hudloc_x + (picsize_x * shield), vid_conheight); - drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', health, DRAWFLAG_NORMAL); - //drawresetcliparea(); ++ ++ HUD_DrawCenterPrint(); + + if (scoreboard_showscores) - { + HUD_DrawScoreboard(); - HUD_DrawCenterPrint(); - } + else + { + picsize = drawgetimagesize(SPIDER_CROSS); + picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size; + picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size; + + drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE); + } +} + + +void CSQC_RAPTOR_HUD() +{ +/* + if(autocvar_r_letterbox) + return; + + vector picsize, hudloc; + vector where; + + + // Fetch health & ammo stats + HUD_GETSTATS + + // Draw the crosshairs + picsize = drawgetimagesize("gfx/vehicles/axh-cross.tga"); + picsize_x *= 0.75; + picsize_y *= 0.75; + drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), "gfx/vehicles/axh-cross.tga", picsize, '1 0 0' + '0 1 1' * energy, 0.5, DRAWFLAG_ADDITIVE); + + hudloc_y = 4; + hudloc_x = 4; + + picsize = drawgetimagesize(raptor_h) * 0.5; + drawpic(hudloc, raptor_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + picsize = drawgetimagesize(spider_a2) * 0.5; + drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '136 102 0', strcat(ftos(energy), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL); + + health /= 100; + shield /= 100; + energy /= 100; + + picsize = drawgetimagesize(spider_a1) * 0.85; + if(reload2 == 100) + { + drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL); + } + + picsize = drawgetimagesize(raptor_b) * 0.5; + hudloc_y = 10.5; + hudloc_x = 10.5; + reload1 = reload2 / 100; + drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); + drawpic(hudloc, raptor_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, raptor_g1, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); + + if(!dropmark) + { + dropmark = spawn(); + dropmark.owner = self; + dropmark.gravity = 1; + } + + if(reload2 == 100) + { + where = dropmark.origin; + setorigin(dropmark, pmove_org); + dropmark.velocity = pmove_vel; + tracetoss(dropmark, self); + + where = project_3d_to_2d(trace_endpos); + + setorigin(dropmark, trace_endpos); + picsize = drawgetimagesize(raptor_d) * 0.2; + + if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight) + { + where_x -= picsize_x * 0.5; + where_y -= picsize_y * 0.5; + where_z = 0; + drawpic(where, raptor_d, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE); + } + dropmark.cnt = time + 5; + } + else + { + if(dropmark.cnt > time) + { + where = project_3d_to_2d(dropmark.origin); + picsize = drawgetimagesize(raptor_d) * 0.25; + + if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight) + { + where_x -= picsize_x * 0.5; + where_y -= picsize_y * 0.5; + where_z = 0; + drawpic(where, raptor_d, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE); + } + } + } + + if (scoreboard_showscores) + { + HUD_DrawScoreboard(); + HUD_DrawCenterPrint(); + } +*/ +} + +void CSQC_WAKIZASHI_HUD() +{ +/* + vector picsize, hudloc; + + picsize = drawgetimagesize(SPIDER_CROSS); + picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size; + picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size; + drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL); + + HUD_GETSTATS + + hudloc_y = 4; + hudloc_x = 4; + + picsize = drawgetimagesize(waki_h) * 0.5; + drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + picsize = drawgetimagesize(waki_a2) * 0.7; + drawpic(hudloc + '116 92 0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + + drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '136 102 0', strcat(ftos(energy), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL); + + picsize = drawgetimagesize(waki_a1) * 0.75; + if(reload1 == 100) + { + drawpic(hudloc + '140 55 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawpic(hudloc + '144 59 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + '140 55 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL); + drawpic(hudloc + '144 59 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL); + drawstring(hudloc + '165 69 0', strcat(ftos(reload1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL); + } + + picsize = drawgetimagesize(waki_b) * 0.5; + hudloc_y = 10.5; + hudloc_x = 10.5; + + health /= 100; + energy /= 100; + shield /= 100; + reload1 /= 100; + + drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + + if (scoreboard_showscores) + { + HUD_DrawScoreboard(); + HUD_DrawCenterPrint(); + } +*/ +} + +void Vehicles_Precache() +{ + precache_model("models/vehicles/wakizashi.dpm"); + + precache_model("models/vehicles/bomblet.md3"); + precache_model("models/vehicles/clusterbomb.md3"); + precache_model("models/vehicles/clusterbomb_fragment.md3"); + precache_model("models/vehicles/rocket01.md3"); + precache_model("models/vehicles/rocket02.md3"); +} + +void RaptorCBShellfragDraw() +{ + Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy); + if(wasfreed(self)) + return; + + self.move_avelocity += randomvec() * 15; + self.renderflags = 0; + if(self.cnt < time) + self.alpha = bound(0, self.nextthink - time, 1); + + if(self.alpha < ALPHA_MIN_VISIBLE) + remove(self); + +} + +void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang) +{ + entity sfrag; + + sfrag = spawn(); + setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3"); + setorigin(sfrag, _org); + + sfrag.move_movetype = MOVETYPE_BOUNCE; + sfrag.gravity = 0.15; + sfrag.solid = SOLID_CORPSE; + + sfrag.draw = RaptorCBShellfragDraw; + + sfrag.move_origin = sfrag.origin = _org; + sfrag.move_velocity = _vel; + sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity); + sfrag.angles = self.move_angles = _ang; + + sfrag.move_time = time; + sfrag.damageforcescale = 4; + + sfrag.nextthink = time + 3; + sfrag.cnt = time + 2; + sfrag.drawmask = MASK_NORMAL; +} diff --cc qcsrc/common/constants.qh index cbcec2cd3,507cff85a..6643fab8c --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@@ -63,7 -63,7 +63,11 @@@ const float TE_CSQC_NOTIFY = 112 const float TE_CSQC_WEAPONCOMPLAIN = 113; const float TE_CSQC_NEX_SCOPE = 116; const float TE_CSQC_MINELAYER_MAXMINES = 117; ++<<<<<<< HEAD +const float TE_CSQC_VEHICLESETUP = 119; ++======= + const float TE_CSQC_HAGAR_MAXROCKETS = 118; ++>>>>>>> origin/master const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder const float RACE_NET_CHECKPOINT_CLEAR = 1; @@@ -114,10 -114,10 +118,12 @@@ const float ENT_CLIENT_HOOK = 27 const float ENT_CLIENT_LGBEAM = 28; const float ENT_CLIENT_GAUNTLET = 29; const float ENT_CLIENT_ACCURACY = 30; + const float ENT_CLIENT_SHOWNAMES = 31; + const float ENT_CLIENT_WARPZONE_TELEPORTED = 32; const float ENT_CLIENT_TURRET = 40; +const float ENT_CLIENT_AUXILIARYXHAIR = 50; +const float ENT_CLIENT_VEHICLE = 60; const float SPRITERULE_DEFAULT = 0; const float SPRITERULE_TEAMPLAY = 1; @@@ -361,6 -358,18 +368,16 @@@ const float STAT_PINKALIVE = 103 const float STAT_FROZEN = 104; const float STAT_REVIVE_PROGRESS = 105; ++ + const float STAT_DOM_TOTAL_PPS = 100; + const float STAT_DOM_PPS_RED = 101; + const float STAT_DOM_PPS_BLUE = 102; + const float STAT_DOM_PPS_PINK = 103; + const float STAT_DOM_PPS_YELLOW = 104; + + //const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin + //const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin + - - - // moved that here so the client knows the max. // # of maps, I'll use arrays for them :P #define MAPVOTE_COUNT 10