6 #include "../antilag.qh"
7 #include "../cl_player.qh"
8 #include "../g_damage.qh"
9 #include "../g_hook.qh"
10 #include "../g_subs.qh"
11 #include "../movelib.qh"
13 #include "../bot/bot.qh"
15 #include "../command/common.qh"
17 #include "../tturrets/include/turrets_early.qh"
19 #include "../weapons/tracing.qh"
21 #include "../../common/deathtypes.qh"
22 #include "../../common/stats.qh"
24 #include "../../warpzonelib/anglestransform.qh"
25 #include "../../warpzonelib/server.qh"
27 entity vehicles_projectile(string _mzlfx, string _mzlsound,
28 vector _org, vector _vel,
29 float _dmg, float _radi, float _force, float _size,
30 float _deahtype, float _projtype, float _health,
31 float _cull, float _clianim, entity _owner);
33 vector vehicles_findgoodexit(vector prefer_spot);
37 /** vehicles_locktarget
39 Generic target locking.
41 Figure out if what target is "locked" (if any), for missile tracking as such.
43 after calling, "if(self.lock_target != world && self.lock_strength == 1)" mean
44 you have a locked in target.
46 Exspects a crosshair_trace() or equivalent to be
53 .float lock_soundtime;
55 void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id);
57 vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
58 float _pichlimit_min, float _pichlimit_max,
59 float _rotlimit_min, float _rotlimit_max, float _aimspeed);
61 #define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
62 ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
64 void CSQCVehicleSetup(entity own, float vehicle_id);
66 .float() PlayerPhysplug;
68 float autocvar_g_vehicles_allow_bots = 0;
70 void vehicles_touch();
72 void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale);
74 float shortangle_f(float ang1, float ang2);
75 float anglemods(float v);
77 entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot);
79 void vehicles_impact(float _minspeed, float _speedfac, float _maxpain);
81 void shieldhit_think();
83 float vehicle_addplayerslot( entity _owner,
88 void(float) _exitfunc);
90 .void() vehicle_impact;
92 float vehicle_initialize(string net_name,
103 void(float _spawnflag) spawnproc,
107 void(float extflag) exitfunc,
114 float force_fromtag_normpower;
116 void vehicles_painframe();
118 void vehicles_locktarget(float incr, float decr, float _lock_time);
120 vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power);
122 vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power);
124 void vehicles_projectile_explode();
129 const int VHF_ISVEHICLE = 2; /// Indicates vehicle
130 const int VHF_HASSHIELD = 4; /// Vehicle has shileding
131 const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
132 const int VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
133 const int VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
134 const int VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
135 const int VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
136 const int VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
137 const int VHF_MOVE_FLY = 512; /// Vehicle is airborn
138 const int VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
139 const int VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
140 const int VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
141 const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
142 const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
147 .entity vehicle_shieldent; /// Entity to disply the shild effect on damage
149 .entity vehicle_viewport;
150 .entity vehicle_hudmodel;
151 .entity vehicle_controller;
156 .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.
157 .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.
158 .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.
160 .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.
161 .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.
162 .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.
163 .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.
165 .float sound_nexttime;
166 const float VOL_VEHICLEENGINE = 1;
170 .float vehicle_respawntime;
171 //.void() vehicle_spawn;
173 void vehicles_exit(float eject);
174 .void(float exit_flags) vehicle_exit;
175 const float VHEF_NORMAL = 0; /// User pressed exit key
176 const float VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying
177 const float VHEF_RELESE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
179 const float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
180 const float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
181 const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
183 .void() vehicle_enter; /// Vehicles custom funciton to be executed when owner exit it
184 .void() vehicle_die; /// Vehicles custom function to be executed when vehile die
185 const float VHSF_NORMAL = 0;
186 const float VHSF_FACTORY = 2;
187 .void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
188 .float(float _imp) vehicles_impulse;
189 .float vehicle_weapon2mode;
192 void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
193 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
194 void(entity e, vector torque) physics_addtorque = #542; // add relative torque
195 #endif // VEHICLES_USE_ODE
196 #endif // VEHICLES_ENABLED