4 #include "../tturrets/include/turrets_early.qh"
6 // #define VEHICLES_USE_ODE
7 #define VEHICLES_ENABLED
8 #ifdef VEHICLES_ENABLED
11 const int VHF_ISVEHICLE = 2; /// Indicates vehicle
12 const int VHF_HASSHIELD = 4; /// Vehicle has shileding
13 const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
14 const int VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
15 const int VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
16 const int VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
17 const int VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
18 const int VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
19 const int VHF_MOVE_FLY = 512; /// Vehicle is airborn
20 const int VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
21 const int VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
22 const int VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
23 const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
24 const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
29 .entity vehicle_shieldent; /// Entity to disply the shild effect on damage
31 .entity vehicle_viewport;
32 .entity vehicle_hudmodel;
33 .entity vehicle_controller;
38 .float vehicle_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.
39 .float vehicle_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.
40 .float vehicle_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.
42 .float vehicle_ammo1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo1 value.
43 .float vehicle_reload1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload1 value.
44 .float vehicle_ammo2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo2 value.
45 .float vehicle_reload2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload2 value.
47 .float sound_nexttime;
48 const float VOL_VEHICLEENGINE = 1;
52 .float vehicle_respawntime;
53 //.void() vehicle_spawn;
55 void vehicles_exit(float eject);
56 .void(float exit_flags) vehicle_exit;
57 const float VHEF_NORMAL = 0; /// User pressed exit key
58 const float VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying
59 const float VHEF_RELESE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
61 const float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
62 const float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
63 const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
65 .void() vehicle_enter; /// Vehicles custom funciton to be executed when owner exit it
66 .void() vehicle_die; /// Vehicles custom function to be executed when vehile die
67 const float VHSF_NORMAL = 0;
68 const float VHSF_FACTORY = 2;
69 .void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
70 .float(float _imp) vehicles_impulse;
71 .float vehicle_weapon2mode;
73 #ifdef VEHICLES_USE_ODE
74 void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
75 void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
76 void(entity e, vector torque) physics_addtorque = #542; // add relative torque
77 #endif // VEHICLES_USE_ODE
78 #endif // VEHICLES_ENABLED