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"
15 float autocvar_cl_vehicles_hudscale;
16 float autocvar_cl_vehicles_hudalpha;
19 void CSQC_WAKIZASHI_HUD();
20 void CSQC_SPIDER_HUD();
21 void CSQC_RAPTOR_HUD();
22 void CSQC_BUMBLE_HUD();
25 entity AuxiliaryXhair[MAX_AXH];
26 const var void Draw_Not();
33 void AuxiliaryXhair_Draw2D()
37 psize = self.axh_scale * drawgetimagesize(self.axh_image);
38 loc = project_3d_to_2d(self.origin) - 0.5 * psize;
39 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
43 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
46 if(time - self.cnt > self.axh_fadetime)
47 self.draw2d = Draw_Not;
50 void Net_AuXair2(float bIsNew)
55 axh_id = bound(0, ReadByte(), MAX_AXH);
56 axh = AuxiliaryXhair[axh_id];
58 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
61 axh.draw2d = Draw_Not;
62 axh.drawmask = MASK_NORMAL;
63 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
64 axh.axh_fadetime = 0.1;
65 axh.axh_image = "gfx/vehicles/axh-ring.tga";
68 AuxiliaryXhair[axh_id] = axh;
71 axh.draw2d = AuxiliaryXhair_Draw2D;
73 axh.origin_x = ReadCoord();
74 axh.origin_y = ReadCoord();
75 axh.origin_z = ReadCoord();
77 axh.colormod_x = ReadByte() / 255;
78 axh.colormod_y = ReadByte() / 255;
79 axh.colormod_z = ReadByte() / 255;
83 void Net_VehicleSetup()
87 hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
89 // Init auxiliary crosshairs
91 for(i = 0; i < MAX_AXH; ++i)
93 axh = AuxiliaryXhair[i];
94 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_NORMAL;
101 axh.axh_fadetime = 0.1;
102 axh.axh_image = "gfx/vehicles/axh-ring.tga";
105 AuxiliaryXhair[i] = axh;
112 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
113 AuxiliaryXhair[0].axh_scale = 0.25;
115 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
116 AuxiliaryXhair[1].axh_scale = 0.25;
118 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
119 AuxiliaryXhair[2].axh_scale = 0.5;
123 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
124 AuxiliaryXhair[0].axh_scale = 0.25;
128 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
129 AuxiliaryXhair[0].axh_scale = 0.5;
130 //AuxiliaryXhair[0].alpha = 0.5;
132 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
133 AuxiliaryXhair[1].axh_scale = 0.25;
134 //AuxiliaryXhair[1].alpha = 0.75;
135 //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
140 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
141 AuxiliaryXhair[0].axh_scale = 0.25;
143 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-special1.tga";
144 AuxiliaryXhair[1].axh_scale = 0.25;
148 #define HUD_GETSTATS \
149 float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
150 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
151 float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
152 float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
153 float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
154 float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
155 float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
157 void CSQC_BUMBLE_HUD()
162 #define spider_ico "gfx/vehicles/sbot.tga"
163 #define spider_rkt "gfx/vehicles/sbot_rpods.tga"
164 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
165 #define spider_xhair "gfx/vehicles/axh-special1.tga"
169 void CSQC_SPIDER_HUD()
171 if(autocvar_r_letterbox)
174 vector picsize, hudloc, pic2size, picloc;
177 // Fetch health & ammo stats
180 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
181 hudloc_y = vid_conheight - picsize_y;
182 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
184 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
186 //drawstring(hudloc + '145 19 0', strcat(ftos(vh_health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
187 //drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
188 //drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
189 //drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
196 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
197 picloc = picsize * 0.5 - pic2size * 0.5;
199 drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
201 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
202 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
203 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
204 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
207 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
208 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
209 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
210 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
213 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
214 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
217 if(alarm1time < time)
219 alarm1time = time + 2;
220 sound(world, CHAN_PAIN, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
222 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
226 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
229 sound(world, CHAN_PAIN, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
234 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
235 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
236 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
237 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
240 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
241 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
244 if(alarm2time < time)
246 alarm2time = time + 1;
247 sound(world, CHAN_TRIGGER, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
249 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
253 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
256 sound(world, CHAN_TRIGGER, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
263 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
264 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
265 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
266 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
269 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
270 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
272 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
274 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
277 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
278 ammo1 = picsize_x / 8;
279 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
280 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
281 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
285 pic2size = 0.35 * drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
286 picloc_x -= pic2size_x;
287 picloc_y += pic2size_y * 2.25;
290 for(i = 1; i < 9; ++i)
293 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
298 for(i = 1; i < 9; ++i)
301 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
304 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
305 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
307 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
309 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
311 if (scoreboard_showscores)
312 HUD_DrawScoreboard();
315 picsize = drawgetimagesize(spider_xhair);
316 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
317 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
319 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);
323 #define raptor_ico "gfx/vehicles/raptor.tga"
324 #define raptor_gun "gfx/vehicles/raptor_guns.tga"
325 #define raptor_bomb "gfx/vehicles/raptor_bombs.tga"
326 #define raptor_drop "gfx/vehicles/axh-dropcross.tga"
327 #define raptor_xhair "gfx/vehicles/axh-ring.tga"
328 void CSQC_RAPTOR_HUD()
330 if(autocvar_r_letterbox)
333 vector picsize, hudloc, pic2size, picloc;
335 // Fetch health & ammo stats
338 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
339 hudloc_y = vid_conheight - picsize_y;
340 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
342 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
349 reload1 = reload2 * 0.01;
352 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
353 picloc = picsize * 0.5 - pic2size * 0.5;
355 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
357 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
358 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
359 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
360 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
363 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
364 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
365 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
366 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
369 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
370 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
373 if(alarm1time < time)
375 alarm1time = time + 2;
376 sound(self, CHAN_PAIN, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
379 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
383 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
386 sound(self, CHAN_PAIN, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
392 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
393 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
394 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
395 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
398 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
399 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
402 if(alarm2time < time)
404 alarm2time = time + 1;
405 sound(world, CHAN_TRIGGER, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
407 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
411 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
414 sound(world, CHAN_TRIGGER, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
420 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
421 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
422 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
423 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
426 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
427 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
429 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
431 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
434 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
435 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
436 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
437 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
440 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
441 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
443 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
445 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
451 dropmark.owner = self;
452 dropmark.gravity = 1;
459 setorigin(dropmark, pmove_org);
460 dropmark.velocity = pmove_vel;
461 tracetoss(dropmark, self);
463 where = project_3d_to_2d(trace_endpos);
465 setorigin(dropmark, trace_endpos);
466 picsize = drawgetimagesize(raptor_drop) * 0.2;
468 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
470 where_x -= picsize_x * 0.5;
471 where_y -= picsize_y * 0.5;
473 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
475 dropmark.cnt = time + 5;
480 if(dropmark.cnt > time)
482 where = project_3d_to_2d(dropmark.origin);
483 picsize = drawgetimagesize(raptor_drop) * 0.25;
485 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
487 where_x -= picsize_x * 0.5;
488 where_y -= picsize_y * 0.5;
490 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
495 if (scoreboard_showscores)
496 HUD_DrawScoreboard();
499 picsize = drawgetimagesize(raptor_xhair);
503 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);
507 #define waki_ico "gfx/vehicles/waki.tga"
508 #define waki_eng "gfx/vehicles/waki_e.tga"
509 #define waki_gun "gfx/vehicles/waki_guns.tga"
510 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
511 #define waki_xhair "gfx/vehicles/axh-special1.tga"
512 void CSQC_WAKIZASHI_HUD()
515 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
516 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
517 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
518 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
520 if(autocvar_r_letterbox)
523 vector picsize, hudloc, pic2size, picloc;
525 // Fetch health & ammo stats
528 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
529 hudloc_y = vid_conheight - picsize_y;
530 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
532 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
539 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
540 picloc = picsize * 0.5 - pic2size * 0.5;
542 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
544 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
545 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
546 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
547 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
548 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
551 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
552 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
553 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
554 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
557 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
558 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
561 if(alarm1time < time)
563 alarm1time = time + 2;
564 sound(self, CHAN_PAIN, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
567 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
571 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
574 sound(self, CHAN_PAIN, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
581 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
582 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
583 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
584 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
587 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
588 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
591 if(alarm2time < time)
593 alarm2time = time + 1;
594 sound(world, CHAN_TRIGGER, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
596 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
600 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
603 sound(world, CHAN_TRIGGER, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
609 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
610 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
611 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
612 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
615 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
616 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
618 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
620 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
623 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
624 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
625 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
626 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
629 pic2size = drawgetimagesize(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();
640 picsize = drawgetimagesize(waki_xhair);
645 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);
649 void Vehicles_Precache()
651 // fixme: HAAAAKKKZZZ!!!!!!!!!!!! (this belongs as a setting in default.cfg)
652 autocvar_cl_vehicles_hudscale = 0.5;
653 autocvar_cl_vehicles_hudalpha = 0.75;
656 precache_model("models/vehicles/wakizashi.dpm");
658 precache_model("models/vehicles/bomblet.md3");
659 precache_model("models/vehicles/clusterbomb.md3");
660 precache_model("models/vehicles/clusterbomb_fragment.md3");
661 precache_model("models/vehicles/rocket01.md3");
662 precache_model("models/vehicles/rocket02.md3");
664 precache_sound ("vehicles/alarm.wav");
665 precache_sound ("vehicles/alarm_shield.wav");
668 void RaptorCBShellfragDraw()
671 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
675 self.move_avelocity += randomvec() * 15;
676 self.renderflags = 0;
678 self.alpha = bound(0, self.nextthink - time, 1);
680 if(self.alpha < ALPHA_MIN_VISIBLE)
684 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
689 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
690 setorigin(sfrag, _org);
692 sfrag.move_movetype = MOVETYPE_BOUNCE;
693 sfrag.gravity = 0.15;
694 sfrag.solid = SOLID_CORPSE;
696 sfrag.draw = RaptorCBShellfragDraw;
698 sfrag.move_origin = sfrag.origin = _org;
699 sfrag.move_velocity = _vel;
700 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
701 sfrag.angles = self.move_angles = _ang;
703 sfrag.move_time = time;
704 sfrag.damageforcescale = 4;
706 sfrag.nextthink = time + 3;
707 sfrag.cnt = time + 2;
709 sfrag.drawmask = MASK_NORMAL;