#include "cl_vehicles.qh"
-const string vCROSS_BURST = "gfx/vehicles/crosshair_burst.tga";
-const string vCROSS_DROP = "gfx/vehicles/crosshair_drop.tga";
-const string vCROSS_GUIDE = "gfx/vehicles/crosshair_guide.tga";
-const string vCROSS_HEAL = "gfx/vehicles/crosshair_heal.tga";
-const string vCROSS_HINT = "gfx/vehicles/crosshair_hint.tga";
-const string vCROSS_LOCK = "gfx/vehicles/crosshair_lock.tga";
-const string vCROSS_RAIN = "gfx/vehicles/crosshair_rain.tga";
-
-entity dropmark;
-
-const int MAX_AXH = 4;
-entity AuxiliaryXhair[MAX_AXH];
-
-.string axh_image;
-.float axh_fadetime;
-.int axh_drawflag;
-
-float alarm1time;
-float alarm2time;
-
void vehicle_alarm(entity e, int ch, Sound s0und)
{
TC(Sound, s0und);
vector autocvar_hud_progressbar_vehicles_ammo1_color;
vector autocvar_hud_progressbar_vehicles_ammo2_color;
+const string vCROSS_BURST = "gfx/vehicles/crosshair_burst.tga";
+const string vCROSS_DROP = "gfx/vehicles/crosshair_drop.tga";
+const string vCROSS_GUIDE = "gfx/vehicles/crosshair_guide.tga";
+const string vCROSS_HEAL = "gfx/vehicles/crosshair_heal.tga";
+const string vCROSS_HINT = "gfx/vehicles/crosshair_hint.tga";
+const string vCROSS_LOCK = "gfx/vehicles/crosshair_lock.tga";
+const string vCROSS_RAIN = "gfx/vehicles/crosshair_rain.tga";
+
+entity dropmark;
+
+const int MAX_AXH = 4;
+entity AuxiliaryXhair[MAX_AXH];
+
+.string axh_image;
+.float axh_fadetime;
+.int axh_drawflag;
+
+float alarm1time;
+float alarm2time;
+
vector vehicleHud_Size;
vector vehicleHud_Pos;
#include <common/mapobjects/defs.qh>
#include <common/mapobjects/teleporters.qh>
#include <common/mapobjects/triggers.qh>
+#include <common/vehicles/vehicles.qh>
#include <server/bot/api.qh>
#include <server/client.qh>
#include <server/damage.qh>
}
}
-float vehicle_altitude(entity this, float amax)
-{
- tracebox(this.origin, this.mins, this.maxs, this.origin - ('0 0 1' * amax), MOVE_WORLDONLY, this);
- return vlen(this.origin - trace_endpos);
-}
-
-vector vehicles_force_fromtag_hover(entity this, string tag_name, float spring_length, float max_power)
-{
- force_fromtag_origin = gettaginfo(this, gettagindex(this, tag_name));
- v_forward = normalize(v_forward) * -1;
- traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, this);
-
- force_fromtag_power = (1 - trace_fraction) * max_power;
- force_fromtag_normpower = force_fromtag_power / max_power;
-
- return v_forward * force_fromtag_power;
-}
-
-vector vehicles_force_fromtag_maglev(entity this, string tag_name, float spring_length, float max_power)
-{
- force_fromtag_origin = gettaginfo(this, gettagindex(this, tag_name));
- v_forward = normalize(v_forward) * -1;
- traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, this);
-
- // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
- if(trace_fraction == 1.0)
- {
- force_fromtag_normpower = -0.25;
- return '0 0 -200';
- }
-
- force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
- force_fromtag_normpower = force_fromtag_power / max_power;
-
- return v_forward * force_fromtag_power;
-}
-
// projectile handling
void vehicles_projectile_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
{
const int VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehicle 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
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);
void vehicles_enter(entity pl, entity veh);
IntrusiveList g_vehicle_returners;
/* maxs */ ATTRIB(Bumblebee, m_maxs, vector, '230 130 130');
/* view offset*/ ATTRIB(Bumblebee, view_ofs, vector, '0 0 300');
/* view dist */ ATTRIB(Bumblebee, height, float, 450);
+#ifdef GAMEQC
/* model */ ATTRIB(Bumblebee, mdl, string, "models/vehicles/bumblebee_body.dpm");
/* model */ ATTRIB(Bumblebee, model, string, "models/vehicles/bumblebee_body.dpm");
/* head_model */ ATTRIB(Bumblebee, head_model, string, "");
/* tags */ ATTRIB(Bumblebee, tag_head, string, "");
/* tags */ ATTRIB(Bumblebee, tag_hud, string, "");
/* tags */ ATTRIB(Bumblebee, tag_view, string, "tag_viewport");
+#endif
/* netname */ ATTRIB(Bumblebee, netname, string, "bumblebee");
/* fullname */ ATTRIB(Bumblebee, vehicle_name, string, _("Bumblebee"));
/* icon */ ATTRIB(Bumblebee, m_icon, string, "vehicle_bumble");
entity vehic = player.vehicle;
return = true;
+#ifdef SVQC
if(game_stopped)
{
vehic.solid = SOLID_NOT;
set_movetype(vehic, MOVETYPE_NONE);
return;
}
+#endif
vehicles_frame(vehic, player);
else if (!vehic.racer_air_finished)
vehic.racer_air_finished = time + autocvar_g_vehicle_racer_water_time;
+#ifdef SVQC
if(IS_DEAD(vehic))
{
PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
return;
}
+#endif
racer_align4point(vehic, player, dt);
+#ifdef SVQC
PHYS_INPUT_BUTTON_ZOOM(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
+#endif
vehic.angles_x *= -1;
vector df = vehic.velocity * -autocvar_g_vehicle_racer_friction;
//vehic.velocity_z = ftmp;
- if(CS(player).movement)
+ if(PHYS_CS(player).movement)
{
if(cont & DPCONTENTS_LIQUIDSMASK)
{
- if(CS(player).movement_x) { df += v_forward * ((CS(player).movement_x > 0) ? autocvar_g_vehicle_racer_water_speed_forward : -autocvar_g_vehicle_racer_water_speed_forward); }
- if(CS(player).movement_y) { df += v_right * ((CS(player).movement_y > 0) ? autocvar_g_vehicle_racer_water_speed_strafe : -autocvar_g_vehicle_racer_water_speed_strafe); }
+ if(PHYS_CS(player).movement_x) { df += v_forward * ((PHYS_CS(player).movement_x > 0) ? autocvar_g_vehicle_racer_water_speed_forward : -autocvar_g_vehicle_racer_water_speed_forward); }
+ if(PHYS_CS(player).movement_y) { df += v_right * ((PHYS_CS(player).movement_y > 0) ? autocvar_g_vehicle_racer_water_speed_strafe : -autocvar_g_vehicle_racer_water_speed_strafe); }
}
else
{
- if(CS(player).movement_x) { df += v_forward * ((CS(player).movement_x > 0) ? autocvar_g_vehicle_racer_speed_forward : -autocvar_g_vehicle_racer_speed_forward); }
- if(CS(player).movement_y) { df += v_right * ((CS(player).movement_y > 0) ? autocvar_g_vehicle_racer_speed_strafe : -autocvar_g_vehicle_racer_speed_strafe); }
+ if(PHYS_CS(player).movement_x) { df += v_forward * ((PHYS_CS(player).movement_x > 0) ? autocvar_g_vehicle_racer_speed_forward : -autocvar_g_vehicle_racer_speed_forward); }
+ if(PHYS_CS(player).movement_y) { df += v_right * ((PHYS_CS(player).movement_y > 0) ? autocvar_g_vehicle_racer_speed_strafe : -autocvar_g_vehicle_racer_speed_strafe); }
}
#ifdef SVQC
dforce = autocvar_g_vehicle_racer_water_downforce;
df -= v_up * (vlen(vehic.velocity) * dforce);
- CS(player).movement = vehic.velocity += df * dt;
+ PHYS_CS(player).movement = vehic.velocity += df * dt;
#ifdef SVQC
#endif
setorigin(player, vehic.origin + '0 0 32');
+#ifdef SVQC
player.oldorigin = player.origin; // negate fall damage
+#endif
player.velocity = vehic.velocity;
}
+#endif
+#ifdef SVQC
void racer_think(entity this)
{
float dt = autocvar_g_vehicle_racer_thinkrate;
/* maxs */ ATTRIB(Racer, m_maxs, vector, '120 120 40' * 0.5);
/* view offset*/ ATTRIB(Racer, view_ofs, vector, '0 0 50');
/* view dist */ ATTRIB(Racer, height, float, 200);
+#ifdef GAMEQC
/* model */ ATTRIB(Racer, mdl, string, "models/vehicles/wakizashi.dpm");
/* model */ ATTRIB(Racer, model, string, "models/vehicles/wakizashi.dpm");
/* head_model */ ATTRIB(Racer, head_model, string, "null");
/* tags */ ATTRIB(Racer, tag_head, string, "");
/* tags */ ATTRIB(Racer, tag_hud, string, "");
/* tags */ ATTRIB(Racer, tag_view, string, "tag_viewport");
+#endif
/* netname */ ATTRIB(Racer, netname, string, "racer");
/* fullname */ ATTRIB(Racer, vehicle_name, string, _("Racer"));
/* icon */ ATTRIB(Racer, m_icon, string, "vehicle_racer");
/* maxs */ ATTRIB(Raptor, m_maxs, vector, '80 80 70');
/* view offset*/ ATTRIB(Raptor, view_ofs, vector, '0 0 160');
/* view dist */ ATTRIB(Raptor, height, float, 200);
+#ifdef GAMEQC
/* model */ ATTRIB(Raptor, mdl, string, "models/vehicles/raptor.dpm");
/* model */ ATTRIB(Raptor, model, string, "models/vehicles/raptor.dpm");
/* head_model */ ATTRIB(Raptor, head_model, string, "");
/* tags */ ATTRIB(Raptor, tag_head, string, "");
/* tags */ ATTRIB(Raptor, tag_hud, string, "tag_hud");
/* tags */ ATTRIB(Raptor, tag_view, string, "tag_camera");
+#endif
/* netname */ ATTRIB(Raptor, netname, string, "raptor");
/* fullname */ ATTRIB(Raptor, vehicle_name, string, _("Raptor"));
/* icon */ ATTRIB(Raptor, m_icon, string, "vehicle_raptor");
/* maxs */ ATTRIB(Spiderbot, m_maxs, vector, '75 75 125');
/* view offset*/ ATTRIB(Spiderbot, view_ofs, vector, '0 0 70');
/* view dist */ ATTRIB(Spiderbot, height, float, 170);
+#ifdef GAMEQC
/* model */ ATTRIB(Spiderbot, mdl, string, "models/vehicles/spiderbot.dpm");
/* model */ ATTRIB(Spiderbot, model, string, "models/vehicles/spiderbot.dpm");
/* head_model */ ATTRIB(Spiderbot, head_model, string, "models/vehicles/spiderbot_top.dpm");
/* tags */ ATTRIB(Spiderbot, tag_head, string, "tag_head");
/* tags */ ATTRIB(Spiderbot, tag_hud, string, "tag_hud");
/* tags */ ATTRIB(Spiderbot, tag_view, string, "");
+#endif
/* netname */ ATTRIB(Spiderbot, netname, string, "spiderbot");
/* fullname */ ATTRIB(Spiderbot, vehicle_name, string, _("Spiderbot"));
/* icon */ ATTRIB(Spiderbot, m_icon, string, "vehicle_spider");
#include "vehicles.qh"
+
+#ifdef GAMEQC
+float vehicle_altitude(entity this, float amax)
+{
+ tracebox(this.origin, this.mins, this.maxs, this.origin - ('0 0 1' * amax), MOVE_WORLDONLY, this);
+ return vlen(this.origin - trace_endpos);
+}
+
+vector vehicles_force_fromtag_hover(entity this, string tag_name, float spring_length, float max_power)
+{
+ force_fromtag_origin = gettaginfo(this, gettagindex(this, tag_name));
+ v_forward = normalize(v_forward) * -1;
+ traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, this);
+
+ force_fromtag_power = (1 - trace_fraction) * max_power;
+ force_fromtag_normpower = force_fromtag_power / max_power;
+
+ return v_forward * force_fromtag_power;
+}
+
+vector vehicles_force_fromtag_maglev(entity this, string tag_name, float spring_length, float max_power)
+{
+ force_fromtag_origin = gettaginfo(this, gettagindex(this, tag_name));
+ v_forward = normalize(v_forward) * -1;
+ traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, this);
+
+ // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
+ if(trace_fraction == 1.0)
+ {
+ force_fromtag_normpower = -0.25;
+ return '0 0 -200';
+ }
+
+ force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
+ force_fromtag_normpower = force_fromtag_power / max_power;
+
+ return v_forward * force_fromtag_power;
+}
+#endif
#pragma once
+
+#ifdef GAMEQC
+float force_fromtag_power;
+float force_fromtag_normpower;
+vector force_fromtag_origin;
+
+float vehicle_altitude(entity this, float amax);
+
+vector vehicles_force_fromtag_hover(entity this, string tag_name, float spring_length, float max_power);
+
+vector vehicles_force_fromtag_maglev(entity this, string tag_name, float spring_length, float max_power);
+#endif