originjitter 8 8 8
velocityjitter 312 312 312
+
effect raptor_cannon_muzzleflash
count 16
type spark
lightradius 150
lightradiusfade 6000
lightcolor 3 0 6
+
+// decal
+effect raptor_bomb_impact
+countabsolute 1
+type decal
+tex 8 16
+size 84 84
+alpha 256 256 0
+originjitter 16 16 16
+rotate -180 180 0 0
+//spark vertical
+effect raptor_bomb_impact
+count 6
+type spark
+color 0xff9c00 0xff3c00
+tex 48 55
+size 30 60
+alpha 300 300 600
+originjitter 10 10 10
+velocityjitter 80 80 120
+stretchfactor 240
+sizeincrease 50
+//fire
+effect raptor_bomb_impact
+count 8
+type smoke
+color 0xff9c00 0xff3c00
+tex 48 55
+size 80 160
+alpha 300 300 500
+originjitter 10 10 10
+velocityjitter 950 950 0
+sizeincrease 290
+airfriction 2
+//smoke
+effect raptor_bomb_impact
+count 5
+type spark
+blend alpha
+tex 0 7
+size 140 200
+color 0x646364 0x151515
+alpha 428 428 600
+rotate -180 180 0 0
+velocityjitter 200 200 300
+velocityoffset 0 0 280
+originjitter 30 30 10
+stretchfactor 20
+//smoke 2
+effect raptor_bomb_impact
+count 4
+type alphastatic
+tex 0 7
+size 40 100
+color 0x646364 0x151515
+alpha 328 328 350
+rotate -180 180 0 0
+velocityjitter 200 200 300
+velocityoffset 0 0 380
+originjitter 30 30 10
+sizeincrease 60
+airfriction 0.6
+
+
case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum("TR_ROCKET"); break;
case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_ROCKET"); break;
case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.scale = 2; self.traileffect = particleeffectnum("TR_ROCKET"); break;
- case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/raptor_bomb.dpm"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum("TR_GRENADE"); break;
+ case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/raptor_bomb.dpm"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break;
default:
error("Received invalid CSQC projectile, can't work with this!");
break;
break;
case HUD_WAKIZASHI:
AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
- AuxiliaryXhair[0].axh_scale = 0.5;
+ AuxiliaryXhair[0].axh_scale = 0.25;
break;
case HUD_RAPTOR:
AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-cross.tga";
AuxiliaryXhair[0].axh_scale = 0.5;
- AuxiliaryXhair[1].alpha = 0.25;
- AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
- AuxiliaryXhair[1].axh_scale = 0.5;
- AuxiliaryXhair[1].alpha = 0.5;
+ AuxiliaryXhair[0].alpha = 0.25;
+
+ AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
+ AuxiliaryXhair[1].axh_scale = 0.25;
+ AuxiliaryXhair[1].alpha = 0.75;
+ AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
+
break;
}
}
SetZoomState(spectatee.zoomstate);
anticheat_spectatecopy(spectatee);
+
+ //self.vehicle = spectatee.vehicle;
+
+ self.hud = spectatee.hud;
+ if(spectatee.vehicle)
+ {
+ self.vehicle_health = spectatee.vehicle_health;
+ self.vehicle_shield = spectatee.vehicle_shield;
+ self.vehicle_energy = spectatee.vehicle_energy;
+ self.vehicle_ammo1 = spectatee.vehicle_ammo1;
+ self.vehicle_ammo2 = spectatee.vehicle_ammo2;
+ self.vehicle_reload1 = spectatee.vehicle_reload1;
+ self.vehicle_reload2 = spectatee.vehicle_reload2;
+ msg_entity = self;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity(MSG_ONE, spectatee.vehicle.vehicle_viewport);
+ }
}
float SpectateUpdate() {
float autocvar_g_vehicle_racer_rocket_locking_time;
float autocvar_g_vehicle_racer_rocket_locking_releasetime;
float autocvar_g_vehicle_racer_rocket_locked_time;
+float autocvar_g_vehicle_racer_rocket_locked_maxangle;
float autocvar_g_vehicle_racer_respawntime;
float autocvar_g_vehicle_racer_collision_multiplier;
return;
}
- if(self.enemy != world)
- newdir = normalize(self.enemy.origin - self.origin);
-
traceline(trace_endpos, trace_endpos - '0 0 64', MOVE_NORMAL, self);
if(trace_fraction != 1.0)
{
- newdir += normalize(trace_endpos + '0 0 64' - self.origin);
- self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
+ newdir = normalize(trace_endpos + '0 0 64' - self.origin) * autocvar_g_vehicle_racer_rocket_turnrate;
+ self.velocity = normalize(olddir + newdir) * newvel;
}
else
{
- self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
+ self.velocity = olddir * newvel;
self.velocity_z -= 1600 * sys_frametime; // 2x grav looks better for this one
}
return;
}
+void racer_rocket_tracker()
+{
+ vector olddir, newdir;
+ float oldvel, newvel;
+
+ self.nextthink = time;
+
+ if ((self.owner.deadflag != DEAD_NO) || (self.cnt < time))
+ {
+ racer_rocket_explode();
+ return;
+ }
+
+ if not (self.realowner.vehicle)
+ {
+ UpdateCSQCProjectile(self);
+ return;
+ }
+
+ olddir = normalize(self.velocity);
+ oldvel = vlen(self.velocity);
+ newvel = oldvel + self.lip;
+ makevectors(vectoangles(olddir));
+
+ traceline(self.origin, self.origin + v_forward * 64 - '0 0 32', MOVE_NORMAL, self);
+ newdir = normalize(self.enemy.origin - self.origin);
+
+ if(vlen(newdir - v_forward) > autocvar_g_vehicle_racer_rocket_locked_maxangle)
+ {
+ //bprint("Target lost!\n");
+ //dprint("OF:", ftos(vlen(newdir - v_forward)), "\n");
+ self.think = racer_rocket_groundhugger;
+ return;
+ }
+
+ if(trace_fraction != 1.0)
+ newdir_z += 16 * sys_frametime;
+
+ self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
+ self.velocity_z -= 800 * sys_frametime;
+
+ UpdateCSQCProjectile(self);
+ return;
+}
+
void racer_fire_rocket(string tagname, entity trg)
{
entity rocket;
rocket.bot_dodgerating = autocvar_g_vehicle_racer_rocket_damage;
rocket.cnt = time + 9;
rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
- rocket.think = racer_rocket_groundhugger;
- rocket.nextthink = time + 0.5;
+
+ if(trg)
+ rocket.think = racer_rocket_tracker;
+ else
+ rocket.think = racer_rocket_groundhugger;
+
+ rocket.nextthink = time;
rocket.enemy = trg;
CSQCProjectile(rocket, TRUE, PROJECTILE_ROCKET, TRUE);
float racer_frame()
{
entity player, racer;
- float ftmp, ftmp2;
vector df;
+ float ftmp, ftmp2;
player = self;
racer = self.vehicle;
racer_align4point();
// Move abt crosshir insted of v_angle. this allows custom chase camera.
crosshair_trace(player);
+#if VEHICLES_VIEWROTATE_CROSSHAIR
racer.angles_x *= -1;
df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
if(df_x > 180) df_x -= 360;
// Turn
racer.angles_y = ftmp2;
- // Pitch Body
+ // Pitch
ftmp = autocvar_g_vehicle_racer_pitchspeed * sys_frametime;
ftmp2 = ftmp * -1;
makevectors(racer.angles);
racer.angles_x *= -1;
+#else
+ racer.angles_x *= -1;
+
+ // Yaw
+ ftmp = autocvar_g_vehicle_racer_turnspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(player.v_angle_y - racer.angles_y, racer.angles_y), ftmp);
+ racer.angles_y = anglemods(racer.angles_y + ftmp);
+
+ // Roll
+ racer.angles_z += -ftmp * autocvar_g_vehicle_racer_turnroll * sys_frametime;
+
+ // Pitch
+ ftmp = autocvar_g_vehicle_racer_pitchspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(player.v_angle_x - racer.angles_x, racer.angles_x), ftmp);
+ racer.angles_x = bound(-30, anglemods(racer.angles_x + ftmp), 30);
+
+ makevectors(racer.angles);
+ racer.angles_x *= -1;
+#endif
df = racer.velocity * -0.5;
float autocvar_g_vehicle_raptor_speed_strafe;
float autocvar_g_vehicle_raptor_speed_up;
float autocvar_g_vehicle_raptor_speed_down;
+float autocvar_g_vehicle_raptor_friction;
float autocvar_g_vehicle_raptor_bomblets;
float autocvar_g_vehicle_raptor_bomblet_alt;
float autocvar_g_vehicle_raptor_bomblet_edgedamage;
float autocvar_g_vehicle_raptor_bomblet_radius;
float autocvar_g_vehicle_raptor_bomblet_force;
+float autocvar_g_vehicle_raptor_bomblet_explode_delay;
float autocvar_g_vehicle_raptor_bombs_refire;
float autocvar_g_vehicle_raptor_guns_turnspeed;
.entity bomb1;
.entity bomb2;
-.entity camera;
+//.entity camera;
+//#define RAPTOR_RETARDCAMERA
float raptor_altitude(float amax)
{
return vlen(self.origin - trace_endpos);
}
+
void raptor_bomblet_boom()
{
- if(other == self.owner || other.owner == self.owner)
- return;
-
- pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
- RadiusDamage (self, self.enemy, autocvar_g_vehicle_raptor_bomblet_damage,
+ sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, trace_plane_normal * 1000, 1);
+ RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
autocvar_g_vehicle_raptor_bomblet_edgedamage,
autocvar_g_vehicle_raptor_bomblet_radius, world,
autocvar_g_vehicle_raptor_bomblet_force, DEATH_SBROCKET, world);
remove(self);
}
+void raptor_bomblet_touch()
+{
+ if(other == self.owner)
+ return;
+
+ PROJECTILE_TOUCH;
+ self.think = raptor_bomblet_boom;
+ self.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay;
+}
+
void raptor_bomb_burst()
{
+ if(self.cnt > time)
if(autocvar_g_vehicle_raptor_bomblet_alt)
{
self.nextthink = time;
- // FIXME: this can make bombs stic forever if fierd at low altitude and land close to vehicle.
traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
if(trace_fraction == 1.0)
return;
entity bomblet;
float i;
- pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+ sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin, self.velocity, 1);
for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
{
bomblet.scale = 0.5;
bomblet.solid = SOLID_TRIGGER;
- bomblet.movetype = MOVETYPE_BOUNCE;
- bomblet.touch = raptor_bomblet_boom;
+ bomblet.movetype = MOVETYPE_TOSS;
+ bomblet.touch = raptor_bomblet_touch;
bomblet.think = raptor_bomblet_boom;
bomblet.nextthink = time + 5;
- bomblet.owner = self.owner;
+ bomblet.owner = self.owner;
+ bomblet.realowner = self.realowner;
bomblet.velocity = normalize(normalize(self.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(self.velocity);
-
+ PROJECTILE_MAKETRIGGER(bomblet);
CSQCProjectile(bomblet, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
}
setorigin(bomb_1, gettaginfo(self, gettagindex(self, "bombmount_left")));
setorigin(bomb_2, gettaginfo(self, gettagindex(self, "bombmount_right")));
- bomb_1.movetype = bomb_2.movetype = MOVETYPE_TOSS;
- bomb_1.velocity = bomb_2.velocity = self.velocity;
- bomb_1.touch = bomb_2.touch = raptor_bomb_touch;
- bomb_1.think = bomb_2.think = raptor_bomb_burst;
+ bomb_1.movetype = bomb_2.movetype = MOVETYPE_TOSS;
+ bomb_1.velocity = bomb_2.velocity = self.velocity;
+ bomb_1.touch = bomb_2.touch = raptor_bomb_touch;
+ bomb_1.think = bomb_2.think = raptor_bomb_burst;
+ bomb_1.cnt = bomb_2.cnt = time + 10;
if(autocvar_g_vehicle_raptor_bomblet_alt)
bomb_1.nextthink = bomb_2.nextthink = time;
bomb_1.nextthink = bomb_2.nextthink = time + autocvar_g_vehicle_raptor_bomblet_time;
bomb_1.owner = bomb_2.owner = self;
- bomb_1.enemy = bomb_2.enemy = self.owner;
+ bomb_1.realowner = bomb_2.realowner = self.owner;
bomb_1.solid = bomb_2.solid = SOLID_BBOX;
+ PROJECTILE_MAKETRIGGER(bomb_1);
+ PROJECTILE_MAKETRIGGER(bomb_2);
+
CSQCProjectile(bomb_1, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
CSQCProjectile(bomb_2, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_raptor_health);
self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_raptor_shield);
self.velocity_z = 1;
- //setorigin(self.vehicle_viewport, self.origin);
+#ifdef RAPTOR_RETARDCAMERA
+ setorigin(self.vehicle_viewport, self.origin);
+#endif
}
void raptor_land()
self = player;
return 1;
}
+ crosshair_trace(player);
+
+#if VEHICLES_VIEWROTATE_CROSSHAIR
+ df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
+ if(df_x > 180) df_x -= 360;
+ if(df_x < -180) df_x += 360;
+ if(df_y > 180) df_y -= 360;
+ if(df_y < -180) df_y += 360;
- /*
- raptor.angles_x *= -1;
// Rotate Body
ftmp = autocvar_g_vehicle_raptor_turnspeed * sys_frametime;
- ftmp = bound(-ftmp, shortangle_f(player.v_angle_y - raptor.angles_y, raptor.angles_y), ftmp);
+ ftmp = bound(-ftmp, shortangle_f(df_y - raptor.angles_y, raptor.angles_y), ftmp);
// Turn
raptor.angles_y = anglemods(raptor.angles_y + ftmp);
// Pitch Body
ftmp = autocvar_g_vehicle_raptor_pitchspeed * sys_frametime;
- ftmp = bound(-ftmp, shortangle_f(player.v_angle_x - raptor.angles_x, raptor.angles_x), ftmp);
+ ftmp = bound(-ftmp, shortangle_f(df_x - raptor.angles_x, raptor.angles_x), ftmp);
raptor.angles_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, anglemods(raptor.angles_x + ftmp), autocvar_g_vehicle_raptor_pitchlimit);
+#else
raptor.angles_x *= -1;
-
- if(autocvar_g_vehicle_raptor_movestyle == 1)
- {
- ftmp = raptor.angles_z;
- raptor.angles_z = 0;
- ftmp2 = raptor.angles_x;
- raptor.angles_x = 0;
- fixedmakevectors(raptor.angles);
- raptor.angles_z = ftmp;
- raptor.angles_x = ftmp2;
- }
- else
- makevectors(player.v_angle);
- */
-
- crosshair_trace(player);
- //df = vectoangles(normalize(trace_endpos - gettaginfo(raptor ,gettagindex(raptor, "tag_hud"))) - raptor.angles);
- df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
- if(df_x > 180) df_x -= 360;
- if(df_x < -180) df_x += 360;
- if(df_y > 180) df_y -= 360;
- if(df_y < -180) df_y += 360;
-
- //raptor.angles_x *= -1;
// Rotate Body
ftmp = autocvar_g_vehicle_raptor_turnspeed * sys_frametime;
- ftmp = bound(-ftmp, shortangle_f(df_y - raptor.angles_y, raptor.angles_y), ftmp);
+ ftmp = bound(-ftmp, shortangle_f(player.v_angle_y - raptor.angles_y, raptor.angles_y), ftmp);
// Turn
raptor.angles_y = anglemods(raptor.angles_y + ftmp);
// Pitch Body
ftmp = autocvar_g_vehicle_raptor_pitchspeed * sys_frametime;
- ftmp = bound(-ftmp, shortangle_f(df_x - raptor.angles_x, raptor.angles_x), ftmp);
+ ftmp2 = shortangle_f(player.v_angle_x - raptor.angles_x, raptor.angles_x);
+
+ if(player.movement_x > 0)
+ ftmp2 += 20 * ftmp;
+ else if(player.movement_x < 0)
+ ftmp2 -= 45 * ftmp;
+ ftmp = bound(-ftmp, ftmp2, ftmp);
raptor.angles_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, anglemods(raptor.angles_x + ftmp), autocvar_g_vehicle_raptor_pitchlimit);
- //raptor.angles_x *= -1;
+ raptor.angles_x *= -1;
+#endif
if(autocvar_g_vehicle_raptor_movestyle == 1)
- {
- ftmp = raptor.angles_z;
- raptor.angles_z = 0;
- ftmp2 = raptor.angles_x;
- raptor.angles_x = 0;
- fixedmakevectors(raptor.angles);
- raptor.angles_z = ftmp;
- raptor.angles_x = ftmp2;
- }
+ fixedmakevectors('0 1 0' * raptor.angles_y);
else
makevectors(player.v_angle);
-
-
- /*
- float dist, spd, back, up;
- //dist = normalize(self.vehicle_viewport.origin - self.origin);
+#ifdef RAPTOR_RETARDCAMERA
+ float spd, back, up;
spd = vlen(self.velocity) + 0.01;
back = spd / autocvar_g_vehicle_raptor_speed_forward;
up = 1 - back;
up = up + 100;
setorigin(self.vehicle_viewport, self.origin + (v_up * up) + (v_forward * -back));
- */
+#endif
- df = raptor.velocity * -1;
+ df = raptor.velocity * -autocvar_g_vehicle_raptor_friction;
if(player.movement_x != 0)
{
if(autocvar_g_vehicle_raptor_cannon_predicttarget && self.lock_strength == 1)
{
- vector o;
if(self.lock_target != world)
{
float i, distance, impact_time;
vf = real_origin(raptor.lock_target);
ad = vf;
- o = raptor.origin;
for(i = 0; i < 4; ++i)
{
-
- distance = vlen(ad - o);
+ distance = vlen(ad - raptor.origin);
impact_time = distance / autocvar_g_vehicle_raptor_cannon_speed;
ad = vf + raptor.lock_target.velocity * impact_time;
- o = raptor.origin + raptor.velocity * impact_time;
}
trace_endpos = ad;
+ UpdateAuxiliaryXhair(player, trace_endpos, '1 1 1', 0);
}
}
+ if(self.lock_target)
+ {
+ if(raptor.lock_strength == 1)
+ UpdateAuxiliaryXhair(player, real_origin(raptor.lock_target), '1 0 0', 1);
+ else if(self.lock_strength > 0.5)
+ UpdateAuxiliaryXhair(player, real_origin(raptor.lock_target), '0 1 0', 1);
+ else if(self.lock_strength < 0.5)
+ UpdateAuxiliaryXhair(player, real_origin(raptor.lock_target), '0 0 1', 1);
+ }
+
+ /*
if(self.lock_target != world)
if(self.lock_strength == 1)
UpdateAuxiliaryXhair(player, real_origin(self.lock_target), '0 0 1', 1);
else
UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * (1 - self.lock_strength)) + '0 1 0' * self.lock_strength, 1);
+ */
}
// Aim the gunz
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);
+ //df = vectoangles(normalize(trace_endpos - df));
+
//Gun 2
df = gettaginfo(raptor.gun2, gettagindex(raptor.gun2, "fire1"));
ad += df;
if(raptor.attack_finished_single <= time)
if(raptor.vehicle_energy > autocvar_g_vehicle_raptor_cannon_cost)
{
- raptor_fire_cannon(self.gun1, "fire1");
- raptor_fire_cannon(self.gun2, "fire1");
+ raptor.misc_bulletcounter += 1;
+ if(mod(raptor.misc_bulletcounter, 2))
+ raptor_fire_cannon(self.gun1, "fire1");
+ else
+ raptor_fire_cannon(self.gun2, "fire1");
raptor.vehicle_energy -= autocvar_g_vehicle_raptor_cannon_cost;
raptor.attack_finished_single = time + autocvar_g_vehicle_raptor_cannon_refire;
else
{
player.vehicle_reload1 = min(time / raptor.delay, 1);
- raptor.bomb1.alpha = raptor.bomb2.alpha = player.vehicle_reload1; //(player.vehicle_reload1 == 1 ? 1 : player.vehicle_reload1 * 0.25);
+ //raptor.bomb1.alpha = raptor.bomb2.alpha = player.vehicle_reload1;
}
-
-
VEHICLE_UPDATE_PLAYER(health, raptor);
if(self.vehicle_flags & VHF_HASSHIELD)
}
//FIXME: Camera is in a bad place in HUD model.
- setorigin(self.vehicle_viewport, '10 0 3');
+ setorigin(self.vehicle_viewport, '5 0 5');
self.frame = 0;
self.gun1 = spawn();
self.gun2 = spawn();
- //setattachment(self.vehicle_viewport, world, "");
+#ifdef RAPTOR_RETARDCAMERA
+ setattachment(self.vehicle_viewport, world, "");
+#endif
setmodel(self.bomb1,"models/vehicles/raptor_bomb.dpm");
setmodel(self.bomb2,"models/vehicles/raptor_bomb.dpm");
-const vector spiderbot_MIN = '-75 -75 10';
-const vector spiderbot_MAX = '75 75 110';
+const vector SPIDERBOT_MIN = '-75 -75 10';
+const vector SPIDERBOT_MAX = '75 75 110';
float autocvar_g_vehicle_spiderbot_respawntime;
void spiderbot_rocket_unguided()
{
- vector newdir,olddir;
+ vector newdir, olddir;
self.nextthink = time;
return;
crosshair_trace(self.owner);
-
while(rkt)
{
if(rkt.think == spiderbot_rocket_guided)
rkt.pos1 = trace_endpos;
rkt.think = spiderbot_rocket_unguided;
}
-
rkt = rkt.chain;
}
}
void spiderbot_minigun_fire(entity gun, float trail)
{
vector v;
- entity oldself;
v = gettaginfo(gun, gettagindex(gun,"barrels"));
v_forward = normalize(v_forward);
v += v_forward * 50;
- oldself = self;
- self = self.owner;
fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
- self = oldself;
if(trail)
{
self = spider;
crosshair_trace(player);
- UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
+ //UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
+
+#if VEHICLES_VIEWROTATE_CROSSHAIR
ad = vectoangles(normalize(trace_endpos - gettaginfo(spider.tur_head,gettagindex(spider.tur_head,"tag_hud")))) - (spider.tur_head.angles + spider.angles);
if(ad_x > 180) ad_x -= 360;
if(ad_x < -180) ad_x += 360;
// Pitch head
ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
- ad_x = bound(-ftmp, ad_x, ftmp);
+ //ad_x = bound(-ftmp, ad_x, ftmp);
+ spider.tur_head.angles_x = bound(autocvar_g_vehicle_spiderbot_head_pitchlimit_down, spider.tur_head.angles_x + ad_x, autocvar_g_vehicle_spiderbot_head_pitchlimit_up);
+
+ // Turn Body
+ ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
+ ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
+#else
+
+ player.v_angle_x *= -1;
+ ad = player.v_angle - (spider.tur_head.angles + spider.angles);
+ player.v_angle_x *= -1;
+ if(ad_x > 180) ad_x -= 360;
+ if(ad_x < -180) ad_x += 360;
+ if(ad_y > 180) ad_y -= 360;
+ if(ad_y < -180) ad_y += 360;
+
+ // Rotate head
+ ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
+ ad_y = bound(-ftmp, ad_y, ftmp);
+ spider.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, spider.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit);
+
+ // Pitch head
+ ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
+ ad_x = bound(ftmp * -1, ad_x, ftmp);
spider.tur_head.angles_x = bound(autocvar_g_vehicle_spiderbot_head_pitchlimit_down, spider.tur_head.angles_x + ad_x, autocvar_g_vehicle_spiderbot_head_pitchlimit_up);
// Turn Body
ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
- //fixedmakevectors(self.angles);
- // Not sure why this works better, but it does.
- spider.tur_head.angles_x *= -1;
- spider.angles_x *= -1;
- makevectors(spider.angles);
- spider.tur_head.angles_x *= -1;
- spider.angles_x *= -1;
+
+#endif
+ makevectors(spider.angles + '-1 0 0' * spider.angles_x);
/*
vector ofs;
}
}
- self.angles_x = bound(-60, self.angles_x, 60);
- self.angles_z = bound(-60, self.angles_z, 60);
+ self.angles_x = bound(-45, self.angles_x, 45);
+ self.angles_z = bound(-45, self.angles_z, 45);
spiderbot_miniguns_do();
spiderbot_rocket_do();
else
player.vehicle_reload2 = 1 - ((spider.gun2.cnt - time) / spider.attack_finished_single);
- setorigin(player, spider.origin + '0 0 64');
+ setorigin(player, spider.origin + '0 0 1' * SPIDERBOT_MAX_z);
player.velocity = spider.velocity;
VEHICLE_UPDATE_PLAYER(health, spiderbot);
if(self.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(shield, spiderbot);
+#if 1 // 0 to enable per-gun impact aux crosshairs
// Avarage gun impact point's -> aux cross
vector vf;
ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
-
- /*
+#else
ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
ad = gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 1);
- */
+#endif
self = player;
return 1;
void spiderbot_spawn()
{
- setsize(self, spiderbot_MIN, spiderbot_MAX);
-
self.frame = 5;
self.think = spiderbot_think;
self.nextthink = time;
self.owner = world;
- self.velocity = '0 0 0';
self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
self.event_damage = vehicles_damage;
self.touch = spiderbot_touch;
self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
self.tur_head.angles = '0 0 0';
- self.colormap = 1024;
- self.tur_head.colormap = 1024;
self.deadflag = DEAD_NO;
self.bot_attack = TRUE;
self.flags |= FL_NOTARGET;
setorigin(self, self.pos1 + '0 0 128');
self.angles = self.pos2;
- if (self.team == COLOR_TEAM1)
- self.colormod = '1.4 0.8 0.8';
- else if (self.team == COLOR_TEAM2)
- self.colormod = '0.8 0.8 1.4';
- else
- self.colormod = '0 0 0';
-
- self.tur_head.colormod = self.colormod;
-
vehicles_common_spawn();
}
for(i = 0; i < 5; ++i)
{
- pointparticles(particleeffectnum("rocket_explode"), self.origin + (randomvec() * 100) + '0 0 100', '0 0 0', 1);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin + (randomvec() * 200) + '0 0 100', '0 0 0', 1);
}
entity h, g1, g2, b;
"models/vehicles/spiderbot_cockpit.dpm",
"tag_head", "tag_hud", "",
HUD_SPIDERBOT,
- spiderbot_MIN, spiderbot_MAX,
+ SPIDERBOT_MIN, SPIDERBOT_MAX,
FALSE,
spiderbot_spawn, spiderbot_frame,
spiderbot_enter, spiderbot_exit,
#define VEHICLES_ENABLED
#ifdef VEHICLES_ENABLED
+//#define VEHICLES_VIEWROTATE_CROSSHAIR
+
#message "with tZork vehicles (experimental)"
float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
set g_vehicle_racer_laser_refire 0.1
set g_vehicle_racer_laser_cost 2
-set g_vehicle_racer_rocket_speed 1500
-set g_vehicle_racer_rocket_accel 1500
-set g_vehicle_racer_rocket_turnrate 0.4
+set g_vehicle_racer_rocket_speed 1250
+set g_vehicle_racer_rocket_accel 1000
+set g_vehicle_racer_rocket_turnrate 0.12
set g_vehicle_racer_rocket_damage 120
set g_vehicle_racer_rocket_radius 100
set g_vehicle_racer_rocket_refire 3
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_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_raptor_turnroll 0.1
-set g_vehicle_raptor_turnspeed 90
-set g_vehicle_raptor_pitchspeed 45
-set g_vehicle_raptor_pitchlimit 30
-
-set g_vehicle_raptor_speed_forward 1500
-set g_vehicle_raptor_speed_strafe 1500
-set g_vehicle_raptor_speed_up 1250
-set g_vehicle_raptor_speed_down 1400
-
-set g_vehicle_raptor_bomblets 10
-set g_vehicle_raptor_bomblet_alt 500
+set g_vehicle_raptor_turnspeed 70
+set g_vehicle_raptor_pitchspeed 30
+set g_vehicle_raptor_pitchlimit 35
+
+set g_vehicle_raptor_speed_forward 1000
+set g_vehicle_raptor_speed_strafe 750
+set g_vehicle_raptor_speed_up 600
+set g_vehicle_raptor_speed_down 900
+set g_vehicle_raptor_friction 0.7
+
+set g_vehicle_raptor_bomblets 12
+set g_vehicle_raptor_bomblet_alt 750
set g_vehicle_raptor_bomblet_time 0.5
-set g_vehicle_raptor_bomblet_spread 0.65
+set g_vehicle_raptor_bomblet_spread 0.4
set g_vehicle_raptor_bomblet_damage 35
set g_vehicle_raptor_bomblet_edgedamage 15
set g_vehicle_raptor_bomblet_radius 300
set g_vehicle_raptor_bomblet_force 150
+set g_vehicle_raptor_bomblet_explode_delay 0.25
set g_vehicle_raptor_bombs_refire 5
-set g_vehicle_raptor_guns_turnspeed 48
-set g_vehicle_raptor_guns_turnlimit 16
-set g_vehicle_raptor_guns_pitchlimit_up 8
-set g_vehicle_raptor_guns_pitchlimit_down 48
+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_locktarget 1
set g_vehicle_raptor_cannon_locking_time 0.5
set g_vehicle_raptor_cannon_locked_time 1
set g_vehicle_raptor_cannon_predicttarget 1
-set g_vehicle_raptor_cannon_cost 2
-set g_vehicle_raptor_cannon_damage 20
-set g_vehicle_raptor_cannon_radius 45
-set g_vehicle_raptor_cannon_refire 0.2
-set g_vehicle_raptor_cannon_speed 9000
+set g_vehicle_raptor_cannon_cost 1
+set g_vehicle_raptor_cannon_damage 25
+set g_vehicle_raptor_cannon_radius 50
+set g_vehicle_raptor_cannon_refire 0.075
+set g_vehicle_raptor_cannon_speed 12500
set g_vehicle_raptor_cannon_spread 0.0125
-set g_vehicle_raptor_energy 40
-set g_vehicle_raptor_energy_regen 40
-set g_vehicle_raptor_energy_regen_pause 1
+set g_vehicle_raptor_energy 30
+set g_vehicle_raptor_energy_regen 15
+set g_vehicle_raptor_energy_regen_pause 0.75
set g_vehicle_raptor_health 200
set g_vehicle_raptor_health_regen 0
set g_vehicle_spiderbot_energy_regen 0
set g_vehicle_spiderbot_energy_regen_pause 0
-set g_vehicle_spiderbot_turnspeed 90
+set g_vehicle_spiderbot_turnspeed 180
set g_vehicle_spiderbot_head_turnspeed 120
set g_vehicle_spiderbot_head_turnlimit 120
-set g_vehicle_spiderbot_head_pitchspeed 60
-set g_vehicle_spiderbot_head_pitchlimit_up 16
-set g_vehicle_spiderbot_head_pitchlimit_down -24
+set g_vehicle_spiderbot_head_pitchspeed 70
+set g_vehicle_spiderbot_head_pitchlimit_up 24
+set g_vehicle_spiderbot_head_pitchlimit_down -16
set g_vehicle_spiderbot_speed_stop 50
set g_vehicle_spiderbot_speed_walk 400
set g_vehicle_spiderbot_springblend 0.15
set g_vehicle_spiderbot_rocket_health 100
-set g_vehicle_spiderbot_rocket_damage 75
+set g_vehicle_spiderbot_rocket_damage 50
set g_vehicle_spiderbot_rocket_edgedamage 15
set g_vehicle_spiderbot_rocket_force 150
set g_vehicle_spiderbot_rocket_radius 150
-set g_vehicle_spiderbot_rocket_reload 2.5
-set g_vehicle_spiderbot_rocket_refire 0.15
-set g_vehicle_spiderbot_rocket_speed 900
-set g_vehicle_spiderbot_rocket_turnrate 0.25
-set g_vehicle_spiderbot_rocket_noise 0.25
+set g_vehicle_spiderbot_rocket_reload 3
+set g_vehicle_spiderbot_rocket_refire 0.25
+set g_vehicle_spiderbot_rocket_speed 1500
+set g_vehicle_spiderbot_rocket_turnrate 0.2
+set g_vehicle_spiderbot_rocket_noise 0.3
set g_vehicle_spiderbot_rocket_lifetime 30
set g_vehicle_spiderbot_crush_dmg 50