]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/vehicles/sv_vehicles.qh
Merge branch 'terencehill/scoreboard_columns_fix' 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 <common/turrets/sv_turrets.qh>
6 #include "vehicle.qh"
7
8 // vehicle cvars
9 bool autocvar_g_vehicles = true;
10 AUTOCVAR(g_vehicles_enter, bool, false, "require pressing use key to enter a vehicle");
11 float autocvar_g_vehicles_enter_radius = 250;
12 AUTOCVAR(g_vehicles_steal, bool, true, "allow stealing enemy vehicles in teamplay modes");
13 AUTOCVAR(g_vehicles_steal_show_waypoint, bool, true, "show a waypoint above the thief");
14 float autocvar_g_vehicles_crush_dmg = 70;
15 float autocvar_g_vehicles_crush_force = 50;
16 bool autocvar_g_vehicles_delayspawn = true;
17 float autocvar_g_vehicles_delayspawn_jitter = 10;
18 float autocvar_g_vehicles_allow_bots;
19
20 AUTOCVAR(g_vehicles_teams, bool, true, "allow team specific vehicles");
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 .float vehicle_last_trace;
30
31 // flags:
32 .int vehicle_flags;
33
34 // vehicle definitions
35 .entity gun1;
36 .entity gun2;
37 .entity gun3;
38 .entity vehicle_shieldent;  /// Entity to disply the shild effect on damage
39 .entity vehicle;
40 .entity vehicle_viewport;
41 .entity vehicle_hudmodel;
42 .entity vehicle_controller;
43
44 .entity gunner1;
45 .entity gunner2;
46
47 .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.
48 .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.
49 .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.
50
51 .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.
52 .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.
53 .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.
54 .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.
55
56 .float sound_nexttime;
57 const float VOL_VEHICLEENGINE = 1;
58
59 const float SVC_SETVIEWPORT   = 5;   // Net.Protocol 0x05
60 const float SVC_SETVIEWANGLES = 10;  // Net.Protocol 0x0A
61 const float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
62
63 const float VHSF_NORMAL = 0;
64 const float VHSF_FACTORY = 2;
65
66 .int hud = _STAT(HUD);
67 .float dmg_time;
68
69 .int volly_counter;
70
71 const int MAX_AXH = 4;
72 .entity AuxiliaryXhair[MAX_AXH];
73
74 .entity wps_intruder;
75
76 .entity lock_target;
77 .float  lock_strength;
78 .float  lock_time;
79 .float  lock_soundtime;
80 const float     DAMAGE_TARGETDRONE = 10;
81
82 // vehicle functions
83 .void(int _spawnflag) vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
84 .bool(int _imp) vehicles_impulse;
85 .int vehicle_weapon2mode = _STAT(VEHICLESTAT_W2MODE);
86 .void(int exit_flags) vehicle_exit;
87 .bool(entity this, entity player) vehicle_enter;
88 const int VHEF_NORMAL = 0;  /// User pressed exit key
89 const int VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
90 const int VHEF_RELEASE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
91
92 float  force_fromtag_power;
93 float  force_fromtag_normpower;
94 vector force_fromtag_origin;
95
96 float vehicles_exit_running;
97
98 // macros
99 #define VEHICLE_UPDATE_PLAYER(ply,vehi,fld,vhname) \
100         ply.vehicle_##fld = (vehi.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
101
102 .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
103
104 void vehicles_exit(float eject);
105 bool vehicle_initialize(entity this, Vehicle info, float nodrop);
106 bool vehicle_impulse(entity this, int imp);
107 bool vehicles_crushable(entity e);
108
109 #endif
110 #endif