1 const string hud_bg = "gfx/vehicles/frame.tga";
2 const string hud_sh = "gfx/vehicles/vh-shield.tga";
4 const string hud_hp_bar = "gfx/vehicles/bar_up_left.tga";
5 const string hud_hp_ico = "gfx/vehicles/health.tga";
6 const string hud_sh_bar = "gfx/vehicles/bar_dwn_left.tga";
7 const string hud_sh_ico = "gfx/vehicles/shield.tga";
9 const string hud_ammo1_bar = "gfx/vehicles/bar_up_right.tga";
10 const string hud_ammo1_ico = "gfx/vehicles/bullets.tga";
11 const string hud_ammo2_bar = "gfx/vehicles/bar_dwn_right.tga";
12 const string hud_ammo2_ico = "gfx/vehicles/rocket.tga";
13 const string hud_energy = "gfx/vehicles/energy.tga";
15 const int SBRM_FIRST = 1;
16 const int SBRM_VOLLY = 1;
17 const int SBRM_GUIDE = 2;
18 const int SBRM_ARTILLERY = 3;
19 const int SBRM_LAST = 3;
21 const int RSM_FIRST = 1;
22 const int RSM_BOMB = 1;
23 const int RSM_FLARE = 2;
24 const int RSM_LAST = 2;
27 float autocvar_cl_vehicles_hudscale = 0.5;
28 float autocvar_cl_vehicles_hudalpha = 0.75;
30 const string raptor_ico = "gfx/vehicles/raptor.tga";
31 const string raptor_gun = "gfx/vehicles/raptor_guns.tga";
32 const string raptor_bomb = "gfx/vehicles/raptor_bombs.tga";
33 const string 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();
42 const int MAX_AXH = 4;
43 entity AuxiliaryXhair[MAX_AXH];
50 const string bumb_ico = "gfx/vehicles/bumb.tga";
51 const string bumb_lgun = "gfx/vehicles/bumb_lgun.tga";
52 const string bumb_rgun = "gfx/vehicles/bumb_rgun.tga";
54 const string bumb_gun_ico = "gfx/vehicles/bumb_side.tga";
55 const string bumb_gun_gun = "gfx/vehicles/bumb_side_gun.tga";
57 const string spider_ico = "gfx/vehicles/sbot.tga";
58 const string spider_rkt = "gfx/vehicles/sbot_rpods.tga";
59 const string spider_mgun = "gfx/vehicles/sbot_mguns.tga";
60 string spider_xhair; // = "gfx/vehicles/axh-special1.tga";
62 const string waki_ico = "gfx/vehicles/waki.tga";
63 const string waki_eng = "gfx/vehicles/waki_e.tga";
64 const string waki_gun = "gfx/vehicles/waki_guns.tga";
65 const string waki_rkt = "gfx/vehicles/waki_rockets.tga";
66 const string 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 (!(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(bool bIsNew)
91 int 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()
119 int hud_id = ReadByte();
122 if(hud_id > HUD_VEHICLE_LAST)
124 weapon2mode = hud_id - HUD_VEHICLE_LAST;
128 // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
131 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
132 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
136 hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST);
138 // Init auxiliary crosshairs
140 for(i = 0; i < MAX_AXH; ++i)
142 entity axh = AuxiliaryXhair[i];
143 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
147 axh.draw2d = func_null;
148 axh.drawmask = MASK_NORMAL;
149 axh.axh_drawflag = DRAWFLAG_NORMAL;
150 axh.axh_fadetime = 0.1;
151 axh.axh_image = "gfx/vehicles/axh-ring.tga";
154 AuxiliaryXhair[i] = axh;
161 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
162 AuxiliaryXhair[0].axh_scale = 0.25;
164 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
165 AuxiliaryXhair[1].axh_scale = 0.25;
167 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
168 AuxiliaryXhair[2].axh_scale = 0.5;
172 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
173 AuxiliaryXhair[0].axh_scale = 0.25;
177 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
178 AuxiliaryXhair[0].axh_scale = 0.5;
179 //AuxiliaryXhair[0].alpha = 0.5;
181 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
182 AuxiliaryXhair[1].axh_scale = 0.25;
183 //AuxiliaryXhair[1].alpha = 0.75;
184 //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
189 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
190 AuxiliaryXhair[0].axh_scale = 0.5;
193 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga";
194 AuxiliaryXhair[1].axh_scale = 0.75;
197 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga";
198 AuxiliaryXhair[2].axh_scale = 0.75;
200 case HUD_BUMBLEBEE_GUN:
202 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
203 AuxiliaryXhair[0].axh_scale = 0.25;
205 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
206 AuxiliaryXhair[1].axh_scale = 0.25;
210 #define HUD_GETSTATS \
211 int vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
212 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
213 noref int energy = getstati(STAT_VEHICLESTAT_ENERGY); \
214 noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
215 noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
216 noref int ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
217 noref int reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
219 void CSQC_BUMBLE_HUD()
222 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
223 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
224 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
225 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
227 if(autocvar_r_letterbox)
230 vector picsize, hudloc = '0 0 0', pic2size, picloc;
232 // Fetch health & ammo stats
235 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
236 hudloc_y = vid_conheight - picsize.y;
237 hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
239 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
246 pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
247 picloc = picsize * 0.5 - pic2size * 0.5;
250 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
252 drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
254 drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
255 drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
256 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
259 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
260 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
261 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
262 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
265 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
266 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
269 if(alarm1time < time)
271 alarm1time = time + 2;
272 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
275 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
279 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
282 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
288 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
289 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
290 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight);
291 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
294 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
295 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
298 if(alarm2time < time)
300 alarm2time = time + 1;
301 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
303 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
307 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
310 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
319 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
320 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
321 drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo1, vid_conheight);
322 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
325 // Right gunner slot occupied?
326 if(!AuxiliaryXhair[1].draw2d)
328 shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
329 drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
330 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);
334 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
335 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
337 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
339 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
342 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
343 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
344 drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo2, vid_conheight);
345 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
347 // Left gunner slot occupied?
348 if(!AuxiliaryXhair[2].draw2d)
350 shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
351 drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
352 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);
356 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
357 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
359 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
361 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
363 if (scoreboard_showscores)
364 HUD_DrawScoreboard();
367 picsize = draw_getimagesize(waki_xhair);
370 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);
375 void CSQC_BUMBLE_GUN_HUD()
378 if(autocvar_r_letterbox)
381 vector picsize, hudloc = '0 0 0', pic2size, picloc;
383 // Fetch health & ammo stats
386 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
387 hudloc_y = vid_conheight - picsize.y;
388 hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
390 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
397 pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
398 picloc = picsize * 0.5 - pic2size * 0.5;
401 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
403 drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
405 drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
406 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
409 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
410 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
411 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
412 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
415 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
416 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
419 if(alarm1time < time)
421 alarm1time = time + 2;
422 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
425 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
429 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
432 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
438 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
439 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
440 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight);
441 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
444 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
445 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
448 if(alarm2time < time)
450 alarm2time = time + 1;
451 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
453 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
457 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
460 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
466 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
467 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
468 drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight);
469 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
473 picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale;
474 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
476 drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
478 drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
480 if (scoreboard_showscores)
481 HUD_DrawScoreboard();
485 picsize = draw_getimagesize(waki_xhair);
490 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);
497 void CSQC_SPIDER_HUD()
499 if(autocvar_r_letterbox)
502 vector picsize, hudloc = '0 0 0', pic2size, picloc;
505 // Fetch health & ammo stats
508 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
509 hudloc_y = vid_conheight - picsize.y;
510 hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
512 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
519 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
520 picloc = picsize * 0.5 - pic2size * 0.5;
522 drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
524 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
525 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
526 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
527 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
530 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
531 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
532 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
533 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
536 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
537 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
540 if(alarm1time < time)
542 alarm1time = time + 2;
543 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
545 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
549 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
552 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
557 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
558 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
559 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight);
560 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
563 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
564 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
567 if(alarm2time < time)
569 alarm2time = time + 1;
570 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
572 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
576 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
579 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
585 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
586 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
587 drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo1, vid_conheight);
588 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
591 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
592 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
594 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
596 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
599 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
600 ammo1 = picsize.x / 8;
601 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
602 drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload2, vid_conheight);
603 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
607 pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
608 picloc.x -= pic2size.x;
609 picloc.y += pic2size.y * 2.25;
612 for(i = 1; i < 9; ++i)
615 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
620 for(i = 1; i < 9; ++i)
623 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
626 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
627 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
629 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
631 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
633 if (scoreboard_showscores)
634 HUD_DrawScoreboard();
640 spider_xhair = "gfx/vehicles/axh-bracket.tga";
643 spider_xhair = "gfx/vehicles/axh-cross.tga";
646 spider_xhair = "gfx/vehicles/axh-tag.tga";
649 spider_xhair= "gfx/vehicles/axh-tag.tga";
652 picsize = draw_getimagesize(spider_xhair);
653 picsize.x *= autocvar_cl_vehicle_spiderbot_cross_size;
654 picsize.y *= autocvar_cl_vehicle_spiderbot_cross_size;
656 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);
660 void CSQC_RAPTOR_HUD()
662 if(autocvar_r_letterbox)
665 vector picsize, hudloc = '0 0 0', pic2size, picloc;
667 // Fetch health & ammo stats
670 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
671 hudloc_y = vid_conheight - picsize.y;
672 hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
674 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
681 reload1 = reload2 * 0.01;
684 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
685 picloc = picsize * 0.5 - pic2size * 0.5;
687 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
689 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
690 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
691 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
692 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
695 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
696 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
697 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
698 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
701 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
702 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
705 if(alarm1time < time)
707 alarm1time = time + 2;
708 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
711 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
715 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
718 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
724 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
725 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
726 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight);
727 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
730 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
731 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
734 if(alarm2time < time)
736 alarm2time = time + 1;
737 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
739 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
743 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
746 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
752 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
753 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
754 drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight);
755 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
758 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
759 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
761 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
763 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
766 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
767 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
768 drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload1, vid_conheight);
769 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
772 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
773 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
775 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
777 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
779 if(weapon2mode == RSM_FLARE)
781 raptor_xhair = "gfx/vehicles/axh-bracket.tga";
785 raptor_xhair = "gfx/vehicles/axh-ring.tga";
791 dropmark.owner = self;
792 dropmark.gravity = 1;
799 setorigin(dropmark, pmove_org);
800 dropmark.velocity = pmove_vel;
801 tracetoss(dropmark, self);
803 where = project_3d_to_2d(trace_endpos);
805 setorigin(dropmark, trace_endpos);
806 picsize = draw_getimagesize(raptor_drop) * 0.2;
808 if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight))
810 where.x -= picsize.x * 0.5;
811 where.y -= picsize.y * 0.5;
813 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
815 dropmark.cnt = time + 5;
820 if(dropmark.cnt > time)
822 where = project_3d_to_2d(dropmark.origin);
823 picsize = draw_getimagesize(raptor_drop) * 0.25;
825 if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight))
827 where.x -= picsize.x * 0.5;
828 where.y -= picsize.y * 0.5;
830 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
836 if (scoreboard_showscores)
837 HUD_DrawScoreboard();
840 picsize = draw_getimagesize(raptor_xhair);
844 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);
848 void CSQC_WAKIZASHI_HUD()
851 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
852 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
853 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
854 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
856 if(autocvar_r_letterbox)
859 vector picsize, hudloc = '0 0 0', pic2size, picloc;
861 // Fetch health & ammo stats
864 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
865 hudloc_y = vid_conheight - picsize.y;
866 hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
868 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
875 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
876 picloc = picsize * 0.5 - pic2size * 0.5;
878 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
880 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
881 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
882 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
883 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
884 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
887 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
888 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
889 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
890 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
893 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
894 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
897 if(alarm1time < time)
899 alarm1time = time + 2;
900 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
903 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
907 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
910 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
917 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
918 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
919 drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight);
920 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
923 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
924 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
927 if(alarm2time < time)
929 alarm2time = time + 1;
930 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
932 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
936 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
939 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
945 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
946 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
947 drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight);
948 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
951 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
952 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
954 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
956 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
959 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
960 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
961 drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload1, vid_conheight);
962 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
965 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
966 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
968 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
970 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
972 if (scoreboard_showscores)
973 HUD_DrawScoreboard();
976 picsize = draw_getimagesize(waki_xhair);
981 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);
985 void Vehicles_Precache()
987 precache_model("models/vehicles/bomblet.md3");
988 precache_model("models/vehicles/clusterbomb.md3");
989 precache_model("models/vehicles/clusterbomb_fragment.md3");
990 precache_model("models/vehicles/rocket01.md3");
991 precache_model("models/vehicles/rocket02.md3");
993 precache_sound ("vehicles/alarm.wav");
994 precache_sound ("vehicles/alarm_shield.wav");
997 void RaptorCBShellfragDraw()
1002 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
1003 self.move_avelocity += randomvec() * 15;
1004 self.renderflags = 0;
1007 self.alpha = bound(0, self.nextthink - time, 1);
1009 if(self.alpha < ALPHA_MIN_VISIBLE)
1013 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
1018 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
1019 setorigin(sfrag, _org);
1021 sfrag.move_movetype = MOVETYPE_BOUNCE;
1022 sfrag.gravity = 0.15;
1023 sfrag.solid = SOLID_CORPSE;
1025 sfrag.draw = RaptorCBShellfragDraw;
1027 sfrag.move_origin = sfrag.origin = _org;
1028 sfrag.move_velocity = _vel;
1029 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
1030 sfrag.angles = self.move_angles = _ang;
1032 sfrag.move_time = time;
1033 sfrag.damageforcescale = 4;
1035 sfrag.nextthink = time + 3;
1036 sfrag.cnt = time + 2;
1038 sfrag.drawmask = MASK_NORMAL;