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();
35 entity AuxiliaryXhair[MAX_AXH];
36 const var void Draw_Not();
43 void AuxiliaryXhair_Draw2D()
47 psize = self.axh_scale * drawgetimagesize(self.axh_image);
48 loc = project_3d_to_2d(self.origin) - 0.5 * psize;
49 if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
53 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
56 if(time - self.cnt > self.axh_fadetime)
57 self.draw2d = Draw_Not;
61 void Net_AuXair2(float bIsNew)
66 axh_id = bound(0, ReadByte(), MAX_AXH);
67 axh = AuxiliaryXhair[axh_id];
69 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
72 axh.draw2d = Draw_Not;
73 axh.drawmask = MASK_NORMAL;
74 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
75 axh.axh_fadetime = 0.1;
76 axh.axh_image = "gfx/vehicles/axh-ring.tga";
79 AuxiliaryXhair[axh_id] = axh;
82 axh.draw2d = AuxiliaryXhair_Draw2D;
84 axh.origin_x = ReadCoord();
85 axh.origin_y = ReadCoord();
86 axh.origin_z = ReadCoord();
88 axh.colormod_x = ReadByte() / 255;
89 axh.colormod_y = ReadByte() / 255;
90 axh.colormod_z = ReadByte() / 255;
96 void VehicleRacerDraw()
98 //Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
99 Movetype_Physics_NoMatchServer();
100 self.drawmask = MASK_NORMAL;
103 void VehicleRacerRemove()
107 void Net_VehicleRacer(float bIsNew)
111 setmodel(self, "models/vehicles/wakizashi.dpm");
112 self.move_movetype = MOVETYPE_BOUNCE;
113 self.entremove = VehicleRacerRemove;
114 setsize(self, '-60 -60 -20', '60 60 20');
115 self.draw = VehicleRacerDraw;
119 self.cnt = ReadByte();
121 self.origin_x = ReadCoord();
122 self.origin_y = ReadCoord();
123 self.origin_z = ReadCoord();
125 self.velocity_x = ReadCoord();
126 self.velocity_y = ReadCoord();
127 self.velocity_z = ReadCoord();
129 self.angles_x = ReadAngle();
130 self.angles_y = ReadAngle();
131 self.angles_z = ReadAngle();
133 self.move_origin = self.origin;
134 self.move_velocity = self.velocity;
135 self.move_angles = self.angles;
137 setorigin(self, self.origin);
142 void Net_VehicleSetup()
146 hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
148 // Init auxiliary crosshairs
151 for(i = 0; i < MAX_AXH; ++i)
153 axh = AuxiliaryXhair[i];
154 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
158 axh.draw2d = Draw_Not;
159 axh.drawmask = MASK_NORMAL;
160 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
161 axh.axh_fadetime = 0.1;
162 axh.axh_image = "gfx/vehicles/axh-ring.tga";
165 AuxiliaryXhair[i] = axh;
169 for(i = 0; i < MAX_AXH; ++i)
171 if(AuxiliaryXhair[i] != world && !wasfreed(AuxiliaryXhair[i]))
172 remove(AuxiliaryXhair[i]);
174 AuxiliaryXhair[i] = spawn();
175 AuxiliaryXhair[i].draw2d = Draw_Not;
176 AuxiliaryXhair[i].drawmask = MASK_NORMAL;
177 AuxiliaryXhair[i].axh_drawflag = DRAWFLAG_ADDITIVE;
178 AuxiliaryXhair[i].axh_fadetime = 0.1;
179 AuxiliaryXhair[i].axh_image = "gfx/vehicles/axh-ring.tga";
180 AuxiliaryXhair[i].axh_scale = 1;
181 AuxiliaryXhair[i].alpha = 1;
189 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
190 AuxiliaryXhair[0].axh_scale = 0.25;
192 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
193 AuxiliaryXhair[1].axh_scale = 0.25;
195 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
196 AuxiliaryXhair[2].axh_scale = 0.5;
199 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
200 AuxiliaryXhair[0].axh_scale = 0.25;
203 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-cross.tga";
204 AuxiliaryXhair[0].axh_scale = 0.5;
205 AuxiliaryXhair[0].alpha = 0.25;
207 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
208 AuxiliaryXhair[1].axh_scale = 0.25;
209 AuxiliaryXhair[1].alpha = 0.75;
210 AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
216 void Vehicles_Precache()
218 //precache_model("models/ax_shell.mdl");
219 //precache_sound("weapons/brass1.wav");
223 void CSQC_SPIDER_HUD()
225 float rockets, reload, heat, hp, shield;
226 vector picsize, hudloc;
228 // Fetch health & ammo stats
229 hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
230 shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
231 heat = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 2);
232 rockets = getstati(STAT_VEHICLESTAT_AMMO2);
233 reload = min(getstatf(STAT_VEHICLESTAT_RELOAD2), 1);
238 drawfill('130 28 0', ('115 0 0' * hp) + '0 10 0', hp * '0 1 0' + (1 - hp) * '1 0 0', 0.5, DRAWFLAG_NORMAL);
239 picsize = drawgetimagesize(spider_h) * 0.5;
240 drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
242 picsize = drawgetimagesize(spider_a2) * 0.5;
243 drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
245 drawstring(hudloc + '145 19 0', strcat(ftos(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
246 drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
247 drawstring(hudloc + '136 102 0', strcat(ftos(100 - rint(heat * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
249 picsize = drawgetimagesize(spider_a1) * 0.85;
252 drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
253 drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
257 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
258 drawstring(hudloc + '179 69 0', strcat(ftos(9 - rockets), "/8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
261 picsize = drawgetimagesize(spider_b) * 0.5;
265 drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
266 drawpic(hudloc, spider_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
267 drawpic(hudloc, spider_r, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL);
268 drawpic(hudloc, spider_g, picsize, '1 1 1' * (1 - heat) + '1 0 0' * heat, 1, DRAWFLAG_NORMAL);
271 if (scoreboard_showscores)
273 HUD_DrawScoreboard();
274 HUD_DrawCenterPrint();
278 picsize = drawgetimagesize(SPIDER_CROSS);
279 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
280 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
282 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);
287 void CSQC_RAPTOR_HUD()
289 if(autocvar_r_letterbox)
292 float reload, hp, shield, energy;
293 vector picsize, hudloc, vel;
297 // Fetch health & ammo stats
298 hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
299 shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
300 reload = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
301 energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1);
303 // Draw the crosshairs
304 picsize = drawgetimagesize("gfx/vehicles/axh-cross.tga");
307 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);
312 picsize = drawgetimagesize(raptor_h) * 0.5;
313 drawpic(hudloc, raptor_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
315 picsize = drawgetimagesize(spider_a2) * 0.5;
316 drawpic(hudloc + '120 96 0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
318 drawstring(hudloc + '145 19 0', strcat(ftos(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
319 drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
320 drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL);
323 picsize = drawgetimagesize(spider_a1) * 0.85;
326 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
327 drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL);
331 drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
332 drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL);
335 picsize = drawgetimagesize(raptor_b) * 0.5;
339 drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
340 drawpic(hudloc, raptor_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
341 drawpic(hudloc, raptor_g1, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
342 drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL);
347 dropmark.owner = self;
348 dropmark.gravity = 1;
353 where = dropmark.origin;
354 setorigin(dropmark, pmove_org);
355 dropmark.velocity = pmove_vel;
356 tracetoss(dropmark, self);
358 where = project_3d_to_2d(trace_endpos);
360 setorigin(dropmark, trace_endpos);
361 picsize = drawgetimagesize(raptor_d) * 0.2;
363 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
365 where_x -= picsize_x * 0.5;
366 where_y -= picsize_y * 0.5;
368 drawpic(where, raptor_d, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
370 dropmark.cnt = time + 5;
374 if(dropmark.cnt > time)
376 where = project_3d_to_2d(dropmark.origin);
377 picsize = drawgetimagesize(raptor_d) * 0.25;
379 if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
381 where_x -= picsize_x * 0.5;
382 where_y -= picsize_y * 0.5;
384 drawpic(where, raptor_d, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
389 if (scoreboard_showscores)
391 HUD_DrawScoreboard();
392 HUD_DrawCenterPrint();
397 #define waki_h "gfx/vehicles/hud_bg.tga"
398 #define waki_b "gfx/vehicles/waki.tga"
399 #define waki_e "gfx/vehicles/waki_e.tga"
400 #define waki_g "gfx/vehicles/waki_guns.tga"
401 #define waki_r "gfx/vehicles/waki_rockets.tga"
402 #define waki_s "gfx/vehicles/shiled.tga"
404 #define waki_a1 "gfx/vehicles/sb_rocket.tga"
405 #define waki_a2 "gfx/vehicles/sb_cells.tga"
407 void CSQC_WAKIZASHI_HUD()
409 // 0--1 floats. 1 = 100%, 0.6 = 50%.
410 float health, shield, energy, rockets;
411 vector picsize, hudloc;
413 picsize = drawgetimagesize(SPIDER_CROSS);
414 picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
415 picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
416 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);
418 health = min(getstatf(STAT_VEHICLESTAT_HEALTH), 1);
419 shield = min(getstatf(STAT_VEHICLESTAT_SHIELD), 1);
420 energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1);
421 rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
426 picsize = drawgetimagesize(waki_h) * 0.5;
427 drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
429 picsize = drawgetimagesize(waki_a2) * 0.7;
430 drawpic(hudloc + '116 92 0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
433 drawstring(hudloc + '145 19 0', strcat(ftos(rint(health * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
434 drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
436 drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL);
438 picsize = drawgetimagesize(waki_a1) * 0.75;
441 drawpic(hudloc + '140 55 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
442 drawpic(hudloc + '144 59 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
446 drawpic(hudloc + '140 55 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
447 drawpic(hudloc + '144 59 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
448 drawstring(hudloc + '165 69 0', strcat(ftos(rint(rockets * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
451 picsize = drawgetimagesize(waki_b) * 0.5;
455 drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
456 drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
457 drawpic(hudloc, waki_r, picsize, '1 1 1' * rockets + '1 0 0' * (1 - rockets), 1, DRAWFLAG_NORMAL);
458 drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
460 if (scoreboard_showscores)
462 HUD_DrawScoreboard();
463 HUD_DrawCenterPrint();