1 #define hud_bg "gfx/vehicles/frame.tga"
2 #define hud_sh "gfx/vehicles/vh-shield.tga"
4 #define hud_hp_bar "gfx/vehicles/bar_up_left.tga"
5 #define hud_hp_ico "gfx/vehicles/health.tga"
6 #define hud_sh_bar "gfx/vehicles/bar_dwn_left.tga"
7 #define hud_sh_ico "gfx/vehicles/shield.tga"
9 #define hud_ammo1_bar "gfx/vehicles/bar_up_right.tga"
10 #define hud_ammo1_ico "gfx/vehicles/bullets.tga"
11 #define hud_ammo2_bar "gfx/vehicles/bar_dwn_right.tga"
12 #define hud_ammo2_ico "gfx/vehicles/rocket.tga"
15 float autocvar_cl_vehicles_hudscale;
16 float autocvar_cl_vehicles_hudalpha;
19 void CSQC_WAKIZASHI_HUD();
20 void CSQC_SPIDER_HUD();
21 void CSQC_RAPTOR_HUD();
22 void CSQC_BUMBLE_HUD();
25 entity AuxiliaryXhair[MAX_AXH];
26 const var void Draw_Not();
33 void AuxiliaryXhair_Draw2D()
37 psize = self.axh_scale * drawgetimagesize(self.axh_image);
38 loc = project_3d_to_2d(self.origin) - 0.5 * psize;
39 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
43 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
46 if(time - self.cnt > self.axh_fadetime)
47 self.draw2d = Draw_Not;
50 void Net_AuXair2(float bIsNew)
55 axh_id = bound(0, ReadByte(), MAX_AXH);
56 axh = AuxiliaryXhair[axh_id];
58 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
61 axh.draw2d = Draw_Not;
62 axh.drawmask = MASK_NORMAL;
63 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
64 axh.axh_fadetime = 0.1;
65 axh.axh_image = "gfx/vehicles/axh-ring.tga";
68 AuxiliaryXhair[axh_id] = axh;
71 axh.draw2d = AuxiliaryXhair_Draw2D;
73 axh.origin_x = ReadCoord();
74 axh.origin_y = ReadCoord();
75 axh.origin_z = ReadCoord();
77 axh.colormod_x = ReadByte() / 255;
78 axh.colormod_y = ReadByte() / 255;
79 axh.colormod_z = ReadByte() / 255;
83 void Net_VehicleSetup()
87 hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
89 // Init auxiliary crosshairs
91 for(i = 0; i < MAX_AXH; ++i)
93 axh = AuxiliaryXhair[i];
94 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
98 axh.draw2d = Draw_Not;
99 axh.drawmask = MASK_NORMAL;
100 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
101 axh.axh_fadetime = 0.1;
102 axh.axh_image = "gfx/vehicles/axh-ring.tga";
105 AuxiliaryXhair[i] = axh;
112 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
113 AuxiliaryXhair[0].axh_scale = 0.25;
115 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
116 AuxiliaryXhair[1].axh_scale = 0.25;
118 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
119 AuxiliaryXhair[2].axh_scale = 0.5;
123 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
124 AuxiliaryXhair[0].axh_scale = 0.25;
128 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-cross.tga";
129 AuxiliaryXhair[0].axh_scale = 0.5;
130 AuxiliaryXhair[0].alpha = 0.25;
132 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
133 AuxiliaryXhair[1].axh_scale = 0.25;
134 AuxiliaryXhair[1].alpha = 0.75;
135 AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
140 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
141 AuxiliaryXhair[0].axh_scale = 0.25;
143 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-special1.tga";
144 AuxiliaryXhair[1].axh_scale = 0.25;
148 #define HUD_GETSTATS \
149 float health = getstati(STAT_VEHICLESTAT_HEALTH); \
150 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
151 float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
152 float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
153 float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
154 float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
155 float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
157 void CSQC_BUMBLE_HUD()
160 vector picsize, hudloc;
162 // Fetch health & ammo stats
168 picsize = drawgetimagesize(spider_h) * 0.5;
169 drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
171 picsize = drawgetimagesize(spider_a2) * 0.5;
172 drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
174 drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
175 drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
176 drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
178 picsize = drawgetimagesize(spider_a1) * 0.85;
181 drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
182 drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
186 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
187 drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
190 picsize = drawgetimagesize(spider_b) * 0.5;
199 drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
200 drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
201 drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
202 drawpic(hudloc, spider_g, picsize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
205 if (scoreboard_showscores)
207 HUD_DrawScoreboard();
208 HUD_DrawCenterPrint();
212 picsize = drawgetimagesize(SPIDER_CROSS);
213 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
214 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
216 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);
221 #define spider_ico "gfx/vehicles/sbot.tga"
222 #define spider_rkt "gfx/vehicles/sbot_rpods.tga"
223 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
224 #define spider_xhair "gfx/vehicles/axh-special1.tga"
225 void CSQC_SPIDER_HUD()
227 if(autocvar_r_letterbox)
230 vector picsize, hudloc, pic2size, picloc;
233 // Fetch health & ammo stats
236 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
237 hudloc_y = vid_conheight - picsize_y;
238 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
240 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
242 //drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
243 //drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
244 //drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
245 //drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
252 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
253 picloc = picsize * 0.5 - pic2size * 0.5;
254 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
255 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
256 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
257 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
260 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
261 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
262 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - health)), 0, vid_conwidth, vid_conheight);
263 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
266 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
267 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
269 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
271 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
274 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
275 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
276 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
277 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
280 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
281 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
283 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
285 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
288 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
289 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
290 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
291 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
294 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
295 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
297 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
299 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
302 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
303 ammo1 = picsize_x / 8;
304 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
305 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
306 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
310 pic2size = 0.35 * drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
311 picloc_x -= pic2size_x;
312 picloc_y += pic2size_y * 2.25;
315 for(i = 1; i < 9; ++i)
318 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
323 for(i = 1; i < 9; ++i)
326 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
329 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
330 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
332 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
334 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
337 HUD_DrawCenterPrint();
339 if (scoreboard_showscores)
340 HUD_DrawScoreboard();
343 picsize = drawgetimagesize(spider_xhair);
344 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
345 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
347 drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), spider_xhair, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE);
351 #define raptor_ico "gfx/vehicles/raptor.tga"
352 #define raptor_gun "gfx/vehicles/raptor_guns.tga"
353 #define raptor_bomb "gfx/vehicles/raptor_bombs.tga"
354 #define raptor_drop "gfx/vehicles/axh-dropcross.tga"
355 #define raptor_xhair "gfx/vehicles/axh-cross.tga"
356 void CSQC_RAPTOR_HUD()
358 if(autocvar_r_letterbox)
361 vector picsize, hudloc, pic2size, picloc;
363 // Fetch health & ammo stats
366 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
367 hudloc_y = vid_conheight - picsize_y;
368 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
370 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
377 reload1 = reload2 * 0.01;
380 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
381 picloc = picsize * 0.5 - pic2size * 0.5;
382 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
383 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
384 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
385 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
388 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
389 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
390 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - health)), 0, vid_conwidth, vid_conheight);
391 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
394 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
395 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
397 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
399 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
402 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
403 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
404 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
405 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
408 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
409 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
411 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
413 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
416 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
417 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
418 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
419 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
422 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
423 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
425 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
427 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
430 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
431 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
432 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
433 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
436 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
437 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
439 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
441 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
447 dropmark.owner = self;
448 dropmark.gravity = 1;
455 setorigin(dropmark, pmove_org);
456 dropmark.velocity = pmove_vel;
457 tracetoss(dropmark, self);
459 where = project_3d_to_2d(trace_endpos);
461 setorigin(dropmark, trace_endpos);
462 picsize = drawgetimagesize(raptor_drop) * 0.2;
464 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
466 where_x -= picsize_x * 0.5;
467 where_y -= picsize_y * 0.5;
469 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
471 dropmark.cnt = time + 5;
476 if(dropmark.cnt > time)
478 where = project_3d_to_2d(dropmark.origin);
479 picsize = drawgetimagesize(raptor_drop) * 0.25;
481 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
483 where_x -= picsize_x * 0.5;
484 where_y -= picsize_y * 0.5;
486 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
491 HUD_DrawCenterPrint();
493 if (scoreboard_showscores)
494 HUD_DrawScoreboard();
497 picsize = drawgetimagesize(raptor_xhair);
501 drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), raptor_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
505 #define waki_ico "gfx/vehicles/waki.tga"
506 #define waki_eng "gfx/vehicles/waki_e.tga"
507 #define waki_gun "gfx/vehicles/waki_guns.tga"
508 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
509 #define waki_xhair "gfx/vehicles/axh-special1.tga"
510 void CSQC_WAKIZASHI_HUD()
513 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
514 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
515 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
516 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
518 if(autocvar_r_letterbox)
521 vector picsize, hudloc, pic2size, picloc;
523 // Fetch health & ammo stats
526 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
527 hudloc_y = vid_conheight - picsize_y;
528 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
530 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
537 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
538 picloc = picsize * 0.5 - pic2size * 0.5;
539 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
540 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
541 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
542 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
543 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
546 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
547 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
548 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - health)), 0, vid_conwidth, vid_conheight);
549 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
552 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
553 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
555 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
557 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
560 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
561 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
562 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
563 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
566 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
567 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
569 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
571 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
574 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
575 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
576 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
577 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
580 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
581 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
583 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
585 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
588 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
589 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
590 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
591 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
594 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
595 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
597 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
599 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
602 HUD_DrawCenterPrint();
604 if (scoreboard_showscores)
605 HUD_DrawScoreboard();
608 picsize = drawgetimagesize(waki_xhair);
612 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);
616 void Vehicles_Precache()
618 // HAAAAKKKZZZ!!!!!!!!!!!!
619 autocvar_cl_vehicles_hudscale = 0.5;
620 autocvar_cl_vehicles_hudalpha = 0.75;
623 precache_model("models/vehicles/wakizashi.dpm");
625 precache_model("models/vehicles/bomblet.md3");
626 precache_model("models/vehicles/clusterbomb.md3");
627 precache_model("models/vehicles/clusterbomb_fragment.md3");
628 precache_model("models/vehicles/rocket01.md3");
629 precache_model("models/vehicles/rocket02.md3");
632 void RaptorCBShellfragDraw()
635 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
639 self.move_avelocity += randomvec() * 15;
640 self.renderflags = 0;
642 self.alpha = bound(0, self.nextthink - time, 1);
644 if(self.alpha < ALPHA_MIN_VISIBLE)
648 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
653 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
654 setorigin(sfrag, _org);
656 sfrag.move_movetype = MOVETYPE_BOUNCE;
657 sfrag.gravity = 0.15;
658 sfrag.solid = SOLID_CORPSE;
660 sfrag.draw = RaptorCBShellfragDraw;
662 sfrag.move_origin = sfrag.origin = _org;
663 sfrag.move_velocity = _vel;
664 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
665 sfrag.angles = self.move_angles = _ang;
667 sfrag.move_time = time;
668 sfrag.damageforcescale = 4;
670 sfrag.nextthink = time + 3;
671 sfrag.cnt = time + 2;
673 sfrag.drawmask = MASK_NORMAL;