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"
17 #define SBRM_ARTILLERY 3
26 float autocvar_cl_vehicles_hudscale;
27 float autocvar_cl_vehicles_hudalpha;
29 #define raptor_ico "gfx/vehicles/raptor.tga"
30 #define raptor_gun "gfx/vehicles/raptor_guns.tga"
31 #define raptor_bomb "gfx/vehicles/raptor_bombs.tga"
32 #define raptor_drop "gfx/vehicles/axh-dropcross.tga"
35 void CSQC_WAKIZASHI_HUD();
36 void CSQC_SPIDER_HUD();
37 void CSQC_RAPTOR_HUD();
38 void CSQC_BUMBLE_HUD();
41 entity AuxiliaryXhair[MAX_AXH];
42 const var void Draw_Not();
49 #define spider_ico "gfx/vehicles/sbot.tga"
50 #define spider_rkt "gfx/vehicles/sbot_rpods.tga"
51 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
52 string spider_xhair; // = "gfx/vehicles/axh-special1.tga";
54 #define waki_ico "gfx/vehicles/waki.tga"
55 #define waki_eng "gfx/vehicles/waki_e.tga"
56 #define waki_gun "gfx/vehicles/waki_guns.tga"
57 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
58 #define waki_xhair "gfx/vehicles/axh-special1.tga"
63 void AuxiliaryXhair_Draw2D()
67 psize = self.axh_scale * draw_getimagesize(self.axh_image);
68 loc = project_3d_to_2d(self.origin) - 0.5 * psize;
69 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
73 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
76 if(time - self.cnt > self.axh_fadetime)
77 self.draw2d = Draw_Not;
80 void Net_AuXair2(float bIsNew)
85 axh_id = bound(0, ReadByte(), MAX_AXH);
86 axh = AuxiliaryXhair[axh_id];
88 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
91 axh.draw2d = Draw_Not;
92 axh.drawmask = MASK_NORMAL;
93 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
94 axh.axh_fadetime = 0.1;
95 axh.axh_image = "gfx/vehicles/axh-ring.tga";
98 AuxiliaryXhair[axh_id] = axh;
101 axh.draw2d = AuxiliaryXhair_Draw2D;
103 axh.origin_x = ReadCoord();
104 axh.origin_y = ReadCoord();
105 axh.origin_z = ReadCoord();
107 axh.colormod_x = ReadByte() / 255;
108 axh.colormod_y = ReadByte() / 255;
109 axh.colormod_z = ReadByte() / 255;
114 void Net_VehicleSetup()
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, ATTN_NONE);
132 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
137 hud_id = bound(HUD_SPIDERBOT, hud_id, HUD_RAPTOR);
139 // Init auxiliary crosshairs
141 for(i = 0; i < MAX_AXH; ++i)
143 axh = AuxiliaryXhair[i];
144 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
148 axh.draw2d = Draw_Not;
149 axh.drawmask = MASK_NORMAL;
150 axh.axh_drawflag = DRAWFLAG_NORMAL;
151 axh.axh_fadetime = 0.1;
152 axh.axh_image = "gfx/vehicles/axh-ring.tga";
155 AuxiliaryXhair[i] = axh;
162 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
163 AuxiliaryXhair[0].axh_scale = 0.25;
165 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
166 AuxiliaryXhair[1].axh_scale = 0.25;
168 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
169 AuxiliaryXhair[2].axh_scale = 0.5;
173 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
174 AuxiliaryXhair[0].axh_scale = 0.25;
178 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
179 AuxiliaryXhair[0].axh_scale = 0.5;
180 //AuxiliaryXhair[0].alpha = 0.5;
182 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
183 AuxiliaryXhair[1].axh_scale = 0.25;
184 //AuxiliaryXhair[1].alpha = 0.75;
185 //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
190 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
191 AuxiliaryXhair[0].axh_scale = 0.25;
193 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-special1.tga";
194 AuxiliaryXhair[1].axh_scale = 0.25;
198 #define HUD_GETSTATS \
199 float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
200 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
201 float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
202 float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
203 float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
204 float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
205 float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
207 void CSQC_BUMBLE_HUD()
210 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
211 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
212 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
213 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
215 if(autocvar_r_letterbox)
218 vector picsize, hudloc, pic2size, picloc;
220 // Fetch health & ammo stats
223 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
224 hudloc_y = vid_conheight - picsize_y;
225 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
227 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
234 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
235 picloc = picsize * 0.5 - pic2size * 0.5;
237 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
239 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
240 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
241 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
242 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
243 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
246 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
247 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
248 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
249 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
252 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
253 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
256 if(alarm1time < time)
258 alarm1time = time + 2;
259 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
262 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
266 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
269 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
276 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
277 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
278 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
279 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
282 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
283 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
286 if(alarm2time < time)
288 alarm2time = time + 1;
289 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
291 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
295 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
298 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
304 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
305 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
306 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
307 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
310 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
311 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
313 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
315 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
318 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
319 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
320 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
321 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
324 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
325 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
327 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
329 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
331 if (scoreboard_showscores)
332 HUD_DrawScoreboard();
335 picsize = draw_getimagesize(waki_xhair);
340 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);
347 void CSQC_SPIDER_HUD()
349 if(autocvar_r_letterbox)
352 vector picsize, hudloc, pic2size, picloc;
355 // Fetch health & ammo stats
358 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
359 hudloc_y = vid_conheight - picsize_y;
360 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
362 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
369 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
370 picloc = picsize * 0.5 - pic2size * 0.5;
372 drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
374 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
375 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
376 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
377 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
380 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
381 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
382 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
383 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
386 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
387 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
390 if(alarm1time < time)
392 alarm1time = time + 2;
393 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
395 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
399 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
402 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
407 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
408 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
409 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
410 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
413 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
414 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
417 if(alarm2time < time)
419 alarm2time = time + 1;
420 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
422 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
426 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
429 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
435 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
436 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
437 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
438 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
441 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
442 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
444 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
446 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
449 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
450 ammo1 = picsize_x / 8;
451 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
452 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
453 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
457 pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
458 picloc_x -= pic2size_x;
459 picloc_y += pic2size_y * 2.25;
462 for(i = 1; i < 9; ++i)
465 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
470 for(i = 1; i < 9; ++i)
473 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
476 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
477 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
479 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
481 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
483 if (scoreboard_showscores)
484 HUD_DrawScoreboard();
490 spider_xhair = "gfx/vehicles/axh-bracket.tga";
493 spider_xhair = "gfx/vehicles/axh-cross.tga";
496 spider_xhair = "gfx/vehicles/axh-tag.tga";
499 spider_xhair= "gfx/vehicles/axh-tag.tga";
502 picsize = draw_getimagesize(spider_xhair);
503 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
504 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
506 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);
510 void CSQC_RAPTOR_HUD()
512 if(autocvar_r_letterbox)
515 vector picsize, hudloc, pic2size, picloc;
517 // Fetch health & ammo stats
520 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
521 hudloc_y = vid_conheight - picsize_y;
522 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
524 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
531 reload1 = reload2 * 0.01;
534 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
535 picloc = picsize * 0.5 - pic2size * 0.5;
537 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
539 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
540 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
541 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
542 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
545 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
546 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
547 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
548 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
551 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
552 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
555 if(alarm1time < time)
557 alarm1time = time + 2;
558 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
561 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
565 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
568 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
574 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
575 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
576 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
577 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
580 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
581 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
584 if(alarm2time < time)
586 alarm2time = time + 1;
587 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
589 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
593 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
596 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
602 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
603 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
604 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
605 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
608 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
609 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
611 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
613 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
616 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
617 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
618 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
619 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
622 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
623 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
625 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
627 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
629 if(weapon2mode == RSM_FLARE)
631 raptor_xhair = "gfx/vehicles/axh-bracket.tga";
635 raptor_xhair = "gfx/vehicles/axh-ring.tga";
641 dropmark.owner = self;
642 dropmark.gravity = 1;
649 setorigin(dropmark, pmove_org);
650 dropmark.velocity = pmove_vel;
651 tracetoss(dropmark, self);
653 where = project_3d_to_2d(trace_endpos);
655 setorigin(dropmark, trace_endpos);
656 picsize = draw_getimagesize(raptor_drop) * 0.2;
658 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
660 where_x -= picsize_x * 0.5;
661 where_y -= picsize_y * 0.5;
663 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
665 dropmark.cnt = time + 5;
670 if(dropmark.cnt > time)
672 where = project_3d_to_2d(dropmark.origin);
673 picsize = draw_getimagesize(raptor_drop) * 0.25;
675 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
677 where_x -= picsize_x * 0.5;
678 where_y -= picsize_y * 0.5;
680 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
686 if (scoreboard_showscores)
687 HUD_DrawScoreboard();
690 picsize = draw_getimagesize(raptor_xhair);
694 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);
698 void CSQC_WAKIZASHI_HUD()
701 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
702 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
703 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
704 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
706 if(autocvar_r_letterbox)
709 vector picsize, hudloc, pic2size, picloc;
711 // Fetch health & ammo stats
714 picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
715 hudloc_y = vid_conheight - picsize_y;
716 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
718 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
725 pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
726 picloc = picsize * 0.5 - pic2size * 0.5;
728 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
730 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
731 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
732 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
733 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
734 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
737 picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
738 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
739 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
740 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
743 picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
744 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
747 if(alarm1time < time)
749 alarm1time = time + 2;
750 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
753 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
757 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
760 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
767 picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
768 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
769 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
770 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
773 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
774 picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
777 if(alarm2time < time)
779 alarm2time = time + 1;
780 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
782 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
786 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
789 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
795 picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
796 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
797 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
798 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
801 picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
802 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
804 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
806 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
809 picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
810 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
811 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
812 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
815 pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
816 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
818 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
820 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
822 if (scoreboard_showscores)
823 HUD_DrawScoreboard();
826 picsize = draw_getimagesize(waki_xhair);
831 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);
835 void Vehicles_Precache()
837 // fixme: HAAAAKKKZZZ!!!!!!!!!!!! (this belongs as a setting in default.cfg)
838 if(!autocvar_cl_vehicles_hudscale )
839 autocvar_cl_vehicles_hudscale = 0.5;
841 if(!autocvar_cl_vehicles_hudalpha)
842 autocvar_cl_vehicles_hudalpha = 0.75;
844 //precache_model("models/vehicles/wakizashi.dpm");
846 precache_model("models/vehicles/bomblet.md3");
847 precache_model("models/vehicles/clusterbomb.md3");
848 precache_model("models/vehicles/clusterbomb_fragment.md3");
849 precache_model("models/vehicles/rocket01.md3");
850 precache_model("models/vehicles/rocket02.md3");
852 precache_sound ("vehicles/alarm.wav");
853 precache_sound ("vehicles/alarm_shield.wav");
856 void RaptorCBShellfragDraw()
859 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
863 self.move_avelocity += randomvec() * 15;
864 self.renderflags = 0;
866 self.alpha = bound(0, self.nextthink - time, 1);
868 if(self.alpha < ALPHA_MIN_VISIBLE)
872 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
877 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
878 setorigin(sfrag, _org);
880 sfrag.move_movetype = MOVETYPE_BOUNCE;
881 sfrag.gravity = 0.15;
882 sfrag.solid = SOLID_CORPSE;
884 sfrag.draw = RaptorCBShellfragDraw;
886 sfrag.move_origin = sfrag.origin = _org;
887 sfrag.move_velocity = _vel;
888 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
889 sfrag.angles = self.move_angles = _ang;
891 sfrag.move_time = time;
892 sfrag.damageforcescale = 4;
894 sfrag.nextthink = time + 3;
895 sfrag.cnt = time + 2;
897 sfrag.drawmask = MASK_NORMAL;