+#if defined(CSQC)
+ #include "../../dpdefs/csprogsdefs.qh"
+ #include "../defs.qh"
+ #include "../../common/constants.qh"
+ #include "../../common/stats.qh"
+ #include "../../common/util.qh"
+ #include "../../common/buffs.qh"
+ #include "../autocvars.qh"
+ #include "../movetypes.qh"
+ #include "../prandom.qh"
+ #include "../main.qh"
+ #include "vehicles.qh"
+ #include "../../csqcmodellib/cl_model.qh"
+ #include "../../server/t_items.qh"
+#elif defined(MENUQC)
+#elif defined(SVQC)
+#endif
+
const string hud_bg = "gfx/vehicles/frame.tga";
const string hud_sh = "gfx/vehicles/vh-shield.tga";
const int RSM_LAST = 2;
entity dropmark;
-var float autocvar_cl_vehicles_hudscale = 0.5;
-var float autocvar_cl_vehicles_hudalpha = 0.75;
+float autocvar_cl_vehicles_hudscale = 0.5;
+float autocvar_cl_vehicles_hudalpha = 0.75;
const string raptor_ico = "gfx/vehicles/raptor.tga";
const string raptor_gun = "gfx/vehicles/raptor_guns.tga";
const int MAX_AXH = 4;
entity AuxiliaryXhair[MAX_AXH];
-.string axh_image;
-.float axh_fadetime;
-.float axh_drawflag;
-.float axh_scale;
+entityclass(AuxiliaryXhair)
+class(AuxiliaryXhair) .string axh_image;
+class(AuxiliaryXhair) .float axh_fadetime;
+class(AuxiliaryXhair) .float axh_drawflag;
+class(AuxiliaryXhair) .float axh_scale;
const string bumb_ico = "gfx/vehicles/bumb.tga";
const string bumb_lgun = "gfx/vehicles/bumb_lgun.tga";
loc = project_3d_to_2d(self.move_origin) - 0.5 * psize;
if (!(loc.z < 0 || loc.x < 0 || loc.y < 0 || loc.x > vid_conwidth || loc.y > vid_conheight))
{
- loc_z = 0;
- psize_z = 0;
+ loc.z = 0;
+ psize.z = 0;
drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
}
}
}
#define HUD_GETSTATS \
- int vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
- int shield = getstati(STAT_VEHICLESTAT_SHIELD); \
+ int vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
+ float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
noref int energy = getstati(STAT_VEHICLESTAT_ENERGY); \
- noref int ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
- noref int reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
+ noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
+ noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
noref int ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
noref int reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
HUD_GETSTATS
picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
- hudloc_y = vid_conheight - picsize.y;
- hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
+ hudloc.y = vid_conheight - picsize.y;
+ hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5;
drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
// Right gunner slot occupied?
if(!AuxiliaryXhair[1].draw2d)
{
- shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
+ shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawstring(hudloc + picloc + '1 0 0' * shield, _("No right gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
}
// Left gunner slot occupied?
if(!AuxiliaryXhair[2].draw2d)
{
- shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
+ shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawstring(hudloc + picloc + '1 0 0' * shield, _("No left gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL);
}
HUD_GETSTATS
picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
- hudloc_y = vid_conheight - picsize.y;
- hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
+ hudloc.y = vid_conheight - picsize.y;
+ hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5;
drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
HUD_GETSTATS
picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
- hudloc_y = vid_conheight - picsize.y;
- hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
+ hudloc.y = vid_conheight - picsize.y;
+ hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5;
drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
HUD_GETSTATS
picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
- hudloc_y = vid_conheight - picsize.y;
- hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
+ hudloc.y = vid_conheight - picsize.y;
+ hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5;
drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);
{
where.x -= picsize.x * 0.5;
where.y -= picsize.y * 0.5;
- where_z = 0;
+ where.z = 0;
drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
}
dropmark.cnt = time + 5;
{
where.x -= picsize.x * 0.5;
where.y -= picsize.y * 0.5;
- where_z = 0;
+ where.z = 0;
drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
}
}
HUD_GETSTATS
picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale;
- hudloc_y = vid_conheight - picsize.y;
- hudloc_x = vid_conwidth * 0.5 - picsize.x * 0.5;
+ hudloc.y = vid_conheight - picsize.y;
+ hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5;
drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL);