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 var float autocvar_cl_vehicles_hudscale = 0.5;
28 var float autocvar_cl_vehicles_hudalpha = 0.75;
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];
50 #define bumb_ico "gfx/vehicles/bumb.tga"
51 #define bumb_lgun "gfx/vehicles/bumb_lgun.tga"
52 #define bumb_rgun "gfx/vehicles/bumb_rgun.tga"
54 #define bumb_gun_ico "gfx/vehicles/bumb_side.tga"
55 #define bumb_gun_gun "gfx/vehicles/bumb_side_gun.tga"
57 #define spider_ico "gfx/vehicles/sbot.tga"
58 #define spider_rkt "gfx/vehicles/sbot_rpods.tga"
59 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
60 string spider_xhair; // = "gfx/vehicles/axh-special1.tga";
62 #define waki_ico "gfx/vehicles/waki.tga"
63 #define waki_eng "gfx/vehicles/waki_e.tga"
64 #define waki_gun "gfx/vehicles/waki_guns.tga"
65 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
66 #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 = func_null;
89 void Net_AuXair2(float bIsNew)
91 float axh_id = bound(0, ReadByte(), MAX_AXH);
92 entity axh = AuxiliaryXhair[axh_id];
94 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
97 axh.draw2d = func_null;
98 axh.drawmask = MASK_NORMAL;
99 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
100 axh.axh_fadetime = 0.1;
101 axh.axh_image = "gfx/vehicles/axh-ring.tga";
104 AuxiliaryXhair[axh_id] = axh;
107 axh.move_origin_x = ReadCoord();
108 axh.move_origin_y = ReadCoord();
109 axh.move_origin_z = ReadCoord();
110 axh.colormod_x = ReadByte() / 255;
111 axh.colormod_y = ReadByte() / 255;
112 axh.colormod_z = ReadByte() / 255;
114 axh.draw2d = AuxiliaryXhair_Draw2D;
117 void Net_VehicleSetup()
122 float hud_id = ReadByte();
125 if(hud_id > HUD_VEHICLE_LAST)
127 weapon2mode = hud_id - HUD_VEHICLE_LAST;
131 // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
134 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
135 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
139 hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST);
141 // Init auxiliary crosshairs
143 for(i = 0; i < MAX_AXH; ++i)
145 axh = AuxiliaryXhair[i];
146 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
150 axh.draw2d = func_null;
151 axh.drawmask = MASK_NORMAL;
152 axh.axh_drawflag = DRAWFLAG_NORMAL;
153 axh.axh_fadetime = 0.1;
154 axh.axh_image = "gfx/vehicles/axh-ring.tga";
157 AuxiliaryXhair[i] = axh;
164 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
165 AuxiliaryXhair[0].axh_scale = 0.25;
167 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
168 AuxiliaryXhair[1].axh_scale = 0.25;
170 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
171 AuxiliaryXhair[2].axh_scale = 0.5;
175 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
176 AuxiliaryXhair[0].axh_scale = 0.25;
180 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
181 AuxiliaryXhair[0].axh_scale = 0.5;
182 //AuxiliaryXhair[0].alpha = 0.5;
184 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
185 AuxiliaryXhair[1].axh_scale = 0.25;
186 //AuxiliaryXhair[1].alpha = 0.75;
187 //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
192 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
193 AuxiliaryXhair[0].axh_scale = 0.5;
196 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga";
197 AuxiliaryXhair[1].axh_scale = 0.75;
200 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga";
201 AuxiliaryXhair[2].axh_scale = 0.75;
203 case HUD_BUMBLEBEE_GUN:
205 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
206 AuxiliaryXhair[0].axh_scale = 0.25;
208 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
209 AuxiliaryXhair[1].axh_scale = 0.25;
213 #define HUD_GETSTATS \
214 local noref float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
215 local noref float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
216 local noref float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
217 local noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
218 local noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
219 local noref float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
220 local noref float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
222 void CSQC_BUMBLE_HUD()
225 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
226 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
227 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
228 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
230 if(autocvar_r_letterbox)
233 vector picsize, hudloc = '0 0 0', pic2size, picloc;
235 // Fetch health & ammo stats
238 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
239 hudloc_y = vid_conheight - picsize_y;
240 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
242 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
249 pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
250 picloc = picsize * 0.5 - pic2size * 0.5;
253 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
255 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
257 drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
258 drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
259 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
262 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
263 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
264 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
265 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
268 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
269 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
272 if(alarm1time < time)
274 alarm1time = time + 2;
275 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
278 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
282 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
285 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
291 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
292 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
293 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
294 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
297 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
298 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
301 if(alarm2time < time)
303 alarm2time = time + 1;
304 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
306 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
310 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
313 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
322 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
323 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
324 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
325 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
328 // Right gunner slot occupied?
329 if(!AuxiliaryXhair[1].draw2d)
331 shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
332 drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
333 drawstring(hudloc + picloc + '1 0 0' * shield, _("No right gunner!"), '1 0 0' * picsize_y + '0 1 0' * picsize_y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
337 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
338 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
340 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
342 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
345 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
346 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
347 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo2, vid_conheight);
348 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
350 // Left gunner slot occupied?
351 if(!AuxiliaryXhair[2].draw2d)
353 shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
354 drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
355 drawstring(hudloc + picloc + '1 0 0' * shield, _("No left gunner!"), '1 0 0' * picsize_y + '0 1 0' * picsize_y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
359 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
360 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
362 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
364 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
366 if (scoreboard_showscores)
367 HUD_DrawScoreboard();
370 picsize = draw_getimagesize(waki_xhair);
373 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);
378 void CSQC_BUMBLE_GUN_HUD()
381 if(autocvar_r_letterbox)
384 vector picsize, hudloc = '0 0 0', pic2size, picloc;
386 // Fetch health & ammo stats
389 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
390 hudloc_y = vid_conheight - picsize_y;
391 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
393 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
400 pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
401 picloc = picsize * 0.5 - pic2size * 0.5;
404 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
406 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
408 drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
409 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
412 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
413 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
414 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
415 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
418 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
419 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
422 if(alarm1time < time)
424 alarm1time = time + 2;
425 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
428 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
432 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
435 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
441 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
442 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
443 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
444 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
447 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
448 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
451 if(alarm2time < time)
453 alarm2time = time + 1;
454 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
456 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
460 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
463 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
469 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
470 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
471 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
472 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
476 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
477 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
479 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
481 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
483 if (scoreboard_showscores)
484 HUD_DrawScoreboard();
488 picsize = draw_getimagesize(waki_xhair);
493 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);
500 void CSQC_SPIDER_HUD()
502 if(autocvar_r_letterbox)
505 vector picsize, hudloc = '0 0 0', pic2size, picloc;
508 // Fetch health & ammo stats
511 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
512 hudloc_y = vid_conheight - picsize_y;
513 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
515 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
522 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
523 picloc = picsize * 0.5 - pic2size * 0.5;
525 drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
527 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
528 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
529 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
530 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
533 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
534 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
535 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
536 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
539 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
540 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
543 if(alarm1time < time)
545 alarm1time = time + 2;
546 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
548 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
552 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
555 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
560 picsize = draw_getimagesize(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 = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
570 if(alarm2time < time)
572 alarm2time = time + 1;
573 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
575 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
579 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
582 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
588 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
589 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
590 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
591 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
594 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
595 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
597 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
599 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
602 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
603 ammo1 = picsize_x / 8;
604 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
605 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
606 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
610 pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
611 picloc_x -= pic2size_x;
612 picloc_y += pic2size_y * 2.25;
615 for(i = 1; i < 9; ++i)
618 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
623 for(i = 1; i < 9; ++i)
626 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
629 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
630 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
632 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
634 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
636 if (scoreboard_showscores)
637 HUD_DrawScoreboard();
643 spider_xhair = "gfx/vehicles/axh-bracket.tga";
646 spider_xhair = "gfx/vehicles/axh-cross.tga";
649 spider_xhair = "gfx/vehicles/axh-tag.tga";
652 spider_xhair= "gfx/vehicles/axh-tag.tga";
655 picsize = draw_getimagesize(spider_xhair);
656 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
657 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
659 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);
663 void CSQC_RAPTOR_HUD()
665 if(autocvar_r_letterbox)
668 vector picsize, hudloc = '0 0 0', pic2size, picloc;
670 // Fetch health & ammo stats
673 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
674 hudloc_y = vid_conheight - picsize_y;
675 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
677 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
684 reload1 = reload2 * 0.01;
687 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
688 picloc = picsize * 0.5 - pic2size * 0.5;
690 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
692 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
693 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
694 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
695 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
698 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
699 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
700 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
701 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
704 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
705 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
708 if(alarm1time < time)
710 alarm1time = time + 2;
711 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
714 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
718 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
721 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
727 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
728 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
729 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
730 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
733 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
734 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
737 if(alarm2time < time)
739 alarm2time = time + 1;
740 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
742 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
746 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
749 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
755 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
756 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
757 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
758 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
761 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
762 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
764 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
766 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
769 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
770 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
771 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
772 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
775 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
776 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
778 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
780 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
782 if(weapon2mode == RSM_FLARE)
784 raptor_xhair = "gfx/vehicles/axh-bracket.tga";
788 raptor_xhair = "gfx/vehicles/axh-ring.tga";
794 dropmark.owner = self;
795 dropmark.gravity = 1;
802 setorigin(dropmark, pmove_org);
803 dropmark.velocity = pmove_vel;
804 tracetoss(dropmark, self);
806 where = project_3d_to_2d(trace_endpos);
808 setorigin(dropmark, trace_endpos);
809 picsize = draw_getimagesize(raptor_drop) * 0.2;
811 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
813 where_x -= picsize_x * 0.5;
814 where_y -= picsize_y * 0.5;
816 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
818 dropmark.cnt = time + 5;
823 if(dropmark.cnt > time)
825 where = project_3d_to_2d(dropmark.origin);
826 picsize = draw_getimagesize(raptor_drop) * 0.25;
828 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
830 where_x -= picsize_x * 0.5;
831 where_y -= picsize_y * 0.5;
833 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
839 if (scoreboard_showscores)
840 HUD_DrawScoreboard();
843 picsize = draw_getimagesize(raptor_xhair);
847 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);
851 void CSQC_WAKIZASHI_HUD()
854 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
855 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
856 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
857 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
859 if(autocvar_r_letterbox)
862 vector picsize, hudloc = '0 0 0', pic2size, picloc;
864 // Fetch health & ammo stats
867 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
868 hudloc_y = vid_conheight - picsize_y;
869 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
871 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
878 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
879 picloc = picsize * 0.5 - pic2size * 0.5;
881 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
883 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
884 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
885 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
886 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
887 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
890 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
891 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
892 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
893 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
896 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
897 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
900 if(alarm1time < time)
902 alarm1time = time + 2;
903 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
906 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
910 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
913 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
920 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
921 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
922 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
923 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
926 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
927 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
930 if(alarm2time < time)
932 alarm2time = time + 1;
933 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
935 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
939 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
942 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
948 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
949 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
950 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
951 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
954 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
955 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
957 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
959 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
962 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
963 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
964 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
965 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
968 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
969 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
971 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
973 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
975 if (scoreboard_showscores)
976 HUD_DrawScoreboard();
979 picsize = draw_getimagesize(waki_xhair);
984 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);
988 void Vehicles_Precache()
990 precache_model("models/vehicles/bomblet.md3");
991 precache_model("models/vehicles/clusterbomb.md3");
992 precache_model("models/vehicles/clusterbomb_fragment.md3");
993 precache_model("models/vehicles/rocket01.md3");
994 precache_model("models/vehicles/rocket02.md3");
996 precache_sound ("vehicles/alarm.wav");
997 precache_sound ("vehicles/alarm_shield.wav");
1000 void RaptorCBShellfragDraw()
1005 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
1006 self.move_avelocity += randomvec() * 15;
1007 self.renderflags = 0;
1010 self.alpha = bound(0, self.nextthink - time, 1);
1012 if(self.alpha < ALPHA_MIN_VISIBLE)
1016 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
1021 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
1022 setorigin(sfrag, _org);
1024 sfrag.move_movetype = MOVETYPE_BOUNCE;
1025 sfrag.gravity = 0.15;
1026 sfrag.solid = SOLID_CORPSE;
1028 sfrag.draw = RaptorCBShellfragDraw;
1030 sfrag.move_origin = sfrag.origin = _org;
1031 sfrag.move_velocity = _vel;
1032 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
1033 sfrag.angles = self.move_angles = _ang;
1035 sfrag.move_time = time;
1036 sfrag.damageforcescale = 4;
1038 sfrag.nextthink = time + 3;
1039 sfrag.cnt = time + 2;
1041 sfrag.drawmask = MASK_NORMAL;