5 #include <common/turrets/sv_turrets.qh>
8 bool autocvar_g_vehicles = true;
9 AUTOCVAR(g_vehicles_enter, bool, false, "require pressing use key to enter a vehicle");
10 float autocvar_g_vehicles_enter_radius = 250;
11 AUTOCVAR(g_vehicles_steal, bool, true, "allow stealing enemy vehicles in teamplay modes");
12 AUTOCVAR(g_vehicles_steal_show_waypoint, bool, true, "show a waypoint above the thief");
13 float autocvar_g_vehicles_crush_dmg = 70;
14 float autocvar_g_vehicles_crush_force = 50;
15 bool autocvar_g_vehicles_delayspawn = true;
16 float autocvar_g_vehicles_delayspawn_jitter = 10;
17 float autocvar_g_vehicles_allow_bots;
19 AUTOCVAR(g_vehicles_teams, bool, true, "allow team specific vehicles");
20 float autocvar_g_vehicles_teleportable;
21 float autocvar_g_vehicles_vortex_damagerate = 0.5;
22 float autocvar_g_vehicles_machinegun_damagerate = 0.5;
23 float autocvar_g_vehicles_rifle_damagerate = 0.75;
24 float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
25 float autocvar_g_vehicles_tag_damagerate = 5;
26 float autocvar_g_vehicles_weapon_damagerate = 1;
31 // vehicle definitions
35 .entity vehicle_shieldent; /// Entity to disply the shild effect on damage
37 .entity vehicle_viewport;
38 .entity vehicle_hudmodel;
39 .entity vehicle_controller;
44 .float vehicle_health = _STAT(VEHICLESTAT_HEALTH); /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
45 .float vehicle_energy = _STAT(VEHICLESTAT_ENERGY); /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
46 .float vehicle_shield = _STAT(VEHICLESTAT_SHIELD); /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
48 .float vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1); /// If self is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If self is vehile, this is the real ammo1 value.
49 .float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1); /// If self is player this is 0..100 indicating percentage of primary reload status. If self is vehile, this is the real reload1 value.
50 .float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2); /// If self is player this is 0..100 indicating percentage of secondary ammo left. If self is vehile, this is the real ammo2 value.
51 .float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2); /// If self is player this is 0..100 indicating percentage of secondary reload status. If self is vehile, this is the real reload2 value.
53 .float sound_nexttime;
54 const float VOL_VEHICLEENGINE = 1;
56 const float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
57 const float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
58 const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
60 const float VHSF_NORMAL = 0;
61 const float VHSF_FACTORY = 2;
63 .int hud = _STAT(HUD);
68 const int MAX_AXH = 4;
69 .entity AuxiliaryXhair[MAX_AXH];
76 .float lock_soundtime;
77 const float DAMAGE_TARGETDRONE = 10;
80 .void(int _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
81 .bool(int _imp) vehicles_impulse;
82 .int vehicle_weapon2mode = _STAT(VEHICLESTAT_W2MODE);
83 .void(int exit_flags) vehicle_exit;
84 .bool() vehicle_enter;
85 const int VHEF_NORMAL = 0; /// User pressed exit key
86 const int VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying
87 const int VHEF_RELEASE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
89 float force_fromtag_power;
90 float force_fromtag_normpower;
91 vector force_fromtag_origin;
93 float vehicles_exit_running;
96 #define VEHICLE_UPDATE_PLAYER(ply,vehi,fld,vhname) \
97 ply.vehicle_##fld = (vehi.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
99 .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
101 void vehicles_exit(float eject);
102 float vehicle_initialize(entity vehicle, float nodrop);
103 bool vehicle_impulse(entity this, int imp);
104 bool vehicles_crushable(entity e);