.entity tur_head;
-// entity properties of vehicleinfo:
-.int vehicleid; // VEH_...
-.string netname; // short name
-.string vehicle_name; // human readable name
-.int(int) vehicle_func; // v_...
-.string mdl; // currently a copy of the model
-.string model; // full name of model
-.string head_model; // full name of tur_head model
-.string hud_model; // cockpit model
-.string tag_head; // tur_head model tag
-.string tag_hud; // hud model tag
-.string tag_view; // cockpit model tag
-.int() PlayerPhysplug; // player physics mod
-.int spawnflags;
-.vector mins, maxs; // vehicle hitbox size
-
// other useful macros
#define VEH_ACTION(vehicletype,mrequest) (get_vehicleinfo(vehicletype)).vehicle_func(mrequest)
#define VEH_NAME(vehicletype) (get_vehicleinfo(vehicletype)).vehicle_name
REGISTER_INIT(VEH, id)
REGISTER_REGISTRY(RegisterVehicles)
-
-REGISTER_VEHICLE(NULL, Vehicle) {
- this.vehicleid = 0; // you can recognize dummies by this
- this.netname = "";
- this.vehicle_name = "Vehicle";
- this.vehicle_func = v_null;
- this.mdl = "";
- this.mins = '-0 -0 -0';
- this.maxs = '0 0 0';
- this.model = "";
- this.head_model = "";
- this.hud_model = "";
-}
+REGISTER_VEHICLE(NULL, Vehicle);
#include "all.inc"
/* tags */ "", "", "tag_viewport",
/* netname */ "bumblebee",
/* fullname */ _("Bumblebee")
-);
+) {
+ this.m_icon = "vehicle_bumble";
+}
#endif
#ifdef IMPLEMENTATION
{
case VR_HUD:
{
- Vehicles_drawHUD("vehicle_bumble", "vehicle_bumble_weapon1", "vehicle_bumble_weapon2",
+ Vehicles_drawHUD(VEH_BUMBLEBEE.m_icon, "vehicle_bumble_weapon1", "vehicle_bumble_weapon2",
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
vCROSS_HEAL);
/* tags */ "", "", "tag_viewport",
/* netname */ "racer",
/* fullname */ _("Racer")
-);
+) {
+ this.m_icon = "vehicle_racer";
+}
#endif
#ifdef IMPLEMENTATION
#ifdef CSQC
case VR_HUD:
{
- Vehicles_drawHUD("vehicle_racer", "vehicle_racer_weapon1", "vehicle_racer_weapon2",
+ Vehicles_drawHUD(VEH_RACER.m_icon, "vehicle_racer_weapon1", "vehicle_racer_weapon2",
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
"vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
vCROSS_GUIDE);
/* tags */ "", "tag_hud", "tag_camera",
/* netname */ "raptor",
/* fullname */ _("Raptor")
-);
+) {
+ this.m_icon = "vehicle_raptor";
+}
#endif
#ifdef IMPLEMENTATION
default: crosshair = vCROSS_BURST;
}
- Vehicles_drawHUD("vehicle_raptor", "vehicle_raptor_weapon1", "vehicle_raptor_weapon2",
+ Vehicles_drawHUD(VEH_RAPTOR.m_icon, "vehicle_raptor_weapon1", "vehicle_raptor_weapon2",
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
"vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
crosshair);
/* tags */ "tag_head", "tag_hud", "",
/* netname */ "spiderbot",
/* fullname */ _("Spiderbot")
-);
+) {
+ this.m_icon = "vehicle_spider";
+}
#endif
#ifdef IMPLEMENTATION
default: crosshair = vCROSS_BURST;
}
- Vehicles_drawHUD("vehicle_spider", "vehicle_spider_weapon1", "vehicle_spider_weapon2",
+ Vehicles_drawHUD(VEH_SPIDERBOT.m_icon, "vehicle_spider_weapon1", "vehicle_spider_weapon2",
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
"vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
crosshair);
CLASS(Vehicle, Object)
ATTRIB(Vehicle, vehicleid, int, 0)
+ /** hud icon */
+ ATTRIB(Vehicle, m_icon, string, string_null)
+ /** short name */
+ ATTRIB(Vehicle, netname, string, "")
+ /** human readable name */
+ ATTRIB(Vehicle, vehicle_name, string, "Vehicle")
+ /** */
+ ATTRIB(Vehicle, vehicle_func, int(int), v_null)
+ /** full name of model */
+ ATTRIB(Vehicle, model, string, "")
+ /** currently a copy of the model */
+ ATTRIB(Vehicle, mdl, string, "")
+ /** full name of tur_head model */
+ ATTRIB(Vehicle, head_model, string, "")
+ /** cockpit model */
+ ATTRIB(Vehicle, hud_model, string, "")
+ /** tur_head model tag */
+ ATTRIB(Vehicle, tag_head, string, string_null)
+ /** hud model tag */
+ ATTRIB(Vehicle, tag_hud, string, string_null)
+ /** cockpit model tag */
+ ATTRIB(Vehicle, tag_view, string, string_null)
+ /** player physics mod */
+ ATTRIB(Vehicle, PlayerPhysplug, int(), func_null)
+ /** */
+ ATTRIB(Vehicle, spawnflags, int, 0)
+ /** vehicle hitbox size */
+ ATTRIB(Vehicle, mins, vector, '-0 -0 -0')
+ /** vehicle hitbox size */
+ ATTRIB(Vehicle, maxs, vector, '0 0 0')
ENDCLASS(Vehicle)
#endif