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];
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"
73 void AuxiliaryXhair_Draw2D()
77 psize = self.axh_scale * draw_getimagesize(self.axh_image);
78 loc = project_3d_to_2d(self.move_origin) - 0.5 * psize;
79 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
83 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
86 if(time - self.cnt > self.axh_fadetime)
87 self.draw2d = Draw_Not;
90 void Net_AuXair2(float bIsNew)
92 float axh_id = bound(0, ReadByte(), MAX_AXH);
93 entity axh = AuxiliaryXhair[axh_id];
95 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[axh_id] = axh;
108 axh.move_origin_x = ReadCoord();
109 axh.move_origin_y = ReadCoord();
110 axh.move_origin_z = ReadCoord();
111 axh.colormod_x = ReadByte() / 255;
112 axh.colormod_y = ReadByte() / 255;
113 axh.colormod_z = ReadByte() / 255;
115 axh.draw2d = AuxiliaryXhair_Draw2D;
118 void Net_VehicleSetup()
123 float hud_id = ReadByte();
126 if(hud_id > HUD_VEHICLE_LAST)
128 weapon2mode = hud_id - HUD_VEHICLE_LAST;
132 // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
135 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
136 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
140 hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST);
142 // Init auxiliary crosshairs
144 for(i = 0; i < MAX_AXH; ++i)
146 axh = AuxiliaryXhair[i];
147 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
151 axh.draw2d = Draw_Not;
152 axh.drawmask = MASK_NORMAL;
153 axh.axh_drawflag = DRAWFLAG_NORMAL;
154 axh.axh_fadetime = 0.1;
155 axh.axh_image = "gfx/vehicles/axh-ring.tga";
158 AuxiliaryXhair[i] = axh;
165 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
166 AuxiliaryXhair[0].axh_scale = 0.25;
168 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
169 AuxiliaryXhair[1].axh_scale = 0.25;
171 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
172 AuxiliaryXhair[2].axh_scale = 0.5;
176 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
177 AuxiliaryXhair[0].axh_scale = 0.25;
181 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
182 AuxiliaryXhair[0].axh_scale = 0.5;
183 //AuxiliaryXhair[0].alpha = 0.5;
185 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
186 AuxiliaryXhair[1].axh_scale = 0.25;
187 //AuxiliaryXhair[1].alpha = 0.75;
188 //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
193 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
194 AuxiliaryXhair[0].axh_scale = 0.5;
197 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga";
198 AuxiliaryXhair[1].axh_scale = 0.75;
201 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga";
202 AuxiliaryXhair[2].axh_scale = 0.75;
204 case HUD_BUMBLEBEE_GUN:
206 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
207 AuxiliaryXhair[0].axh_scale = 0.25;
209 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
210 AuxiliaryXhair[1].axh_scale = 0.25;
214 #define HUD_GETSTATS \
215 noref float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
216 noref float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
217 noref float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
218 noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
219 noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
220 noref float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
221 noref float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
223 void CSQC_BUMBLE_HUD()
226 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
227 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
228 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
229 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
231 if(autocvar_r_letterbox)
234 vector picsize, hudloc = '0 0 0', pic2size, picloc;
236 // Fetch health & ammo stats
239 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
240 hudloc_y = vid_conheight - picsize_y;
241 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
243 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
250 pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
251 picloc = picsize * 0.5 - pic2size * 0.5;
254 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
256 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 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, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
260 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
263 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
264 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
265 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
266 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
269 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
270 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
273 if(alarm1time < time)
275 alarm1time = time + 2;
276 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
279 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
283 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
286 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
292 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
293 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
294 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
295 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
298 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
299 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
302 if(alarm2time < time)
304 alarm2time = time + 1;
305 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
307 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
311 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
314 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
323 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
324 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
325 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
326 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
329 // Right gunner slot occupied?
330 if(AuxiliaryXhair[1].draw2d == Draw_Not)
332 shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
333 drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
334 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);
338 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
339 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
341 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
343 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
346 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
347 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
348 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo2, vid_conheight);
349 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
351 // Left gunner slot occupied?
352 if(AuxiliaryXhair[2].draw2d == Draw_Not)
354 shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
355 drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
356 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);
360 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
361 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
363 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
365 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
367 if (scoreboard_showscores)
368 HUD_DrawScoreboard();
371 picsize = draw_getimagesize(waki_xhair);
374 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);
379 void CSQC_BUMBLE_GUN_HUD()
382 if(autocvar_r_letterbox)
385 vector picsize, hudloc = '0 0 0', pic2size, picloc;
387 // Fetch health & ammo stats
390 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
391 hudloc_y = vid_conheight - picsize_y;
392 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
394 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
401 pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
402 picloc = picsize * 0.5 - pic2size * 0.5;
405 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
407 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
409 drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
410 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
413 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
414 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
415 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
416 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
419 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
420 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
423 if(alarm1time < time)
425 alarm1time = time + 2;
426 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
429 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
433 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
436 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
442 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
443 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
444 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
445 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
448 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
449 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
452 if(alarm2time < time)
454 alarm2time = time + 1;
455 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
457 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
461 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
464 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
470 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
471 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
472 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
473 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
477 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
478 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
480 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
482 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
484 if (scoreboard_showscores)
485 HUD_DrawScoreboard();
489 picsize = draw_getimagesize(waki_xhair);
494 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);
501 void CSQC_SPIDER_HUD()
503 if(autocvar_r_letterbox)
506 vector picsize, hudloc = '0 0 0', pic2size, picloc;
509 // Fetch health & ammo stats
512 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
513 hudloc_y = vid_conheight - picsize_y;
514 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
516 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
523 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
524 picloc = picsize * 0.5 - pic2size * 0.5;
526 drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
528 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
529 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
530 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
531 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
534 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
535 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
536 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
537 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
540 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
541 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
544 if(alarm1time < time)
546 alarm1time = time + 2;
547 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
549 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
553 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
556 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
561 picsize = draw_getimagesize(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 = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
571 if(alarm2time < time)
573 alarm2time = time + 1;
574 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
576 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
580 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
583 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
589 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
590 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
591 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
592 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
595 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
596 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
598 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
600 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
603 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
604 ammo1 = picsize_x / 8;
605 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
606 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
607 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
611 pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
612 picloc_x -= pic2size_x;
613 picloc_y += pic2size_y * 2.25;
616 for(i = 1; i < 9; ++i)
619 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
624 for(i = 1; i < 9; ++i)
627 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
630 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
631 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
633 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
635 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
637 if (scoreboard_showscores)
638 HUD_DrawScoreboard();
644 spider_xhair = "gfx/vehicles/axh-bracket.tga";
647 spider_xhair = "gfx/vehicles/axh-cross.tga";
650 spider_xhair = "gfx/vehicles/axh-tag.tga";
653 spider_xhair= "gfx/vehicles/axh-tag.tga";
656 picsize = draw_getimagesize(spider_xhair);
657 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
658 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
660 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);
664 void CSQC_RAPTOR_HUD()
666 if(autocvar_r_letterbox)
669 vector picsize, hudloc = '0 0 0', pic2size, picloc;
671 // Fetch health & ammo stats
674 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
675 hudloc_y = vid_conheight - picsize_y;
676 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
678 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
685 reload1 = reload2 * 0.01;
688 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
689 picloc = picsize * 0.5 - pic2size * 0.5;
691 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
693 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
694 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
695 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
696 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
699 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
700 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
701 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
702 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
705 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
706 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
709 if(alarm1time < time)
711 alarm1time = time + 2;
712 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
715 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
719 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
722 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
728 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
729 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
730 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
731 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
734 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
735 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
738 if(alarm2time < time)
740 alarm2time = time + 1;
741 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
743 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
747 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
750 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
756 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
757 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
758 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
759 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
762 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
763 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
765 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
767 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
770 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
771 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
772 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
773 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
776 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
777 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
779 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
781 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
783 if(weapon2mode == RSM_FLARE)
785 raptor_xhair = "gfx/vehicles/axh-bracket.tga";
789 raptor_xhair = "gfx/vehicles/axh-ring.tga";
795 dropmark.owner = self;
796 dropmark.gravity = 1;
803 setorigin(dropmark, pmove_org);
804 dropmark.velocity = pmove_vel;
805 tracetoss(dropmark, self);
807 where = project_3d_to_2d(trace_endpos);
809 setorigin(dropmark, trace_endpos);
810 picsize = draw_getimagesize(raptor_drop) * 0.2;
812 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
814 where_x -= picsize_x * 0.5;
815 where_y -= picsize_y * 0.5;
817 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
819 dropmark.cnt = time + 5;
824 if(dropmark.cnt > time)
826 where = project_3d_to_2d(dropmark.origin);
827 picsize = draw_getimagesize(raptor_drop) * 0.25;
829 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
831 where_x -= picsize_x * 0.5;
832 where_y -= picsize_y * 0.5;
834 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
840 if (scoreboard_showscores)
841 HUD_DrawScoreboard();
844 picsize = draw_getimagesize(raptor_xhair);
848 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);
852 void CSQC_WAKIZASHI_HUD()
855 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
856 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
857 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
858 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
860 if(autocvar_r_letterbox)
863 vector picsize, hudloc = '0 0 0', pic2size, picloc;
865 // Fetch health & ammo stats
868 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
869 hudloc_y = vid_conheight - picsize_y;
870 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
872 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
879 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
880 picloc = picsize * 0.5 - pic2size * 0.5;
882 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
884 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
885 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
886 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
887 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
888 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
891 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
892 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
893 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
894 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
897 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
898 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
901 if(alarm1time < time)
903 alarm1time = time + 2;
904 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
907 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
911 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
914 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
921 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
922 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
923 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
924 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
927 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
928 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
931 if(alarm2time < time)
933 alarm2time = time + 1;
934 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
936 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
940 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
943 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
949 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
950 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
951 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
952 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
955 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
956 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
958 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
960 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
963 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
964 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
965 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
966 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
969 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
970 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
972 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
974 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
976 if (scoreboard_showscores)
977 HUD_DrawScoreboard();
980 picsize = draw_getimagesize(waki_xhair);
985 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);
989 void Vehicles_Precache()
991 precache_model("models/vehicles/bomblet.md3");
992 precache_model("models/vehicles/clusterbomb.md3");
993 precache_model("models/vehicles/clusterbomb_fragment.md3");
994 precache_model("models/vehicles/rocket01.md3");
995 precache_model("models/vehicles/rocket02.md3");
997 precache_sound ("vehicles/alarm.wav");
998 precache_sound ("vehicles/alarm_shield.wav");
1001 void RaptorCBShellfragDraw()
1006 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
1007 self.move_avelocity += randomvec() * 15;
1008 self.renderflags = 0;
1011 self.alpha = bound(0, self.nextthink - time, 1);
1013 if(self.alpha < ALPHA_MIN_VISIBLE)
1017 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
1022 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
1023 setorigin(sfrag, _org);
1025 sfrag.move_movetype = MOVETYPE_BOUNCE;
1026 sfrag.gravity = 0.15;
1027 sfrag.solid = SOLID_CORPSE;
1029 sfrag.draw = RaptorCBShellfragDraw;
1031 sfrag.move_origin = sfrag.origin = _org;
1032 sfrag.move_velocity = _vel;
1033 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
1034 sfrag.angles = self.move_angles = _ang;
1036 sfrag.move_time = time;
1037 sfrag.damageforcescale = 4;
1039 sfrag.nextthink = time + 3;
1040 sfrag.cnt = time + 2;
1042 sfrag.drawmask = MASK_NORMAL;