X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fvehicles%2Fsv_vehicles.qh;h=423c8ec047380a2a84f20212bd4324ded774ff70;hb=201f6309c92217b63dc34daf004fbb7424096eca;hp=c1080982b39a5c988e87cf192d085ef10da9d0f3;hpb=37903827937b44f174275a75d2dab5301b8ab53e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/vehicles/sv_vehicles.qh b/qcsrc/common/vehicles/sv_vehicles.qh index c1080982b..423c8ec04 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qh +++ b/qcsrc/common/vehicles/sv_vehicles.qh @@ -1,7 +1,8 @@ #ifndef VEHICLES_DEF_H #define VEHICLES_DEF_H +#ifdef SVQC -#include "../server/tturrets/include/turrets_early.qh" +#include "../turrets/sv_turrets.qh" // #define VEHICLES_USE_ODE @@ -18,11 +19,15 @@ float autocvar_g_vehicles_delayspawn_jitter; float autocvar_g_vehicles_allow_bots; float autocvar_g_vehicles_teams; float autocvar_g_vehicles_teleportable; -var float autocvar_g_vehicles_vortex_damagerate = 0.5; -var float autocvar_g_vehicles_machinegun_damagerate = 0.5; -var float autocvar_g_vehicles_rifle_damagerate = 0.75; -var float autocvar_g_vehicles_vaporizer_damagerate = 0.001; -var float autocvar_g_vehicles_tag_damagerate = 5; +float autocvar_g_vehicles_vortex_damagerate = 0.5; +float autocvar_g_vehicles_machinegun_damagerate = 0.5; +float autocvar_g_vehicles_rifle_damagerate = 0.75; +float autocvar_g_vehicles_vaporizer_damagerate = 0.001; +float autocvar_g_vehicles_tag_damagerate = 5; +float autocvar_g_vehicles_weapon_damagerate = 1; + +// flags: +.int vehicle_flags; // vehicle definitions .entity gun1; @@ -37,14 +42,14 @@ var float autocvar_g_vehicles_tag_damagerate = 5; .entity gunner1; .entity gunner2; -.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. -.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. -.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. +.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. +.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. +.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. -.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. -.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. -.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. -.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. +.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. +.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. +.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. +.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. .float sound_nexttime; const float VOL_VEHICLEENGINE = 1; @@ -56,10 +61,10 @@ const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80 const float VHSF_NORMAL = 0; const float VHSF_FACTORY = 2; -.int hud; +.int hud = _STAT(HUD); .float dmg_time; -.float volly_counter; +.int volly_counter; const int MAX_AXH = 4; .entity AuxiliaryXhair[MAX_AXH]; @@ -72,39 +77,32 @@ const int MAX_AXH = 4; .float lock_soundtime; const float DAMAGE_TARGETDRONE = 10; -float force_fromtag_power; -float force_fromtag_normpower; -vector force_fromtag_origin; - -float vehicles_exit_running; - -#ifdef VEHICLES_USE_ODE -void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object -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 -void(entity e, vector torque) physics_addtorque = #542; // add relative torque -#endif // VEHICLES_USE_ODE - -// functions used outside the vehicle code -void vehicles_exit(bool eject); -void vehicles_enter(entity pl, entity veh); - // vehicle functions .void(int _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns -.int(int _imp) vehicles_impulse; -.float vehicle_weapon2mode; +.bool(int _imp) vehicles_impulse; +.int vehicle_weapon2mode = _STAT(VEHICLESTAT_W2MODE); .void(int exit_flags) vehicle_exit; -.float() vehicle_enter; +.bool() vehicle_enter; const int VHEF_NORMAL = 0; /// User pressed exit key const int VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying const int VHEF_RELEASE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented) +float force_fromtag_power; +float force_fromtag_normpower; +vector force_fromtag_origin; + +float vehicles_exit_running; + // macros #define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \ ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100 -#define vehicles_sweap_collision(orig,vel,dt,acm,mult) \ - traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \ - if(trace_fraction != 1) \ - acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult) +.float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly +void vehicles_exit(float eject); +float vehicle_initialize(entity vehicle, float nodrop); +bool vehicle_impulse(int imp); +bool vehicles_crushable(entity e); + +#endif #endif