X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fvehicles%2Fsv_vehicles.qh;h=158191f654eed354806d07cf2140d7a6db1176b4;hb=a8e9c14803c6ee158f8183701f8e9c8601da9983;hp=165ae07e6d92a7bb4eb4e0a3ec8ca9494237dcfa;hpb=507f4d978401667d7b218e4c9b1ca0777d05c6ae;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/vehicles/sv_vehicles.qh b/qcsrc/common/vehicles/sv_vehicles.qh index 165ae07e6..158191f65 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qh +++ b/qcsrc/common/vehicles/sv_vehicles.qh @@ -1,5 +1,4 @@ -#ifndef VEHICLES_DEF_H -#define VEHICLES_DEF_H +#pragma once #ifdef SVQC #include @@ -16,6 +15,8 @@ float autocvar_g_vehicles_crush_force = 50; bool autocvar_g_vehicles_delayspawn = true; float autocvar_g_vehicles_delayspawn_jitter = 10; float autocvar_g_vehicles_allow_bots; +int autocvar_g_vehicles_exit_attempts = 25; +float autocvar_g_vehicles_thinkrate = 0.1; AUTOCVAR(g_vehicles_teams, bool, true, "allow team specific vehicles"); float autocvar_g_vehicles_teleportable; @@ -44,14 +45,14 @@ float autocvar_g_vehicles_weapon_damagerate = 1; .entity gunner1; .entity gunner2; -.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_health = _STAT(VEHICLESTAT_HEALTH); /// If ent is player this is 0..100 indicating precentage of health left on vehicle. If ent is vehile, this is the real health value. +.float vehicle_energy = _STAT(VEHICLESTAT_ENERGY); /// If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehile, this is the real energy value. +.float vehicle_shield = _STAT(VEHICLESTAT_SHIELD); /// If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehile, this is the real shield 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 vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1); /// If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If ent is vehile, this is the real ammo1 value. +.float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1); /// If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehile, this is the real reload1 value. +.float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2); /// If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehile, this is the real ammo2 value. +.float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2); /// If ent is player this is 0..100 indicating percentage of secondary reload status. If ent is vehile, this is the real reload2 value. .float sound_nexttime; const float VOL_VEHICLEENGINE = 1; @@ -81,9 +82,9 @@ const float DAMAGE_TARGETDRONE = 10; // vehicle functions .void(int _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns -.bool(int _imp) vehicles_impulse; +.bool(entity this, int _imp) vehicles_impulse; .int vehicle_weapon2mode = _STAT(VEHICLESTAT_W2MODE); -.void(int exit_flags) vehicle_exit; +.void(entity this, int exit_flags) vehicle_exit; .bool(entity this, entity player) 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 @@ -101,10 +102,10 @@ float vehicles_exit_running; .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly -void vehicles_exit(float eject); +void vehicles_exit(entity vehic, int eject); bool vehicle_initialize(entity this, Vehicle info, float nodrop); bool vehicle_impulse(entity this, int imp); bool vehicles_crushable(entity e); +float vehicle_altitude(entity this, float amax); #endif -#endif