#define hud_energy "gfx/vehicles/energy.tga"
entity dropmark;
-var float autocvar_cl_vehicles_hudscale = 0.5;
-var float autocvar_cl_vehicles_hudalpha = 0.75;
+float autocvar_cl_vehicles_hudscale = 0.5;
+float autocvar_cl_vehicles_hudalpha = 0.75;
const float MAX_AXH = 4;
entity AuxiliaryXhair[MAX_AXH];
self.draw2d = func_null;
}
-void Net_AuXair2(float bIsNew)
+void Net_AuXair2(bool bIsNew)
{
- float axh_id = bound(0, ReadByte(), MAX_AXH);
+ int axh_id = bound(0, ReadByte(), MAX_AXH);
entity axh = AuxiliaryXhair[axh_id];
if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
#define CL_VEHICLES_H
// vehicle cvars
-var float autocvar_cl_vehicles_alarm = 1;
-var float autocvar_cl_vehicles_hud_tactical = 1;
+bool autocvar_cl_vehicles_alarm = 1;
+bool autocvar_cl_vehicles_hud_tactical = 1;
void Net_AuXair2(float bIsNew);
void bumble_raygun_read(float bIsNew);
void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang);
#define HUD_GETVEHICLESTATS \
- local noref float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
- local noref float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
- local noref float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
- local noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
- local noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
- local noref float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
- local noref float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
+ int vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
+ float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
+ noref int energy = getstati(STAT_VEHICLESTAT_ENERGY); \
+ noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
+ noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
+ noref int ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
+ noref int reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
#endif
-
\ No newline at end of file
-// =========================
-// SVQC Vehicle Properties
-// =========================
-
+#include "vehicles.qh"
+#include "sv_vehicles.qh"
float SendAuxiliaryXhair(entity to, float sf)
{
{
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+ pointparticles(particleeffectnum("explosion_small"), self.wp00.origin + '0 0 64', '0 0 0', 1);
remove(self);
}
}
}
-bool vehicles_crushable(entity e)
+float vehicles_crushable(entity e)
{
if(IS_PLAYER(e) && time >= e.vehicle_enter_delay)
return true;
#ifndef VEHICLES_DEF_H
#define VEHICLES_DEF_H
+#ifdef SVQC
#include "../server/tturrets/include/turrets_early.qh"
var float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
var float autocvar_g_vehicles_tag_damagerate = 5;
+// flags:
+.int vehicle_flags;
+
// vehicle definitions
.entity gun1;
.entity gun2;
.int hud;
.float dmg_time;
-.float volly_counter;
+.int volly_counter;
const int MAX_AXH = 4;
.entity AuxiliaryXhair[MAX_AXH];
.float lock_soundtime;
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;
+.int vehicle_weapon2mode;
+.void(int exit_flags) vehicle_exit;
+.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 vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
-// 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;
-.void(int exit_flags) vehicle_exit;
-.float() 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)
-
// macros
#define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
if(trace_fraction != 1) \
acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
+void vehicles_exit(float eject);
+
+#endif
#endif
float autocvar_g_vehicle_bumblebee_cannon_ammo_regen;
float autocvar_g_vehicle_bumblebee_cannon_ammo_regen_pause;
-var float autocvar_g_vehicle_bumblebee_cannon_lock = 0;
+float autocvar_g_vehicle_bumblebee_cannon_lock = 0;
float autocvar_g_vehicle_bumblebee_cannon_turnspeed;
float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down;
float autocvar_g_vehicle_bumblebee_blowup_coredamage;
float autocvar_g_vehicle_bumblebee_blowup_edgedamage;
float autocvar_g_vehicle_bumblebee_blowup_forceintensity;
-var vector autocvar_g_vehicle_bumblebee_bouncepain;
+vector autocvar_g_vehicle_bumblebee_bouncepain;
-var float autocvar_g_vehicle_bumblebee = 0;
+bool autocvar_g_vehicle_bumblebee = 0;
float bumble_raygun_send(entity to, int sf);
_body.enemy = self.enemy;
_body.scale = 1.5;
_body.angles = self.angles;
-
+
pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1);
self.health = 0;
}
}
-void bumble_raygun_read(float bIsNew)
+void bumble_raygun_read(bool bIsNew)
{
int sf = ReadByte();
);
#else
-const float SBRM_FIRST = 1;
-const float SBRM_VOLLY = 1;
-const float SBRM_GUIDE = 2;
-const float SBRM_ARTILLERY = 3;
-const float SBRM_LAST = 3;
+const int SBRM_FIRST = 1;
+const int SBRM_VOLLY = 1;
+const int SBRM_GUIDE = 2;
+const int SBRM_ARTILLERY = 3;
+const int SBRM_LAST = 3;
#ifdef SVQC
-float autocvar_g_vehicle_spiderbot;
+bool autocvar_g_vehicle_spiderbot;
float autocvar_g_vehicle_spiderbot_respawntime;
float autocvar_g_vehicle_spiderbot_head_turnlimit;
float autocvar_g_vehicle_spiderbot_head_turnspeed;
-float autocvar_g_vehicle_spiderbot_health;
+int autocvar_g_vehicle_spiderbot_health;
float autocvar_g_vehicle_spiderbot_health_regen;
float autocvar_g_vehicle_spiderbot_health_regen_pause;
-float autocvar_g_vehicle_spiderbot_shield;
+int autocvar_g_vehicle_spiderbot_shield;
float autocvar_g_vehicle_spiderbot_shield_regen;
float autocvar_g_vehicle_spiderbot_shield_regen_pause;
float autocvar_g_vehicle_spiderbot_minigun_damage;
float autocvar_g_vehicle_spiderbot_minigun_refire;
float autocvar_g_vehicle_spiderbot_minigun_spread;
-float autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
-float autocvar_g_vehicle_spiderbot_minigun_ammo_max;
-float autocvar_g_vehicle_spiderbot_minigun_ammo_regen;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_max;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_regen;
float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause;
float autocvar_g_vehicle_spiderbot_minigun_force;
float autocvar_g_vehicle_spiderbot_minigun_solidpenetration;
self = player;
- // TODO: WTF
- ((spider.misc_bulletcounter % 2) ? gun = spider.gun1 : gun = spider.gun2);
+ gun = (spider.misc_bulletcounter % 2) ? spider.gun1 : spider.gun2;
+
v = gettaginfo(gun, gettagindex(gun, "barrels"));
v_forward = normalize(v_forward);
v += v_forward * 50;
#endif // SVQC
#ifdef CSQC
-var float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
-var float autocvar_cl_vehicle_spiderbot_cross_size = 1;
+float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
+float autocvar_cl_vehicle_spiderbot_cross_size = 1;
#define spider_ico "gfx/vehicles/sbot.tga"
#define spider_rkt "gfx/vehicles/sbot_rpods.tga"
#define VEHICLES_H
// vehicle requests
-#define VR_SETUP 1 // (BOTH) setup vehicle data
-#define VR_THINK 2 // (SERVER) logic to run every frame
-#define VR_DEATH 3 // (SERVER) called when vehicle dies
-#define VR_PRECACHE 4 // (BOTH) precaches models/sounds used by this vehicle
-#define VR_ENTER 5 // (SERVER) called when a player enters this vehicle
-#define VR_SPAWN 6 // (SERVER) called when the vehicle re-spawns
-#define VR_IMPACT 7 // (SERVER) called when a vehicle hits something
-#define VR_HUD 8 // (CLIENT) logic to run every frame
+const int VR_SETUP = 1; // (BOTH) setup vehicle data
+const int VR_THINK = 2; // (SERVER) logic to run every frame
+const int VR_DEATH = 3; // (SERVER) called when vehicle dies
+const int VR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this vehicle
+const int VR_ENTER = 5; // (SERVER) called when a player enters this vehicle
+const int VR_SPAWN = 6; // (SERVER) called when the vehicle re-spawns
+const int VR_IMPACT = 7; // (SERVER) called when a vehicle hits something
+const int VR_HUD = 8; // (CLIENT) logic to run every frame
-// functions:
-entity get_vehicleinfo(int id);
-
-// fields:
-.entity tur_head;
-
-// flags:
-.int vehicle_flags;
+// vehicle spawn flags (need them here for common registrations)
const int VHF_ISVEHICLE = 2; /// Indicates vehicle
const int VHF_HASSHIELD = 4; /// Vehicle has shileding
const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
+// functions:
+entity get_vehicleinfo(float id);
+
+// fields:
+.entity tur_head;
+
// entity properties of vehicleinfo:
.int vehicleid; // VEH_...
+#include "vehicles_include.qh"
+
#ifdef CSQC
#include "cl_vehicles.qc"
#include "vehicles.qc"
#ifdef CSQC
#include "vehicles.qh"
#include "cl_vehicles.qh"
-#endif // CSQC
-#ifdef SVQC
+#elif defined(SVQC)
#include "vehicles.qh"
#include "sv_vehicles.qh"
#endif // SVQC