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