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"
16 void CSQC_WAKIZASHI_HUD();
17 void CSQC_SPIDER_HUD();
18 void CSQC_RAPTOR_HUD();
19 void CSQC_BUMBLE_HUD();
22 entity AuxiliaryXhair[MAX_AXH];
23 const var void Draw_Not();
30 void AuxiliaryXhair_Draw2D()
34 psize = self.axh_scale * drawgetimagesize(self.axh_image);
35 loc = project_3d_to_2d(self.origin) - 0.5 * psize;
36 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
40 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
43 if(time - self.cnt > self.axh_fadetime)
44 self.draw2d = Draw_Not;
47 void Net_AuXair2(float bIsNew)
52 axh_id = bound(0, ReadByte(), MAX_AXH);
53 axh = AuxiliaryXhair[axh_id];
55 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
58 axh.draw2d = Draw_Not;
59 axh.drawmask = MASK_NORMAL;
60 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
61 axh.axh_fadetime = 0.1;
62 axh.axh_image = "gfx/vehicles/axh-ring.tga";
65 AuxiliaryXhair[axh_id] = axh;
68 axh.draw2d = AuxiliaryXhair_Draw2D;
70 axh.origin_x = ReadCoord();
71 axh.origin_y = ReadCoord();
72 axh.origin_z = ReadCoord();
74 axh.colormod_x = ReadByte() / 255;
75 axh.colormod_y = ReadByte() / 255;
76 axh.colormod_z = ReadByte() / 255;
80 void Net_VehicleSetup()
84 hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
86 // Init auxiliary crosshairs
88 for(i = 0; i < MAX_AXH; ++i)
90 axh = AuxiliaryXhair[i];
91 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
95 axh.draw2d = Draw_Not;
96 axh.drawmask = MASK_NORMAL;
97 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
98 axh.axh_fadetime = 0.1;
99 axh.axh_image = "gfx/vehicles/axh-ring.tga";
102 AuxiliaryXhair[i] = axh;
109 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
110 AuxiliaryXhair[0].axh_scale = 0.25;
112 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
113 AuxiliaryXhair[1].axh_scale = 0.25;
115 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
116 AuxiliaryXhair[2].axh_scale = 0.5;
120 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
121 AuxiliaryXhair[0].axh_scale = 0.25;
125 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-cross.tga";
126 AuxiliaryXhair[0].axh_scale = 0.5;
127 AuxiliaryXhair[0].alpha = 0.25;
129 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
130 AuxiliaryXhair[1].axh_scale = 0.25;
131 AuxiliaryXhair[1].alpha = 0.75;
132 AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
137 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
138 AuxiliaryXhair[0].axh_scale = 0.25;
140 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-special1.tga";
141 AuxiliaryXhair[1].axh_scale = 0.25;
145 #define HUD_GETSTATS \
146 float health = getstati(STAT_VEHICLESTAT_HEALTH); \
147 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
148 float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
149 float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
150 float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
151 float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
152 float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
154 void CSQC_BUMBLE_HUD()
157 vector picsize, hudloc;
159 // Fetch health & ammo stats
165 picsize = drawgetimagesize(spider_h) * 0.5;
166 drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
168 picsize = drawgetimagesize(spider_a2) * 0.5;
169 drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
171 drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
172 drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
173 drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
175 picsize = drawgetimagesize(spider_a1) * 0.85;
178 drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
179 drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
183 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
184 drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
187 picsize = drawgetimagesize(spider_b) * 0.5;
196 drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
197 drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
198 drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
199 drawpic(hudloc, spider_g, picsize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
202 if (scoreboard_showscores)
204 HUD_DrawScoreboard();
205 HUD_DrawCenterPrint();
209 picsize = drawgetimagesize(SPIDER_CROSS);
210 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
211 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
213 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);
218 #define spider_ico "gfx/vehicles/sbot.tga"
219 #define spider_rkt "gfx/vehicles/sbot_rpods.tga"
220 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
221 #define spider_xhair "gfx/vehicles/axh-special1.tga"
223 float autocvar_cl_vehicles_hudscale;
224 float autocvar_cl_vehicles_hudalpha;
226 void CSQC_SPIDER_HUD()
228 if(autocvar_r_letterbox)
231 vector picsize, hudloc, pic2size, picloc;
234 // Fetch health & ammo stats
237 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
238 hudloc_y = vid_conheight - picsize_y;
239 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
241 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
243 //drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
244 //drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
245 //drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
246 //drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
253 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
254 picloc = picsize * 0.5 - pic2size * 0.5;
255 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
256 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
257 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
258 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
261 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
262 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
263 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - health)), 0, vid_conwidth, vid_conheight);
264 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
267 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
268 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
270 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
272 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
275 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
276 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
277 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
278 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
281 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
282 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
284 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
286 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
289 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
290 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
291 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
292 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
295 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
296 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
298 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
300 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
303 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
304 ammo1 = picsize_x / 8;
305 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
306 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
307 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
311 pic2size = 0.35 * drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
312 picloc_x -= pic2size_x;
313 picloc_y += pic2size_y * 2.25;
316 for(i = 1; i < 9; ++i)
319 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
324 for(i = 1; i < 9; ++i)
327 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
330 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
331 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
333 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
335 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
338 HUD_DrawCenterPrint();
340 if (scoreboard_showscores)
341 HUD_DrawScoreboard();
344 picsize = drawgetimagesize(spider_xhair);
345 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
346 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
348 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);
352 #define raptor_ico "gfx/vehicles/raptor.tga"
353 #define raptor_gun "gfx/vehicles/raptor_guns.tga"
354 #define raptor_bomb "gfx/vehicles/raptor_bombs.tga"
355 #define raptor_drop "gfx/vehicles/axh-dropcross.tga"
356 #define raptor_xhair "gfx/vehicles/axh-cross.tga"
357 void CSQC_RAPTOR_HUD()
359 if(autocvar_r_letterbox)
362 vector picsize, hudloc, pic2size, picloc;
364 // Fetch health & ammo stats
367 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
368 hudloc_y = vid_conheight - picsize_y;
369 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
371 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
378 reload1 = reload2 * 0.01;
381 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
382 picloc = picsize * 0.5 - pic2size * 0.5;
383 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
384 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
385 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
386 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
389 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
390 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
391 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - health)), 0, vid_conwidth, vid_conheight);
392 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
395 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
396 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
398 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
400 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
403 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
404 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
405 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
406 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
409 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
410 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
412 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
414 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
417 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
418 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
419 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
420 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
423 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
424 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
426 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
428 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
431 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
432 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
433 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
434 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
437 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
438 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
440 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
442 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
448 dropmark.owner = self;
449 dropmark.gravity = 1;
456 setorigin(dropmark, pmove_org);
457 dropmark.velocity = pmove_vel;
458 tracetoss(dropmark, self);
460 where = project_3d_to_2d(trace_endpos);
462 setorigin(dropmark, trace_endpos);
463 picsize = drawgetimagesize(raptor_drop) * 0.2;
465 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
467 where_x -= picsize_x * 0.5;
468 where_y -= picsize_y * 0.5;
470 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
472 dropmark.cnt = time + 5;
477 if(dropmark.cnt > time)
479 where = project_3d_to_2d(dropmark.origin);
480 picsize = drawgetimagesize(raptor_drop) * 0.25;
482 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
484 where_x -= picsize_x * 0.5;
485 where_y -= picsize_y * 0.5;
487 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
492 HUD_DrawCenterPrint();
494 if (scoreboard_showscores)
495 HUD_DrawScoreboard();
498 picsize = drawgetimagesize(raptor_xhair);
502 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);
506 #define waki_ico "gfx/vehicles/waki.tga"
507 #define waki_eng "gfx/vehicles/waki_e.tga"
508 #define waki_gun "gfx/vehicles/waki_guns.tga"
509 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
510 #define waki_xhair "gfx/vehicles/axh-special1.tga"
511 void CSQC_WAKIZASHI_HUD()
514 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
515 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
516 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
517 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
519 if(autocvar_r_letterbox)
522 vector picsize, hudloc, pic2size, picloc;
524 // Fetch health & ammo stats
527 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
528 hudloc_y = vid_conheight - picsize_y;
529 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
531 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
538 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
539 picloc = picsize * 0.5 - pic2size * 0.5;
540 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
541 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
542 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
543 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
544 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
547 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
548 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
549 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - health)), 0, vid_conwidth, vid_conheight);
550 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
553 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
554 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
556 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
558 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
561 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
562 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
563 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
564 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
567 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
568 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
570 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
572 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
575 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
576 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
577 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
578 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
581 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
582 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
584 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
586 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
589 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
590 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
591 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
592 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
595 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
596 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
598 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
600 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
603 HUD_DrawCenterPrint();
605 if (scoreboard_showscores)
606 HUD_DrawScoreboard();
609 picsize = drawgetimagesize(waki_xhair);
613 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);
617 void Vehicles_Precache()
619 precache_model("models/vehicles/wakizashi.dpm");
621 precache_model("models/vehicles/bomblet.md3");
622 precache_model("models/vehicles/clusterbomb.md3");
623 precache_model("models/vehicles/clusterbomb_fragment.md3");
624 precache_model("models/vehicles/rocket01.md3");
625 precache_model("models/vehicles/rocket02.md3");
628 void RaptorCBShellfragDraw()
631 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
635 self.move_avelocity += randomvec() * 15;
636 self.renderflags = 0;
638 self.alpha = bound(0, self.nextthink - time, 1);
640 if(self.alpha < ALPHA_MIN_VISIBLE)
644 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
649 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
650 setorigin(sfrag, _org);
652 sfrag.move_movetype = MOVETYPE_BOUNCE;
653 sfrag.gravity = 0.15;
654 sfrag.solid = SOLID_CORPSE;
656 sfrag.draw = RaptorCBShellfragDraw;
658 sfrag.move_origin = sfrag.origin = _org;
659 sfrag.move_velocity = _vel;
660 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
661 sfrag.angles = self.move_angles = _ang;
663 sfrag.move_time = time;
664 sfrag.damageforcescale = 4;
666 sfrag.nextthink = time + 3;
667 sfrag.cnt = time + 2;
669 sfrag.drawmask = MASK_NORMAL;