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()
90 // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
93 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
94 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
99 hud_id = bound(HUD_SPIDERBOT, hud_id, HUD_RAPTOR);
101 // Init auxiliary crosshairs
103 for(i = 0; i < MAX_AXH; ++i)
105 axh = AuxiliaryXhair[i];
106 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
110 axh.draw2d = Draw_Not;
111 axh.drawmask = MASK_NORMAL;
112 axh.axh_drawflag = DRAWFLAG_NORMAL;
113 axh.axh_fadetime = 0.1;
114 axh.axh_image = "gfx/vehicles/axh-ring.tga";
117 AuxiliaryXhair[i] = axh;
124 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
125 AuxiliaryXhair[0].axh_scale = 0.25;
127 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
128 AuxiliaryXhair[1].axh_scale = 0.25;
130 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
131 AuxiliaryXhair[2].axh_scale = 0.5;
135 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
136 AuxiliaryXhair[0].axh_scale = 0.25;
140 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
141 AuxiliaryXhair[0].axh_scale = 0.5;
142 //AuxiliaryXhair[0].alpha = 0.5;
144 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
145 AuxiliaryXhair[1].axh_scale = 0.25;
146 //AuxiliaryXhair[1].alpha = 0.75;
147 //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
152 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
153 AuxiliaryXhair[0].axh_scale = 0.25;
155 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-special1.tga";
156 AuxiliaryXhair[1].axh_scale = 0.25;
160 #define HUD_GETSTATS \
161 float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
162 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
163 float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
164 float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
165 float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
166 float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
167 float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
169 void CSQC_BUMBLE_HUD()
174 #define spider_ico "gfx/vehicles/sbot.tga"
175 #define spider_rkt "gfx/vehicles/sbot_rpods.tga"
176 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
177 #define spider_xhair "gfx/vehicles/axh-special1.tga"
181 void CSQC_SPIDER_HUD()
183 if(autocvar_r_letterbox)
186 vector picsize, hudloc, pic2size, picloc;
189 // Fetch health & ammo stats
192 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
193 hudloc_y = vid_conheight - picsize_y;
194 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
196 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
198 //drawstring(hudloc + '145 19 0', strcat(ftos(vh_health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
199 //drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
200 //drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
201 //drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
208 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
209 picloc = picsize * 0.5 - pic2size * 0.5;
211 drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
213 drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
214 drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
215 drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
216 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
219 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
220 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
221 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
222 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
225 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
226 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
229 if(alarm1time < time)
231 alarm1time = time + 2;
232 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
234 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
238 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
241 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
246 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
247 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
248 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
249 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
252 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
253 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
256 if(alarm2time < time)
258 alarm2time = time + 1;
259 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
261 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
265 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
268 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
275 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
276 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
277 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight);
278 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
281 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
282 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
284 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
286 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
289 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
290 ammo1 = picsize_x / 8;
291 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
292 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight);
293 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
297 pic2size = 0.35 * drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
298 picloc_x -= pic2size_x;
299 picloc_y += pic2size_y * 2.25;
302 for(i = 1; i < 9; ++i)
305 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL);
310 for(i = 1; i < 9; ++i)
313 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL);
316 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
317 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
319 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
321 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
323 if (scoreboard_showscores)
324 HUD_DrawScoreboard();
327 picsize = drawgetimagesize(spider_xhair);
328 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
329 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
331 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);
335 #define raptor_ico "gfx/vehicles/raptor.tga"
336 #define raptor_gun "gfx/vehicles/raptor_guns.tga"
337 #define raptor_bomb "gfx/vehicles/raptor_bombs.tga"
338 #define raptor_drop "gfx/vehicles/axh-dropcross.tga"
339 #define raptor_xhair "gfx/vehicles/axh-ring.tga"
340 void CSQC_RAPTOR_HUD()
342 if(autocvar_r_letterbox)
345 vector picsize, hudloc, pic2size, picloc;
347 // Fetch health & ammo stats
350 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
351 hudloc_y = vid_conheight - picsize_y;
352 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
354 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
361 reload1 = reload2 * 0.01;
364 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
365 picloc = picsize * 0.5 - pic2size * 0.5;
367 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
369 drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
370 drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
371 drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
372 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
375 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
376 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
377 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
378 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
381 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
382 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
385 if(alarm1time < time)
387 alarm1time = time + 2;
388 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
391 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
395 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
398 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
404 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
405 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
406 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
407 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
410 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
411 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
414 if(alarm2time < time)
416 alarm2time = time + 1;
417 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
419 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
423 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
426 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
432 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
433 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
434 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
435 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
438 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
439 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
441 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
443 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
446 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
447 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
448 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
449 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
452 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
453 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
455 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
457 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
463 dropmark.owner = self;
464 dropmark.gravity = 1;
471 setorigin(dropmark, pmove_org);
472 dropmark.velocity = pmove_vel;
473 tracetoss(dropmark, self);
475 where = project_3d_to_2d(trace_endpos);
477 setorigin(dropmark, trace_endpos);
478 picsize = drawgetimagesize(raptor_drop) * 0.2;
480 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
482 where_x -= picsize_x * 0.5;
483 where_y -= picsize_y * 0.5;
485 drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
487 dropmark.cnt = time + 5;
492 if(dropmark.cnt > time)
494 where = project_3d_to_2d(dropmark.origin);
495 picsize = drawgetimagesize(raptor_drop) * 0.25;
497 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
499 where_x -= picsize_x * 0.5;
500 where_y -= picsize_y * 0.5;
502 drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
507 if (scoreboard_showscores)
508 HUD_DrawScoreboard();
511 picsize = drawgetimagesize(raptor_xhair);
515 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);
519 #define waki_ico "gfx/vehicles/waki.tga"
520 #define waki_eng "gfx/vehicles/waki_e.tga"
521 #define waki_gun "gfx/vehicles/waki_guns.tga"
522 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
523 #define waki_xhair "gfx/vehicles/axh-special1.tga"
524 void CSQC_WAKIZASHI_HUD()
527 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
528 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
529 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
530 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
532 if(autocvar_r_letterbox)
535 vector picsize, hudloc, pic2size, picloc;
537 // Fetch health & ammo stats
540 picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
541 hudloc_y = vid_conheight - picsize_y;
542 hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
544 drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
551 pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8);
552 picloc = picsize * 0.5 - pic2size * 0.5;
554 drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
556 drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL);
557 drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
558 drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
559 drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
560 drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL);
563 picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
564 picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
565 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight);
566 drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL);
569 picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
570 picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
573 if(alarm1time < time)
575 alarm1time = time + 2;
576 sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
579 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
583 drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
586 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
593 picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
594 picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
595 drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight);
596 drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
599 picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
600 picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
603 if(alarm2time < time)
605 alarm2time = time + 1;
606 sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
608 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
612 drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
615 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
621 picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
622 picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
623 drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight);
624 drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
627 picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
628 picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
630 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
632 drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
635 picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
636 picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
637 drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight);
638 drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
641 pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
642 picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
644 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
646 drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
648 if (scoreboard_showscores)
649 HUD_DrawScoreboard();
652 picsize = drawgetimagesize(waki_xhair);
657 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);
661 void Vehicles_Precache()
663 // fixme: HAAAAKKKZZZ!!!!!!!!!!!! (this belongs as a setting in default.cfg)
664 autocvar_cl_vehicles_hudscale = 0.5;
665 autocvar_cl_vehicles_hudalpha = 0.75;
668 precache_model("models/vehicles/wakizashi.dpm");
670 precache_model("models/vehicles/bomblet.md3");
671 precache_model("models/vehicles/clusterbomb.md3");
672 precache_model("models/vehicles/clusterbomb_fragment.md3");
673 precache_model("models/vehicles/rocket01.md3");
674 precache_model("models/vehicles/rocket02.md3");
676 precache_sound ("vehicles/alarm.wav");
677 precache_sound ("vehicles/alarm_shield.wav");
680 void RaptorCBShellfragDraw()
683 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
687 self.move_avelocity += randomvec() * 15;
688 self.renderflags = 0;
690 self.alpha = bound(0, self.nextthink - time, 1);
692 if(self.alpha < ALPHA_MIN_VISIBLE)
696 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
701 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
702 setorigin(sfrag, _org);
704 sfrag.move_movetype = MOVETYPE_BOUNCE;
705 sfrag.gravity = 0.15;
706 sfrag.solid = SOLID_CORPSE;
708 sfrag.draw = RaptorCBShellfragDraw;
710 sfrag.move_origin = sfrag.origin = _org;
711 sfrag.move_velocity = _vel;
712 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
713 sfrag.angles = self.move_angles = _ang;
715 sfrag.move_time = time;
716 sfrag.damageforcescale = 4;
718 sfrag.nextthink = time + 3;
719 sfrag.cnt = time + 2;
721 sfrag.drawmask = MASK_NORMAL;