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"
13 #define hud_energy "gfx/vehicles/energy.tga"
18 #define SBRM_ARTILLERY 3
27 float autocvar_cl_vehicles_hudscale;
28 float autocvar_cl_vehicles_hudalpha;
30 #define raptor_ico "gfx/vehicles/raptor.tga"
31 #define raptor_gun "gfx/vehicles/raptor_guns.tga"
32 #define raptor_bomb "gfx/vehicles/raptor_bombs.tga"
33 #define raptor_drop "gfx/vehicles/axh-dropcross.tga"
36 void CSQC_WAKIZASHI_HUD();
37 void CSQC_SPIDER_HUD();
38 void CSQC_RAPTOR_HUD();
39 void CSQC_BUMBLE_HUD();
40 void CSQC_BUMBLE_GUN_HUD();
43 entity AuxiliaryXhair[MAX_AXH];
44 const var void Draw_Not();
51 #define bumb_ico "gfx/vehicles/bumb.tga"
52 #define bumb_lgun "gfx/vehicles/bumb_lgun.tga"
53 #define bumb_rgun "gfx/vehicles/bumb_rgun.tga"
55 #define bumb_gun_ico "gfx/vehicles/bumb_side.tga"
56 #define bumb_gun_gun "gfx/vehicles/bumb_side_gun.tga"
58 #define spider_ico "gfx/vehicles/sbot.tga"
59 #define spider_rkt "gfx/vehicles/sbot_rpods.tga"
60 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
61 string spider_xhair; // = "gfx/vehicles/axh-special1.tga";
63 #define waki_ico "gfx/vehicles/waki.tga"
64 #define waki_eng "gfx/vehicles/waki_e.tga"
65 #define waki_gun "gfx/vehicles/waki_guns.tga"
66 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
67 #define waki_xhair "gfx/vehicles/axh-special1.tga"
72 void AuxiliaryXhair_Draw2D()
76 psize = self.axh_scale * draw_getimagesize(self.axh_image);
77 loc = project_3d_to_2d(self.move_origin) - 0.5 * psize;
78 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
82 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
85 if(time - self.cnt > self.axh_fadetime)
86 self.draw2d = Draw_Not;
89 void Net_AuXair2(float bIsNew)
94 axh_id = bound(0, ReadByte(), MAX_AXH);
95 axh = AuxiliaryXhair[axh_id];
97 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
100 axh.draw2d = Draw_Not;
101 axh.drawmask = MASK_NORMAL;
102 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
103 axh.axh_fadetime = 0.1;
104 axh.axh_image = "gfx/vehicles/axh-ring.tga";
107 AuxiliaryXhair[axh_id] = axh;
110 if(axh.oldorigin != ' 0 0 0')
112 //axh.move_velocity =
113 axh.move_origin = axh.origin;
114 axh.move_time = time;
118 axh.draw2d = AuxiliaryXhair_Draw2D;
120 axh.move_origin_x = ReadCoord();
121 axh.move_origin_y = ReadCoord();
122 axh.move_origin_z = ReadCoord();
124 axh.colormod_x = ReadByte() / 255;
125 axh.colormod_y = ReadByte() / 255;
126 axh.colormod_z = ReadByte() / 255;
131 void Net_VehicleSetup()
139 if(hud_id > HUD_VEHICLE_LAST)
141 weapon2mode = hud_id - HUD_VEHICLE_LAST;
145 // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
148 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
149 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
154 hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST);
156 // Init auxiliary crosshairs
158 for(i = 0; i < MAX_AXH; ++i)
160 axh = AuxiliaryXhair[i];
161 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
165 axh.draw2d = Draw_Not;
166 axh.drawmask = MASK_NORMAL;
167 axh.axh_drawflag = DRAWFLAG_NORMAL;
168 axh.axh_fadetime = 0.1;
169 axh.axh_image = "gfx/vehicles/axh-ring.tga";
172 AuxiliaryXhair[i] = axh;
179 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
180 AuxiliaryXhair[0].axh_scale = 0.25;
182 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
183 AuxiliaryXhair[1].axh_scale = 0.25;
185 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
186 AuxiliaryXhair[2].axh_scale = 0.5;
190 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
191 AuxiliaryXhair[0].axh_scale = 0.25;
195 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
196 AuxiliaryXhair[0].axh_scale = 0.5;
197 //AuxiliaryXhair[0].alpha = 0.5;
199 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
200 AuxiliaryXhair[1].axh_scale = 0.25;
201 //AuxiliaryXhair[1].alpha = 0.75;
202 //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
207 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
208 AuxiliaryXhair[0].axh_scale = 0.5;
211 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga";
212 AuxiliaryXhair[1].axh_scale = 0.75;
215 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga";
216 AuxiliaryXhair[2].axh_scale = 0.75;
218 case HUD_BUMBLEBEE_GUN:
220 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
221 AuxiliaryXhair[0].axh_scale = 0.25;
223 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
224 AuxiliaryXhair[1].axh_scale = 0.25;
228 #define HUD_GETSTATS \
229 float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
230 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
231 float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
232 float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
233 float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
234 float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
235 float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
237 void CSQC_BUMBLE_HUD()
240 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
241 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
242 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
243 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
245 if(autocvar_r_letterbox)
248 vector picsize, hudloc, pic2size, picloc;
250 // Fetch health & ammo stats
253 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
254 hudloc_y = vid_conheight - picsize_y;
255 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
257 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
264 pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
265 picloc = picsize * 0.5 - pic2size * 0.5;
268 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
270 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
272 drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
273 drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
274 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
277 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
278 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
279 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
280 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
283 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
284 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
287 if(alarm1time < time)
289 alarm1time = time + 2;
290 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
293 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
297 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
300 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
306 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
307 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
308 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
309 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
312 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
313 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
316 if(alarm2time < time)
318 alarm2time = time + 1;
319 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
321 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
325 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
328 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
337 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
338 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
339 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
340 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
343 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
344 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
346 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
348 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
351 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
352 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
353 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo2, vid_conheight);
354 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
357 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
358 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
360 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
362 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
364 if (scoreboard_showscores)
365 HUD_DrawScoreboard();
368 picsize = draw_getimagesize(waki_xhair);
371 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);
376 void CSQC_BUMBLE_GUN_HUD()
379 if(autocvar_r_letterbox)
382 vector picsize, hudloc, pic2size, picloc;
384 // Fetch health & ammo stats
387 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
388 hudloc_y = vid_conheight - picsize_y;
389 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
391 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
398 pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
399 picloc = picsize * 0.5 - pic2size * 0.5;
402 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
404 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
406 drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
407 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
410 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
411 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
412 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
413 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
416 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
417 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
420 if(alarm1time < time)
422 alarm1time = time + 2;
423 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
426 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
430 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
433 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
439 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
440 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
441 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
442 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
445 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
446 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
449 if(alarm2time < time)
451 alarm2time = time + 1;
452 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
454 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
458 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
461 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
467 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
468 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
469 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
470 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
474 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
475 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
477 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
479 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
481 if (scoreboard_showscores)
482 HUD_DrawScoreboard();
486 picsize = draw_getimagesize(waki_xhair);
491 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);
498 void CSQC_SPIDER_HUD()
500 if(autocvar_r_letterbox)
503 vector picsize, hudloc, pic2size, picloc;
506 // Fetch health & ammo stats
509 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
510 hudloc_y = vid_conheight - picsize_y;
511 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
513 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
520 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
521 picloc = picsize * 0.5 - pic2size * 0.5;
523 drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
525 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
526 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
527 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
528 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
531 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
532 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
533 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
534 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
537 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
538 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
541 if(alarm1time < time)
543 alarm1time = time + 2;
544 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
546 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
550 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
553 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
558 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
559 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
560 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
561 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
564 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
565 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
568 if(alarm2time < time)
570 alarm2time = time + 1;
571 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
573 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
577 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
580 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
586 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
587 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
588 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
589 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
592 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
593 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
595 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
597 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
600 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
601 ammo1 = picsize_x / 8;
602 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
603 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
604 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
608 pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
609 picloc_x -= pic2size_x;
610 picloc_y += pic2size_y * 2.25;
613 for(i = 1; i < 9; ++i)
616 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
621 for(i = 1; i < 9; ++i)
624 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
627 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
628 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
630 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
632 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
634 if (scoreboard_showscores)
635 HUD_DrawScoreboard();
641 spider_xhair = "gfx/vehicles/axh-bracket.tga";
644 spider_xhair = "gfx/vehicles/axh-cross.tga";
647 spider_xhair = "gfx/vehicles/axh-tag.tga";
650 spider_xhair= "gfx/vehicles/axh-tag.tga";
653 picsize = draw_getimagesize(spider_xhair);
654 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
655 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
657 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);
661 void CSQC_RAPTOR_HUD()
663 if(autocvar_r_letterbox)
666 vector picsize, hudloc, pic2size, picloc;
668 // Fetch health & ammo stats
671 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
672 hudloc_y = vid_conheight - picsize_y;
673 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
675 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
682 reload1 = reload2 * 0.01;
685 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
686 picloc = picsize * 0.5 - pic2size * 0.5;
688 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
690 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
691 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
692 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
693 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
696 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
697 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
698 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
699 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
702 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
703 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
706 if(alarm1time < time)
708 alarm1time = time + 2;
709 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
712 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
716 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
719 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
725 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
726 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
727 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
728 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
731 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
732 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
735 if(alarm2time < time)
737 alarm2time = time + 1;
738 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
740 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
744 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
747 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
753 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
754 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
755 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
756 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
759 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
760 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
762 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
764 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
767 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
768 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
769 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
770 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
773 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
774 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
776 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
778 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
780 if(weapon2mode == RSM_FLARE)
782 raptor_xhair = "gfx/vehicles/axh-bracket.tga";
786 raptor_xhair = "gfx/vehicles/axh-ring.tga";
792 dropmark.owner = self;
793 dropmark.gravity = 1;
800 setorigin(dropmark, pmove_org);
801 dropmark.velocity = pmove_vel;
802 tracetoss(dropmark, self);
804 where = project_3d_to_2d(trace_endpos);
806 setorigin(dropmark, trace_endpos);
807 picsize = draw_getimagesize(raptor_drop) * 0.2;
809 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
811 where_x -= picsize_x * 0.5;
812 where_y -= picsize_y * 0.5;
814 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
816 dropmark.cnt = time + 5;
821 if(dropmark.cnt > time)
823 where = project_3d_to_2d(dropmark.origin);
824 picsize = draw_getimagesize(raptor_drop) * 0.25;
826 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
828 where_x -= picsize_x * 0.5;
829 where_y -= picsize_y * 0.5;
831 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
837 if (scoreboard_showscores)
838 HUD_DrawScoreboard();
841 picsize = draw_getimagesize(raptor_xhair);
845 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);
849 void CSQC_WAKIZASHI_HUD()
852 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
853 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
854 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
855 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
857 if(autocvar_r_letterbox)
860 vector picsize, hudloc, pic2size, picloc;
862 // Fetch health & ammo stats
865 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
866 hudloc_y = vid_conheight - picsize_y;
867 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
869 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
876 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
877 picloc = picsize * 0.5 - pic2size * 0.5;
879 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
881 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
882 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
883 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
884 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
885 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
888 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
889 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
890 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
891 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
894 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
895 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
898 if(alarm1time < time)
900 alarm1time = time + 2;
901 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
904 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
908 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
911 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
918 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
919 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
920 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
921 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
924 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
925 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
928 if(alarm2time < time)
930 alarm2time = time + 1;
931 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
933 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
937 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
940 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
946 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
947 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
948 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
949 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
952 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
953 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
955 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
957 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
960 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
961 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
962 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
963 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
966 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
967 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
969 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
971 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
973 if (scoreboard_showscores)
974 HUD_DrawScoreboard();
977 picsize = draw_getimagesize(waki_xhair);
982 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);
986 void Vehicles_Precache()
988 // fixme: HAAAAKKKZZZ!!!!!!!!!!!! (this belongs as a setting in default.cfg)
989 if(!autocvar_cl_vehicles_hudscale )
990 autocvar_cl_vehicles_hudscale = 0.5;
992 if(!autocvar_cl_vehicles_hudalpha)
993 autocvar_cl_vehicles_hudalpha = 0.75;
995 //precache_model("models/vehicles/wakizashi.dpm");
997 precache_model("models/vehicles/bomblet.md3");
998 precache_model("models/vehicles/clusterbomb.md3");
999 precache_model("models/vehicles/clusterbomb_fragment.md3");
1000 precache_model("models/vehicles/rocket01.md3");
1001 precache_model("models/vehicles/rocket02.md3");
1003 precache_sound ("vehicles/alarm.wav");
1004 precache_sound ("vehicles/alarm_shield.wav");
1007 void RaptorCBShellfragDraw()
1010 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
1014 self.move_avelocity += randomvec() * 15;
1015 self.renderflags = 0;
1017 self.alpha = bound(0, self.nextthink - time, 1);
1019 if(self.alpha < ALPHA_MIN_VISIBLE)
1023 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
1028 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
1029 setorigin(sfrag, _org);
1031 sfrag.move_movetype = MOVETYPE_BOUNCE;
1032 sfrag.gravity = 0.15;
1033 sfrag.solid = SOLID_CORPSE;
1035 sfrag.draw = RaptorCBShellfragDraw;
1037 sfrag.move_origin = sfrag.origin = _org;
1038 sfrag.move_velocity = _vel;
1039 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
1040 sfrag.angles = self.move_angles = _ang;
1042 sfrag.move_time = time;
1043 sfrag.damageforcescale = 4;
1045 sfrag.nextthink = time + 3;
1046 sfrag.cnt = time + 2;
1048 sfrag.drawmask = MASK_NORMAL;