]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/vehicles/vehicles_def.qh
Merge remote-tracking branch 'origin/master' into tzork/vehicles-2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / vehicles / vehicles_def.qh
1 // #define VEHICLES_CSQC
2 // #define VEHICLES_USE_ODE
3 #define VEHICLES_ENABLED
4 #ifdef VEHICLES_ENABLED
5
6 //#define VEHICLES_VIEWROTATE_CROSSHAIR
7 #message "with tZork vehicles (experimental)"
8
9 .float vehicle_flags;
10 float VHF_ISVEHICLE     = 2;    /// Indicates vehicle
11 float VHF_HASSHIELD     = 4;    /// Vehicle has shileding
12 float VHF_SHIELDREGEN   = 8;    /// Vehicles shield regenerates
13 float VHF_HEALTHREGEN   = 16;   /// Vehicles health regenerates
14 float VHF_ENERGYREGEN   = 32;   /// Vehicles energy regenerates
15 float VHF_DEATHEJECT    = 64;   /// Vehicle ejects pilot upon fatal damage
16 float VHF_MOVE_GROUND   = 128;  /// Vehicle moves on gound
17 float VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound 
18 float VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
19
20 .float hud;
21
22 .entity gun1;
23 .entity gun2;
24
25 .float vehicle_health;      /// If self is player this is 0..1 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
26 .float vehicle_energy;      /// If self is player this is 0..1 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
27 .float vehicle_shield;      /// If self is player this is 0..1 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
28 .entity vehicle_shieldent;  /// Entity to disply the shild effect on damage
29
30 .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.
31 .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.
32 .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.
33 .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.
34
35 .entity vehicle;
36 .entity vehicle_viewport;
37 .entity vehicle_hudmodel;
38
39 #ifdef SVQC
40 .float dmg_time;
41 .float  vehicle_respawntime;
42 .void() vehicle_spawn;
43
44 var .void(float exit_flags) vehicle_exit;
45 float VHEF_NORMAL = 0;  /// User pressed exit key
46 float VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
47 float VHEF_RELESE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
48
49 float SVC_SETVIEWPORT   = 5;   // Net.Protocol 0x05
50 float SVC_SETVIEWANGLES = 10;  // Net.Protocol 0x0A
51 float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
52
53 var .void() vehicle_enter;  /// Vehicles custom funciton to be executed when owner exit it
54 var .void() vehicle_die;    /// Vehicles custom function to be executed when vehile die
55 var .void() vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
56
57 #ifdef VEHICLES_CSQC
58 var .void(entity to) vehile_send_exta;  /// Vehicles custom send code (for extra bits, stats and whatnot)
59 void net_link_vehile();                 /// Initiates csqc networking for vehicle
60 #endif //VEHICLES_CSQC
61 #endif //SVQC
62
63 #ifdef VEHICLES_USE_ODE
64 void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
65 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
66 void(entity e, vector torque) physics_addtorque = #542; // add relative torque
67 #endif  // VEHICLES_USE_ODE
68 #endif  // VEHICLES_ENABLED