]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/vehicles/sv_vehicles.qh
Merge branch 'master' into Mario/vehicles
[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 #include "sv_vehicles.qh"
7
8 // #define VEHICLES_USE_ODE
9
10 // vehicle cvars
11 float autocvar_g_vehicles;
12 float autocvar_g_vehicles_enter;
13 float autocvar_g_vehicles_enter_radius;
14 float autocvar_g_vehicles_steal;
15 float autocvar_g_vehicles_steal_show_waypoint;
16 float autocvar_g_vehicles_crush_dmg;
17 float autocvar_g_vehicles_crush_force;
18 float autocvar_g_vehicles_delayspawn;
19 float autocvar_g_vehicles_delayspawn_jitter;
20 float autocvar_g_vehicles_allow_bots;
21 float autocvar_g_vehicles_teams;
22 float autocvar_g_vehicles_teleportable;
23 float autocvar_g_vehicles_vortex_damagerate = 0.5;
24 float autocvar_g_vehicles_machinegun_damagerate = 0.5;
25 float autocvar_g_vehicles_rifle_damagerate = 0.75;
26 float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
27 float autocvar_g_vehicles_tag_damagerate = 5;
28 float autocvar_g_vehicles_weapon_damagerate = 1;
29
30 // flags:
31 .int vehicle_flags;
32
33 // vehicle definitions
34 .entity gun1;
35 .entity gun2;
36 .entity gun3;
37 .entity vehicle_shieldent;  /// Entity to disply the shild effect on damage
38 .entity vehicle;
39 .entity vehicle_viewport;
40 .entity vehicle_hudmodel;
41 .entity vehicle_controller;
42
43 .entity gunner1;
44 .entity gunner2;
45
46 .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.
47 .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.
48 .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.
49
50 .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.
51 .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.
52 .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.
53 .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.
54
55 .float sound_nexttime;
56 const float VOL_VEHICLEENGINE = 1;
57
58 const float SVC_SETVIEWPORT   = 5;   // Net.Protocol 0x05
59 const float SVC_SETVIEWANGLES = 10;  // Net.Protocol 0x0A
60 const float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
61
62 const float VHSF_NORMAL = 0;
63 const float VHSF_FACTORY = 2;
64
65 .int hud;
66 .float dmg_time;
67
68 .int volly_counter;
69
70 const int MAX_AXH = 4;
71 .entity AuxiliaryXhair[MAX_AXH];
72
73 .entity wps_intruder;
74
75 .entity lock_target;
76 .float  lock_strength;
77 .float  lock_time;
78 .float  lock_soundtime;
79 const float     DAMAGE_TARGETDRONE = 10;
80
81 // vehicle functions
82 .void(int _spawnflag) vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
83 .bool(int _imp) vehicles_impulse;
84 .int vehicle_weapon2mode;
85 .void(int exit_flags) vehicle_exit;
86 .bool() vehicle_enter;
87 const int VHEF_NORMAL = 0;  /// User pressed exit key
88 const int VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
89 const int VHEF_RELEASE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
90
91 float  force_fromtag_power;
92 float  force_fromtag_normpower;
93 vector force_fromtag_origin;
94
95 float vehicles_exit_running;
96
97 // macros
98 #define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
99         ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
100
101 .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
102
103 void vehicles_exit(float eject);
104 float vehicle_initialize(float vehicle_id, float nodrop);
105
106 #endif
107
108 #endif