]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/vehicles/sv_vehicles.qh
Disable an unused macro
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / sv_vehicles.qh
1 #ifndef VEHICLES_DEF_H
2 #define VEHICLES_DEF_H
3 #ifdef SVQC
4
5 #include "../server/tturrets/include/turrets_early.qh"
6
7 // #define VEHICLES_USE_ODE
8
9 // vehicle cvars
10 float autocvar_g_vehicles;
11 float autocvar_g_vehicles_enter;
12 float autocvar_g_vehicles_enter_radius;
13 float autocvar_g_vehicles_steal;
14 float autocvar_g_vehicles_steal_show_waypoint;
15 float autocvar_g_vehicles_crush_dmg;
16 float autocvar_g_vehicles_crush_force;
17 float autocvar_g_vehicles_delayspawn;
18 float autocvar_g_vehicles_delayspawn_jitter;
19 float autocvar_g_vehicles_allow_bots;
20 float autocvar_g_vehicles_teams;
21 float autocvar_g_vehicles_teleportable;
22 var float autocvar_g_vehicles_vortex_damagerate = 0.5;
23 var float autocvar_g_vehicles_machinegun_damagerate = 0.5;
24 var float autocvar_g_vehicles_rifle_damagerate = 0.75;
25 var float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
26 var float autocvar_g_vehicles_tag_damagerate = 5;
27
28 // flags:
29 .int vehicle_flags;
30
31 // vehicle definitions
32 .entity gun1;
33 .entity gun2;
34 .entity gun3;
35 .entity vehicle_shieldent;  /// Entity to disply the shild effect on damage
36 .entity vehicle;
37 .entity vehicle_viewport;
38 .entity vehicle_hudmodel;
39 .entity vehicle_controller;
40
41 .entity gunner1;
42 .entity gunner2;
43
44 .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.
45 .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.
46 .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.
47
48 .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.
49 .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.
50 .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.
51 .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.
52
53 .float sound_nexttime;
54 const float VOL_VEHICLEENGINE = 1;
55
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
59
60 const float VHSF_NORMAL = 0;
61 const float VHSF_FACTORY = 2;
62
63 .int hud;
64 .float dmg_time;
65
66 .int volly_counter;
67
68 const int MAX_AXH = 4;
69 .entity AuxiliaryXhair[MAX_AXH];
70
71 .entity wps_intruder;
72
73 .entity lock_target;
74 .float  lock_strength;
75 .float  lock_time;
76 .float  lock_soundtime;
77 const float     DAMAGE_TARGETDRONE = 10;
78
79 // vehicle functions
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;
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)
88
89 float  force_fromtag_power;
90 float  force_fromtag_normpower;
91 vector force_fromtag_origin;
92
93 float vehicles_exit_running;
94
95 #ifdef VEHICLES_USE_ODE
96 void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
97 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
98 void(entity e, vector torque) physics_addtorque = #542; // add relative torque
99 #endif  // VEHICLES_USE_ODE
100
101 .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
102
103 // macros
104 #define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
105         ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
106
107 #if 0
108 #define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
109         traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
110         if(trace_fraction != 1) \
111                 acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
112 #endif
113
114 void vehicles_exit(float eject);
115
116 #endif
117 #endif