]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/vehicles/vehicles.qc
New vehicles hud gfx by SoulKeeper_p
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / vehicles / vehicles.qc
1 #define spider_rocket_icon "gfx/vehicles/rocket_ico.tga"
2 #define spider_rocket_targ "gfx/vehicles/target.tga"
3 //#define SPIDER_CROSS "textures/spiderbot/cross.tga"
4 #define SPIDER_CROSS "gfx/vehicles/axh-special1.tga"
5
6 /*
7 #define axh1 "gfx/vehicles/sbot-xhair2.tga"
8 #define axh2 "gfx/vehicles/sbot-xhair2.tga"
9 #define axh3 "gfx/vehicles/sbot-xhair2.tga"
10 */
11
12 #define hud_bg "gfx/vehicles/frame.tga"
13 #define hud_sh "gfx/vehicles/vh-shield.tga"
14
15 #define hud_hp_bar "gfx/vehicles/bar_up_left.tga"
16 #define hud_hp_ico "gfx/vehicles/health.tga"
17 #define hud_sh_bar "gfx/vehicles/bar_dwn_left.tga"
18 #define hud_sh_ico "gfx/vehicles/shield.tga"
19
20 #define hud_ammo1_bar "gfx/vehicles/bar_up_right.tga"
21 #define hud_ammo1_ico "gfx/vehicles/bullets.tga"
22 #define hud_ammo2_bar "gfx/vehicles/bar_dwn_right.tga"
23 #define hud_ammo2_ico "gfx/vehicles/rocket.tga"
24
25 #define spider_ico  "gfx/vehicles/sbot.tga"
26 #define spider_rkt  "gfx/vehicles/sbot_rpods.tga"
27 #define spider_mgun "gfx/vehicles/sbot_mguns.tga"
28
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"
33
34 #define waki_ico "gfx/vehicles/waki.tga"
35 #define waki_eng "gfx/vehicles/waki_e.tga"
36 #define waki_gun "gfx/vehicles/waki_guns.tga"
37 #define waki_rkt "gfx/vehicles/waki_rockets.tga"
38
39 entity dropmark;
40
41 void CSQC_WAKIZASHI_HUD();
42 void CSQC_SPIDER_HUD();
43 void CSQC_RAPTOR_HUD();
44 void CSQC_BUMBLE_HUD();
45
46 #define MAX_AXH 4
47 entity AuxiliaryXhair[MAX_AXH];
48 const var void Draw_Not();
49
50 .string axh_image;
51 .float  axh_fadetime;
52 .float  axh_drawflag;
53 .float  axh_scale;
54
55 void AuxiliaryXhair_Draw2D()
56 {
57     vector loc, psize;
58
59     psize = self.axh_scale * drawgetimagesize(self.axh_image);
60     loc = project_3d_to_2d(self.origin) - 0.5 * psize;
61     if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
62     {
63         loc_z = 0;
64         psize_z = 0;
65         drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
66     }
67
68     if(time - self.cnt > self.axh_fadetime)
69         self.draw2d = Draw_Not;
70 }
71
72 void Net_AuXair2(float bIsNew)
73 {
74     float axh_id;
75     entity axh;
76
77     axh_id = bound(0, ReadByte(), MAX_AXH);
78     axh = AuxiliaryXhair[axh_id];
79
80     if(axh == world || wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
81     {
82         axh               = spawn();
83                 axh.draw2d        = Draw_Not;
84                 axh.drawmask      = MASK_NORMAL;
85                 axh.axh_drawflag  = DRAWFLAG_ADDITIVE;
86                 axh.axh_fadetime  = 0.1;
87                 axh.axh_image     = "gfx/vehicles/axh-ring.tga";
88                 axh.axh_scale     = 1;
89         axh.alpha         = 1;
90                 AuxiliaryXhair[axh_id] = axh;
91     }
92
93     axh.draw2d   = AuxiliaryXhair_Draw2D;
94
95         axh.origin_x = ReadCoord();
96         axh.origin_y = ReadCoord();
97         axh.origin_z = ReadCoord();
98
99         axh.colormod_x = ReadByte() / 255;
100         axh.colormod_y = ReadByte() / 255;
101         axh.colormod_z = ReadByte() / 255;
102     axh.cnt = time;
103 }
104
105 void Net_VehicleSetup()
106 {
107
108     float hud_id, i;
109     hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
110
111     // Init auxiliary crosshairs
112     entity axh;
113     for(i = 0; i < MAX_AXH; ++i)
114     {
115         axh = AuxiliaryXhair[i];
116         if(axh != world && !wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
117             remove(axh);
118
119         axh               = spawn();
120                 axh.draw2d        = Draw_Not;
121                 axh.drawmask      = MASK_NORMAL;
122                 axh.axh_drawflag  = DRAWFLAG_ADDITIVE;
123                 axh.axh_fadetime  = 0.1;
124                 axh.axh_image     = "gfx/vehicles/axh-ring.tga";
125                 axh.axh_scale     = 1;
126         axh.alpha         = 1;
127                 AuxiliaryXhair[i] = axh;
128     }
129
130     switch(hud_id)
131     {
132         case HUD_SPIDERBOT:
133             // Minigun1
134             AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-ring.tga";
135             AuxiliaryXhair[0].axh_scale   = 0.25;
136             // Minigun2
137             AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-ring.tga";
138             AuxiliaryXhair[1].axh_scale   = 0.25;
139             // Rocket
140             AuxiliaryXhair[2].axh_image   = "gfx/vehicles/axh-special1.tga";
141             AuxiliaryXhair[2].axh_scale   = 0.5;
142             break;
143
144         case HUD_WAKIZASHI:
145             AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
146             AuxiliaryXhair[0].axh_scale   = 0.25;
147             break;
148
149         case HUD_RAPTOR:
150             AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-cross.tga";
151             AuxiliaryXhair[0].axh_scale   = 0.5;
152             AuxiliaryXhair[0].alpha       = 0.25;
153
154             AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-bracket.tga";
155             AuxiliaryXhair[1].axh_scale   = 0.25;
156             AuxiliaryXhair[1].alpha       = 0.75;
157             AuxiliaryXhair[1].axh_drawflag  = DRAWFLAG_NORMAL;
158             break;
159
160         case HUD_BUMBLEBEE:
161             // Plasma cannons
162             AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-ring.tga";
163             AuxiliaryXhair[0].axh_scale   = 0.25;
164             // Raygun
165             AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-special1.tga";
166             AuxiliaryXhair[1].axh_scale   = 0.25;
167             break;
168     }
169 }
170 #define HUD_GETSTATS \
171     float health    = getstati(STAT_VEHICLESTAT_HEALTH); \
172         float shield    = getstati(STAT_VEHICLESTAT_SHIELD); \
173         float energy    = getstati(STAT_VEHICLESTAT_ENERGY); \
174         float ammo1     = getstati(STAT_VEHICLESTAT_AMMO1); \
175         float reload1   = getstati(STAT_VEHICLESTAT_RELOAD1); \
176         float ammo2     = getstati(STAT_VEHICLESTAT_AMMO2); \
177         float reload2   = getstati(STAT_VEHICLESTAT_RELOAD2);
178
179 void CSQC_BUMBLE_HUD()
180 {
181     /*
182         vector picsize, hudloc;
183
184     // Fetch health & ammo stats
185         HUD_GETSTATS
186
187     hudloc_y = 4;
188     hudloc_x = 4;
189
190     picsize = drawgetimagesize(spider_h) * 0.5;
191     drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
192
193     picsize = drawgetimagesize(spider_a2) * 0.5;
194     drawpic(hudloc + '120 96  0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
195
196     drawstring(hudloc + '145 19  0',  strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
197     drawstring(hudloc + '175 34  0',  strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
198     drawstring(hudloc + '136 102  0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
199
200     picsize = drawgetimagesize(spider_a1) * 0.85;
201     if(ammo2 == 9)
202     {
203         drawpic(hudloc + '132 54  0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
204         drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
205     }
206     else
207     {
208         drawpic(hudloc + '132 54  0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
209         drawstring(hudloc + '179 69  0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
210     }
211
212     picsize = drawgetimagesize(spider_b) * 0.5;
213     hudloc_y = 10.5;
214     hudloc_x = 10.5;
215
216     ammo1  /= 100;
217     shield /= 100;
218     health /= 100;
219     reload2 /= 100;
220
221     drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
222     drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
223     drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
224     drawpic(hudloc, spider_g, picsize, '1 1 1' * ammo1 + '1 0 0' *  (1 - ammo1), 1, DRAWFLAG_NORMAL);
225
226
227         if (scoreboard_showscores)
228         {
229                 HUD_DrawScoreboard();
230                 HUD_DrawCenterPrint();
231     }
232     else
233     {
234         picsize = drawgetimagesize(SPIDER_CROSS);
235         picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
236         picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
237
238         drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE);
239     */
240 }
241
242 float autocvar_cl_vehicles_hudscale;
243 void CSQC_SPIDER_HUD()
244 {
245     vector picsize, hudloc, pic2size, picloc;
246
247
248
249     // Fetch health & ammo stats
250         HUD_GETSTATS
251
252     picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
253     hudloc_y = vid_conheight - picsize_y;
254     hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5;
255
256     drawpic(hudloc, hud_bg, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
257
258     //picsize = drawgetimagesize(spider_a2) * 0.5;
259     //drawpic(hudloc + '120 96  0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
260
261     //drawstring(hudloc + '145 19  0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
262     //drawstring(hudloc + '175 34  0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
263     //drawstring(hudloc + '136 102  0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
264
265     pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
266     if(ammo2 == 9)
267     {
268         picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
269         drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
270         //drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
271     }
272     else
273     {
274         picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
275         drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL);
276         //drawstring(hudloc + '179 69  0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
277     }
278
279     ammo1  /= 100;
280     shield /= 100;
281     health /= 100;
282     reload2 /= 100;
283
284     pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale - 0.1);
285     picloc = picsize * 0.5 - pic2size * 0.5;
286     drawpic(hudloc + picloc, spider_ico, pic2size,  '1 1 1' * health  + '1 0 0' * (1 - health),     1, DRAWFLAG_NORMAL);
287     drawpic(hudloc + picloc, spider_rkt, pic2size,  '1 1 1' * reload2 + '1 0 0' * (1 - reload2),    1, DRAWFLAG_NORMAL);
288     drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1   + '1 0 0' * (1 - ammo1),      1, DRAWFLAG_NORMAL);
289     drawpic(hudloc + picloc, hud_sh, pic2size,  '1 1 1', shield, DRAWFLAG_NORMAL);
290
291
292     // Health icon & bar
293     picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale;
294     picloc = '37 65 0' * autocvar_cl_vehicles_hudscale;
295     drawpic(hudloc + picloc, hud_hp_ico, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
296
297     picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale;
298     picloc = '69 69 0' * autocvar_cl_vehicles_hudscale;
299     //drawsetcliparea(0, 0, hudloc_x + (picsize_x * shield), vid_conheight);
300     drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', health, DRAWFLAG_NORMAL);
301     //drawresetcliparea();
302
303     // Shield icon & bar
304     picloc = '40 136 0' * autocvar_cl_vehicles_hudscale;
305     picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale;
306     drawpic(hudloc + picloc, hud_sh_ico, picsize,'0.15 0.25 1' * shield + '0 0 0' * (1 - shield), 1, DRAWFLAG_NORMAL);
307
308     picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale;
309     picloc = '69 140 0' * autocvar_cl_vehicles_hudscale;
310     //drawsetcliparea(0, 0, hudloc_x + (picsize_x * shield), vid_conheight);
311     drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
312     //drawresetcliparea();
313
314
315     // Minigun ammo icon & bar
316     picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale;
317     picloc = '664 60 0' * autocvar_cl_vehicles_hudscale;
318     drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1' * ammo1 + '1 0 0' *  (1 - ammo1), 1, DRAWFLAG_NORMAL);
319
320     picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale;
321     picloc = '450 69 0' * autocvar_cl_vehicles_hudscale;
322     drawsetcliparea(picloc_x, picloc_y, hudloc_x + (picsize_x * ammo1), vid_conheight);
323     drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', health, DRAWFLAG_NORMAL);
324     drawresetcliparea();
325
326
327     // Rocket ammo icon and bar
328     /*
329     picloc = '664 130 0' * autocvar_cl_vehicles_hudscale;
330     picsize = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale;
331     drawpic(hudloc + picloc, hud_ammo2_ico, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
332     */
333
334     picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale;
335     picloc = '450 140 0' * autocvar_cl_vehicles_hudscale;
336     //drawsetcliparea(0, 0, hudloc_x + (picsize_x * shield), vid_conheight);
337     drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', health, DRAWFLAG_NORMAL);
338     //drawresetcliparea();
339
340         if (scoreboard_showscores)
341         {
342                 HUD_DrawScoreboard();
343                 HUD_DrawCenterPrint();
344     }
345     else
346     {
347         picsize = drawgetimagesize(SPIDER_CROSS);
348         picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
349         picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
350
351         drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE);
352     }
353 }
354
355
356 void CSQC_RAPTOR_HUD()
357 {
358 /*
359         if(autocvar_r_letterbox)
360         return;
361
362         vector picsize, hudloc;
363     vector where;
364
365
366     // Fetch health & ammo stats
367     HUD_GETSTATS
368
369     // Draw the crosshairs
370     picsize = drawgetimagesize("gfx/vehicles/axh-cross.tga");
371     picsize_x *= 0.75;
372     picsize_y *= 0.75;
373     drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), "gfx/vehicles/axh-cross.tga", picsize, '1 0 0' + '0 1 1' * energy, 0.5, DRAWFLAG_ADDITIVE);
374
375     hudloc_y = 4;
376     hudloc_x = 4;
377
378     picsize = drawgetimagesize(raptor_h) * 0.5;
379     drawpic(hudloc, raptor_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
380
381     picsize = drawgetimagesize(spider_a2) * 0.5;
382     drawpic(hudloc + '120 96  0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
383
384     drawstring(hudloc + '145 19  0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
385     drawstring(hudloc + '175 34  0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
386     drawstring(hudloc + '136 102 0', strcat(ftos(energy), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL);
387
388     health /= 100;
389     shield /= 100;
390     energy /= 100;
391
392     picsize = drawgetimagesize(spider_a1) * 0.85;
393     if(reload2 == 100)
394     {
395         drawpic(hudloc + '132 54  0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
396         drawstring(hudloc + '179 69  0', strcat(ftos(reload2), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL);
397     }
398     else
399     {
400         drawpic(hudloc + '132 54  0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
401         drawstring(hudloc + '179 69  0', strcat(ftos(reload2), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL);
402     }
403
404     picsize = drawgetimagesize(raptor_b) * 0.5;
405     hudloc_y = 10.5;
406     hudloc_x = 10.5;
407     reload1 = reload2 / 100;
408     drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
409     drawpic(hudloc, raptor_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
410     drawpic(hudloc, raptor_g1, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
411     drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload1 + '1 0 0' *  (1 - reload1), 1, DRAWFLAG_NORMAL);
412
413     if(!dropmark)
414     {
415         dropmark = spawn();
416         dropmark.owner = self;
417         dropmark.gravity = 1;
418     }
419
420     if(reload2 == 100)
421     {
422         where = dropmark.origin;
423         setorigin(dropmark, pmove_org);
424         dropmark.velocity = pmove_vel;
425         tracetoss(dropmark, self);
426
427         where = project_3d_to_2d(trace_endpos);
428
429         setorigin(dropmark, trace_endpos);
430         picsize = drawgetimagesize(raptor_d) * 0.2;
431
432         if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
433         {
434             where_x -= picsize_x * 0.5;
435             where_y -= picsize_y * 0.5;
436             where_z = 0;
437             drawpic(where, raptor_d, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
438         }
439         dropmark.cnt = time + 5;
440     }
441     else
442     {
443         if(dropmark.cnt > time)
444         {
445             where = project_3d_to_2d(dropmark.origin);
446             picsize = drawgetimagesize(raptor_d) * 0.25;
447
448             if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
449             {
450                 where_x -= picsize_x * 0.5;
451                 where_y -= picsize_y * 0.5;
452                 where_z = 0;
453                 drawpic(where, raptor_d, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
454             }
455         }
456     }
457
458         if (scoreboard_showscores)
459         {
460                 HUD_DrawScoreboard();
461                 HUD_DrawCenterPrint();
462         }
463 */
464 }
465
466 void CSQC_WAKIZASHI_HUD()
467 {
468 /*
469         vector picsize, hudloc;
470
471     picsize = drawgetimagesize(SPIDER_CROSS);
472     picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
473     picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
474     drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
475
476     HUD_GETSTATS
477
478     hudloc_y =  4;
479     hudloc_x = 4;
480
481     picsize = drawgetimagesize(waki_h) * 0.5;
482     drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
483
484     picsize = drawgetimagesize(waki_a2) * 0.7;
485     drawpic(hudloc + '116 92  0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
486
487
488     drawstring(hudloc + '145 19  0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
489     drawstring(hudloc + '175 34  0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
490     drawstring(hudloc + '136 102  0', strcat(ftos(energy), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL);
491
492     picsize = drawgetimagesize(waki_a1) * 0.75;
493     if(reload1 == 100)
494     {
495         drawpic(hudloc + '140 55  0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
496         drawpic(hudloc + '144 59  0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
497     }
498     else
499     {
500         drawpic(hudloc + '140 55  0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
501         drawpic(hudloc + '144 59  0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
502         drawstring(hudloc + '165 69 0', strcat(ftos(reload1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
503     }
504
505     picsize = drawgetimagesize(waki_b) * 0.5;
506     hudloc_y = 10.5;
507     hudloc_x = 10.5;
508
509     health /= 100;
510     energy /= 100;
511     shield /= 100;
512     reload1 /= 100;
513
514     drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
515     drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0'  * (1 - health), 1, DRAWFLAG_NORMAL);
516     drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
517     drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0'  * (1 - energy), 1, DRAWFLAG_NORMAL);
518
519         if (scoreboard_showscores)
520         {
521                 HUD_DrawScoreboard();
522                 HUD_DrawCenterPrint();
523         }
524 */
525 }
526
527 void Vehicles_Precache()
528 {
529         precache_model("models/vehicles/wakizashi.dpm");
530
531         precache_model("models/vehicles/bomblet.md3");
532         precache_model("models/vehicles/clusterbomb.md3");
533         precache_model("models/vehicles/clusterbomb_fragment.md3");
534         precache_model("models/vehicles/rocket01.md3");
535         precache_model("models/vehicles/rocket02.md3");
536 }
537
538 void RaptorCBShellfragDraw()
539 {
540         Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
541         if(wasfreed(self))
542                 return;
543
544         self.move_avelocity += randomvec() * 15;
545         self.renderflags = 0;
546         if(self.cnt < time)
547         self.alpha = bound(0, self.nextthink - time, 1);
548
549         if(self.alpha < ALPHA_MIN_VISIBLE)
550         remove(self);
551
552 }
553
554 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
555 {
556     entity sfrag;
557
558     sfrag = spawn();
559     setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
560     setorigin(sfrag, _org);
561
562         sfrag.move_movetype = MOVETYPE_BOUNCE;
563         sfrag.gravity = 0.15;
564         sfrag.solid = SOLID_CORPSE;
565
566         sfrag.draw = RaptorCBShellfragDraw;
567
568         sfrag.move_origin = sfrag.origin = _org;
569         sfrag.move_velocity = _vel;
570         sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
571         sfrag.angles = self.move_angles = _ang;
572
573         sfrag.move_time = time;
574         sfrag.damageforcescale = 4;
575
576         sfrag.nextthink = time + 3;
577         sfrag.cnt = time + 2;
578     sfrag.drawmask = MASK_NORMAL;
579 }