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/sbot-xhair.tga"
5 #define SPIDER_CROSS2 "gfx/vehicles/sbot-xhair2.tga"
7 #define axh1 "gfx/vehicles/sbot-xhair2.tga"
8 #define axh2 "gfx/vehicles/sbot-xhair2.tga"
9 #define axh3 "gfx/vehicles/sbot-xhair2.tga"
11 #define spider_h "gfx/vehicles/hud_bg.tga"
12 #define spider_b "gfx/vehicles/sbot.tga"
13 #define spider_r "gfx/vehicles/sbot_rpods.tga"
14 #define spider_g "gfx/vehicles/sbot_mguns.tga"
15 #define spider_s "gfx/vehicles/shiled.tga"
16 #define spider_a1 "gfx/vehicles/sb_rocket.tga"
17 #define spider_a2 "gfx/vehicles/sb_bullets.tga"
19 #define raptor_h "gfx/vehicles/hud_bg.tga"
20 #define raptor_s "gfx/vehicles/shiled.tga"
22 #define raptor_b "gfx/vehicles/raptor.tga"
23 #define raptor_g1 "gfx/vehicles/raptor_guns.tga"
24 #define raptor_g2 "gfx/vehicles/raptor_bombs.tga"
25 #define raptor_d "gfx/vehicles/dropcross.tga"
26 #define raptor_c "gfx/vehicles/raptor_cross.tga"
30 void CSQC_WAKIZASHI_HUD();
31 void CSQC_SPIDER_HUD();
32 void CSQC_RAPTOR_HUD();
33 void CSQC_BUMBLE_HUD();
36 entity AuxiliaryXhair[MAX_AXH];
37 const var void Draw_Not();
44 void AuxiliaryXhair_Draw2D()
48 psize = self.axh_scale * drawgetimagesize(self.axh_image);
49 loc = project_3d_to_2d(self.origin) - 0.5 * psize;
50 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
54 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
57 if(time - self.cnt > self.axh_fadetime)
58 self.draw2d = Draw_Not;
61 void Net_Vehicle(float IsNew)
66 void Net_AuXair2(float bIsNew)
71 axh_id = bound(0, ReadByte(), MAX_AXH);
72 axh = AuxiliaryXhair[axh_id];
74 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
77 axh.draw2d = Draw_Not;
78 axh.drawmask = MASK_NORMAL;
79 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
80 axh.axh_fadetime = 0.1;
81 axh.axh_image = "gfx/vehicles/axh-ring.tga";
84 AuxiliaryXhair[axh_id] = axh;
87 axh.draw2d = AuxiliaryXhair_Draw2D;
89 axh.origin_x = ReadCoord();
90 axh.origin_y = ReadCoord();
91 axh.origin_z = ReadCoord();
93 axh.colormod_x = ReadByte() / 255;
94 axh.colormod_y = ReadByte() / 255;
95 axh.colormod_z = ReadByte() / 255;
99 void Net_VehicleSetup()
103 hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
105 // Init auxiliary crosshairs
107 for(i = 0; i < MAX_AXH; ++i)
109 axh = AuxiliaryXhair[i];
110 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
114 axh.draw2d = Draw_Not;
115 axh.drawmask = MASK_NORMAL;
116 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
117 axh.axh_fadetime = 0.1;
118 axh.axh_image = "gfx/vehicles/axh-ring.tga";
121 AuxiliaryXhair[i] = axh;
128 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
129 AuxiliaryXhair[0].axh_scale = 0.25;
131 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
132 AuxiliaryXhair[1].axh_scale = 0.25;
134 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
135 AuxiliaryXhair[2].axh_scale = 0.5;
138 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
139 AuxiliaryXhair[0].axh_scale = 0.25;
142 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-cross.tga";
143 AuxiliaryXhair[0].axh_scale = 0.5;
144 AuxiliaryXhair[0].alpha = 0.25;
146 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
147 AuxiliaryXhair[1].axh_scale = 0.25;
148 AuxiliaryXhair[1].alpha = 0.75;
149 AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
153 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
154 AuxiliaryXhair[0].axh_scale = 0.25;
156 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-special1.tga";
157 AuxiliaryXhair[1].axh_scale = 0.25;
161 #define HUD_GETSTATS \
162 float health = getstati(STAT_VEHICLESTAT_HEALTH); \
163 float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
164 float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
165 float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
166 float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
167 float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
168 float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
170 void CSQC_BUMBLE_HUD()
172 vector picsize, hudloc;
174 // Fetch health & ammo stats
180 picsize = drawgetimagesize(spider_h) * 0.5;
181 drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
183 picsize = drawgetimagesize(spider_a2) * 0.5;
184 drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
186 drawstring(hudloc + '145 19 0', strcat(ftos(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);
190 picsize = drawgetimagesize(spider_a1) * 0.85;
193 drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
194 drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
198 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
199 drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
202 picsize = drawgetimagesize(spider_b) * 0.5;
211 drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
212 drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
213 drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
214 drawpic(hudloc, spider_g, picsize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
217 if (scoreboard_showscores)
219 HUD_DrawScoreboard();
220 HUD_DrawCenterPrint();
224 picsize = drawgetimagesize(SPIDER_CROSS);
225 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
226 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
228 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);
233 void CSQC_SPIDER_HUD()
235 vector picsize, hudloc;
237 // Fetch health & ammo stats
243 picsize = drawgetimagesize(spider_h) * 0.5;
244 drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
246 picsize = drawgetimagesize(spider_a2) * 0.5;
247 drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
249 drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
250 drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
251 drawstring(hudloc + '136 102 0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
253 picsize = drawgetimagesize(spider_a1) * 0.85;
256 drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
257 drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
261 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
262 drawstring(hudloc + '179 69 0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
265 picsize = drawgetimagesize(spider_b) * 0.5;
274 drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
275 drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
276 drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
277 drawpic(hudloc, spider_g, picsize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL);
280 if (scoreboard_showscores)
282 HUD_DrawScoreboard();
283 HUD_DrawCenterPrint();
287 picsize = drawgetimagesize(SPIDER_CROSS);
288 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
289 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
291 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);
296 void CSQC_RAPTOR_HUD()
298 if(autocvar_r_letterbox)
301 vector picsize, hudloc;
305 // Fetch health & ammo stats
308 // Draw the crosshairs
309 picsize = drawgetimagesize("gfx/vehicles/axh-cross.tga");
312 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);
317 picsize = drawgetimagesize(raptor_h) * 0.5;
318 drawpic(hudloc, raptor_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
320 picsize = drawgetimagesize(spider_a2) * 0.5;
321 drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
323 drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
324 drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
325 drawstring(hudloc + '136 102 0', strcat(ftos(energy), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL);
331 picsize = drawgetimagesize(spider_a1) * 0.85;
334 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
335 drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL);
339 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
340 drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL);
343 picsize = drawgetimagesize(raptor_b) * 0.5;
346 reload1 = reload2 / 100;
347 drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
348 drawpic(hudloc, raptor_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
349 drawpic(hudloc, raptor_g1, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
350 drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
355 dropmark.owner = self;
356 dropmark.gravity = 1;
361 where = dropmark.origin;
362 setorigin(dropmark, pmove_org);
363 dropmark.velocity = pmove_vel;
364 tracetoss(dropmark, self);
366 where = project_3d_to_2d(trace_endpos);
368 setorigin(dropmark, trace_endpos);
369 picsize = drawgetimagesize(raptor_d) * 0.2;
371 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
373 where_x -= picsize_x * 0.5;
374 where_y -= picsize_y * 0.5;
376 drawpic(where, raptor_d, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
378 dropmark.cnt = time + 5;
382 if(dropmark.cnt > time)
384 where = project_3d_to_2d(dropmark.origin);
385 picsize = drawgetimagesize(raptor_d) * 0.25;
387 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
389 where_x -= picsize_x * 0.5;
390 where_y -= picsize_y * 0.5;
392 drawpic(where, raptor_d, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
397 if (scoreboard_showscores)
399 HUD_DrawScoreboard();
400 HUD_DrawCenterPrint();
405 #define waki_h "gfx/vehicles/hud_bg.tga"
406 #define waki_b "gfx/vehicles/waki.tga"
407 #define waki_e "gfx/vehicles/waki_e.tga"
408 #define waki_g "gfx/vehicles/waki_guns.tga"
409 #define waki_r "gfx/vehicles/waki_rockets.tga"
410 #define waki_s "gfx/vehicles/shiled.tga"
412 #define waki_a1 "gfx/vehicles/sb_rocket.tga"
413 #define waki_a2 "gfx/vehicles/sb_cells.tga"
415 void CSQC_WAKIZASHI_HUD()
417 vector picsize, hudloc;
419 picsize = drawgetimagesize(SPIDER_CROSS);
420 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
421 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
422 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);
425 health = min(getstatf(STAT_VEHICLESTAT_HEALTH), 1);
426 shield = min(getstatf(STAT_VEHICLESTAT_SHIELD), 1);
427 energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1);
428 rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
436 picsize = drawgetimagesize(waki_h) * 0.5;
437 drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
439 picsize = drawgetimagesize(waki_a2) * 0.7;
440 drawpic(hudloc + '116 92 0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
443 drawstring(hudloc + '145 19 0', strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
444 drawstring(hudloc + '175 34 0', strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
445 drawstring(hudloc + '136 102 0', strcat(ftos(energy), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL);
447 picsize = drawgetimagesize(waki_a1) * 0.75;
450 drawpic(hudloc + '140 55 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
451 drawpic(hudloc + '144 59 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
455 drawpic(hudloc + '140 55 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
456 drawpic(hudloc + '144 59 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
457 drawstring(hudloc + '165 69 0', strcat(ftos(reload1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
460 picsize = drawgetimagesize(waki_b) * 0.5;
469 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
470 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
471 drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
472 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
474 if (scoreboard_showscores)
476 HUD_DrawScoreboard();
477 HUD_DrawCenterPrint();
482 void Vehicles_Precache()
484 precache_model("models/vehicles/bomblet.md3");
485 precache_model("models/vehicles/clusterbomb.md3");
486 precache_model("models/vehicles/clusterbomb_fragment.md3");
487 precache_model("models/vehicles/rocket01.md3");
488 precache_model("models/vehicles/rocket02.md3");
491 void RaptorCBShellfragDraw()
493 Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
497 self.move_avelocity += randomvec() * 15;
498 self.renderflags = 0;
500 self.alpha = bound(0, self.nextthink - time, 1);
502 if(self.alpha < ALPHA_MIN_VISIBLE)
507 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
512 setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
513 setorigin(sfrag, _org);
515 sfrag.move_movetype = MOVETYPE_BOUNCE;
516 sfrag.gravity = 0.15;
517 sfrag.solid = SOLID_CORPSE;
519 sfrag.draw = RaptorCBShellfragDraw;
521 sfrag.move_origin = sfrag.origin = _org;
522 sfrag.move_velocity = _vel;
523 sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
524 sfrag.angles = self.move_angles = _ang;
526 sfrag.move_time = time;
527 sfrag.damageforcescale = 4;
529 sfrag.nextthink = time + 3;
530 sfrag.cnt = time + 2;
531 sfrag.drawmask = MASK_NORMAL;