if(time > racer.delay)
if(player.BUTTON_ATCK2)
{
- racer_fire_rocket("tag_rocket_r", ((self.lock_strength == 1 && self.lock_target) ? self.lock_target : world));
- racer_fire_rocket("tag_rocket_l", ((self.lock_strength == 1 && self.lock_target) ? self.lock_target : world));
+ racer_fire_rocket("tag_rocket_r", (self.lock_strength == 1 && self.lock_target) ? self.lock_target : world);
+ racer_fire_rocket("tag_rocket_l", (self.lock_strength == 1 && self.lock_target) ? self.lock_target : world);
self.lock_strength = 0;
self.lock_target = world;
void racer_touch()
{
+ vehicles_touch();
if(self.owner)
{
//self.velocity = 0.999 * self.velocity;
pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
self.delay = time;
- vehicles_common_spawn();
+ vehicles_reset_colors();
}
void racer_blowup()
self.scale = 0.5;
setattachment(self.vehicle_hudmodel, self, "");
setattachment(self.vehicle_viewport, self, "tag_viewport");
+
+ self.mass = 900;
}
void spawnfunc_vehicle_racer()
float autocvar_g_vehicle_raptor_bomblet_explode_delay;
float autocvar_g_vehicle_raptor_bombs_refire;
-float autocvar_g_vehicle_raptor_guns_turnspeed;
-float autocvar_g_vehicle_raptor_guns_turnlimit;
-float autocvar_g_vehicle_raptor_guns_pitchlimit_up;
-float autocvar_g_vehicle_raptor_guns_pitchlimit_down;
+float autocvar_g_vehicle_raptor_cannon_turnspeed;
+float autocvar_g_vehicle_raptor_cannon_turnlimit;
+float autocvar_g_vehicle_raptor_cannon_pitchlimit_up;
+float autocvar_g_vehicle_raptor_cannon_pitchlimit_down;
float autocvar_g_vehicle_raptor_cannon_locktarget;
float autocvar_g_vehicle_raptor_cannon_locking_time;
}
// Aim the gunz
- ftmp2 = autocvar_g_vehicle_raptor_guns_turnspeed * frametime;
+ ftmp2 = autocvar_g_vehicle_raptor_cannon_turnspeed * frametime;
ftmp = -ftmp2;
// Gun1
df_x = bound(ftmp, df_x, ftmp2);
df_y = bound(ftmp, df_y, ftmp2);
// Bind to limts
- raptor.gun1.angles_x = bound(-autocvar_g_vehicle_raptor_guns_pitchlimit_down, df_x + raptor.gun1.angles_x, autocvar_g_vehicle_raptor_guns_pitchlimit_up);
- raptor.gun1.angles_y = bound(-autocvar_g_vehicle_raptor_guns_turnlimit, df_y + raptor.gun1.angles_y, autocvar_g_vehicle_raptor_guns_turnlimit);
+ raptor.gun1.angles_x = bound(-autocvar_g_vehicle_raptor_cannon_pitchlimit_down, df_x + raptor.gun1.angles_x, autocvar_g_vehicle_raptor_cannon_pitchlimit_up);
+ raptor.gun1.angles_y = bound(-autocvar_g_vehicle_raptor_cannon_turnlimit, df_y + raptor.gun1.angles_y, autocvar_g_vehicle_raptor_cannon_turnlimit);
//df = vectoangles(normalize(trace_endpos - df));
df_x = bound(ftmp, df_x, ftmp2);
df_y = bound(ftmp, df_y, ftmp2);
// Bind to limts
- raptor.gun2.angles_x = bound(-autocvar_g_vehicle_raptor_guns_pitchlimit_down, df_x + raptor.gun2.angles_x, autocvar_g_vehicle_raptor_guns_pitchlimit_up);
- raptor.gun2.angles_y = bound(-autocvar_g_vehicle_raptor_guns_turnlimit, df_y + raptor.gun2.angles_y, autocvar_g_vehicle_raptor_guns_turnlimit);
+ raptor.gun2.angles_x = bound(-autocvar_g_vehicle_raptor_cannon_pitchlimit_down, df_x + raptor.gun2.angles_x, autocvar_g_vehicle_raptor_cannon_pitchlimit_up);
+ raptor.gun2.angles_y = bound(-autocvar_g_vehicle_raptor_cannon_turnlimit, df_y + raptor.gun2.angles_y, autocvar_g_vehicle_raptor_cannon_turnlimit);
/*
void raptor_touch()
{
+ vehicles_touch();
if(self.owner)
{
if(vlen(self.velocity) == 0)
pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
self.delay = time;
- vehicles_common_spawn();
+ vehicles_reset_colors();
}
void raptor_dinit()
spinner.movetype = MOVETYPE_NOCLIP;
spinner.avelocity = '0 -90 0';
self.bomb1.gun2 = spinner;
+
+ self.mass = 2200;
}
void spawnfunc_vehicle_raptor()
void spiderbot_touch()
{
+ vehicles_touch();
if(self.owner)
{
if(vlen(self.velocity) == 0)
setorigin(self, self.pos1 + '0 0 128');
self.angles = self.pos2;
- vehicles_common_spawn();
+ vehicles_reset_colors();
}
setattachment(self.gun2, self.tur_head, "tag_hardpoint02");
self.gravity = 2;
+ self.mass = 5000;
}
void spawnfunc_vehicle_spiderbot()
/*
// SVC_TEMPENTITY based, horrible with even 50 ping. hm.
+// WriteByte(MSG_ONE, SVC_TEMPENTITY) uses reliable messagess, never use for thinsg that need continous updates.
void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
{
msg_entity = own;
.entity lock_target;
.float lock_strength;
.float lock_time;
-void vehicles_locktarget(float deltatime)
-{
- // no target hit by trace
- if(trace_ent == world)
- {
- self.lock_strength = max(self.lock_strength - deltatime, 0);
- if(self.lock_strength == 0)
- self.lock_target = world;
-
- return;
- }
-
- // Current have no target
- if(self.lock_target == world)
- {
- // aquire
- if(trace_ent != world)
- {
- self.lock_target = trace_ent;
- self.lock_strength = deltatime;
- }
- return;
- }
-
- // Have a locking target
- // Trace hit current target
- if(trace_ent == self.lock_target)
- {
- self.lock_strength = min(self.lock_strength + deltatime, 1);
- }
- else
- {
- self.lock_strength = max(self.lock_strength - deltatime, 0);
- if(self.lock_strength == 0)
- self.lock_target = world;
- }
-}
-
-
void vehicles_locktarget2(float incr, float decr, float _lock_time)
{
if(self.lock_time > time)
return;
-
-
if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
self.lock_strength = min(self.lock_strength - decr, 1);
else if(trace_ent.deadflag != DEAD_NO)
void vehicles_touch()
{
+ // Vehicle currently
+ if(self.owner)
+ {
+ // Colided with world?
+ if(other == world)
+ {
+ // Apply velocity based self damage here
+ }
+ else
+ {
+ if(other.vehicle_flags & VHF_ISVEHICLE)
+ {
+ other.velocity += self.velocity * (self.mass / other.mass);
+ }
+ }
+ }
+
if(other.classname != "player")
return;
if (clienttype(other) != CLIENTTYPE_REAL)
return;
- self.colormod = self.tur_head.colormod = '0 0 0';
+ if(self.phase > time)
+ return;
if(teams_matter)
if(self.team)
void vehicles_exit(float eject)
{
- self.colormap = 1024;
- self.tur_head.colormap = 1024;
-
- if (teams_matter)
- {
- if (self.team == COLOR_TEAM1)
- self.colormod = '1.4 0.8 0.8';
-
- if (self.team == COLOR_TEAM2)
- self.colormod = '0.8 0.8 1.4';
-
- self.tur_head.colormod = self.colormod;
- }
-
-
self.flags |= FL_NOTARGET;
if (self.owner)
WriteByte (MSG_ONE, SVC_SETVIEWPORT);
WriteEntity( MSG_ONE, self.owner);
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, 0); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
+ WriteAngle(MSG_ONE, 0); // tilt
+ WriteAngle(MSG_ONE, self.angles_y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
- setsize(self.owner,PL_MIN,PL_MAX);
+ setsize(self.owner, PL_MIN,PL_MAX);
self.owner.takedamage = DAMAGE_AIM;
self.owner.solid = SOLID_SLIDEBOX;
self.vehicle_hudmodel.viewmodelforclient = self;
self.tur_head.nodrawtoclient = self;
+ self.phase = time + 1;
+
+ if(!teams_matter)
+ self.team = 0;
+
if(self.vehicle_exit)
self.vehicle_exit(eject);
self.tur_head.enemy.colormod = '1 1 1';
self.tur_head.enemy.alpha = 0.45;
- self.tur_head.enemy.scale = (256 / vlen(self.maxs - self.mins));
+ self.tur_head.enemy.scale = 256 / vlen(self.maxs - self.mins);
self.tur_head.enemy.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
self.tur_head.enemy.think = shieldhit_think;
self.tur_head.enemy.nextthink = time;
self.vehicle_shield -= damage;
if(self.vehicle_shield < 0)
{
- self.tur_head.enemy.colormod = '10 0 -1';
+ self.tur_head.enemy.colormod = '2 0 0';
ddmg_take = fabs(self.vehicle_shield);
self.vehicle_shield = 0;
self.tur_head.enemy.alpha = 0.75;
float vehicles_customizeentityforclient()
{
- if(self.deadflag == DEAD_DEAD)
- return FALSE;
-
- return TRUE;
+ return self.deadflag == DEAD_DEAD ? FALSE : TRUE;
}
-void vehicles_configcheck(string configname, float check_cvar)
+void vehicles_configcheck(string configname, float check_cvar)
{
if(check_cvar == 0)
localcmd(strcat("exec ", configname, "\n"));
}
-void vehicles_common_spawn()
+void vehicles_reset_colors()
{
entity e;
float _effects, _colormap;
return TRUE;
}
+
void bugmenot()
{
self.vehicle_exit = self.vehicle_exit;
self.vehicle_enter = self.vehicle_exit;
self.vehicle_die = self.vehicle_exit;
self.vehicle_spawn = self.vehicle_exit;
+ self.AuxiliaryXhair = self.AuxiliaryXhair;
//self.vehicle_message = self.vehicle_exit;
}
set g_vehicle_racer_speed_afterburn 2000
set g_vehicle_racer_afterburn_cost 75 // energy consumed per second
-set g_vehicle_racer_hovertype 0 // 0 = hover, != 0 = maglev
-set g_vehicle_racer_hoverpower 3600 // NOTE!! x 4 (4 engines)
+set g_vehicle_racer_hovertype 0 // 0 = hover, != 0 = maglev
+set g_vehicle_racer_hoverpower 3600 // NOTE!! x 4 (4 engines)
set g_vehicle_racer_upforcedamper 0.94
set g_vehicle_racer_downforce 0.01
set g_vehicle_racer_rocket_cost 0
set g_vehicle_racer_rocket_locktarget 1
set g_vehicle_racer_rocket_locking_time 0.5
-set g_vehicle_racer_rocket_locking_releasetime 0.5
-set g_vehicle_racer_rocket_locked_time 1
+set g_vehicle_racer_rocket_locking_releasetime 1
+set g_vehicle_racer_rocket_locked_time 2
set g_vehicle_racer_rocket_locked_maxangle 1.4
set g_vehicle_racer_blowup_radius 250
set g_vehicle_racer_blowup_coredamage 250
set g_vehicle_racer_blowup_edgedamage 15
set g_vehicle_racer_blowup_forceintensity 250
+set g_vehicle_racer_mass 900
set g_vehicle_raptor_bomblet_explode_delay 0.25
set g_vehicle_raptor_bombs_refire 5
-set g_vehicle_raptor_guns_turnspeed 90
-set g_vehicle_raptor_guns_turnlimit 20
-set g_vehicle_raptor_guns_pitchlimit_up 12
-set g_vehicle_raptor_guns_pitchlimit_down 32
+set g_vehicle_raptor_cannon_turnspeed 90
+set g_vehicle_raptor_cannon_turnlimit 20
+set g_vehicle_raptor_cannon_pitchlimit_up 12
+set g_vehicle_raptor_cannon_pitchlimit_down 32
set g_vehicle_raptor_cannon_locktarget 1
set g_vehicle_raptor_cannon_locking_time 0.5
-set g_vehicle_raptor_cannon_locking_releasetime 0.5
-set g_vehicle_raptor_cannon_locked_time 1
+set g_vehicle_raptor_cannon_locking_releasetime 1
+set g_vehicle_raptor_cannon_locked_time 2
set g_vehicle_raptor_cannon_predicttarget 1
set g_vehicle_raptor_cannon_cost 1
set g_vehicle_raptor_shield 150
set g_vehicle_raptor_shield_regen 25
set g_vehicle_raptor_shield_regen_pause 2
+
+set g_vehicle_raptor_mass 2200
set g_vehicle_spiderbot_crush_dmg 50
set g_vehicle_spiderbot_crush_force 50
+set g_vehicle_spiderbot_mass 5000
+
+
set cl_vehicle_spiderbot_cross_alpha 0.4
set cl_vehicle_spiderbot_cross_size 1