self.velocity_z *= 1 - (autocvar_g_vehicle_racer_upforcedamper * frametime);
self.velocity += v_add;
- self.velocity_z -= autocvar_sv_gravity * frametime;
+ //self.velocity_z -= autocvar_sv_gravity * frametime;
push_vector_x = (fl_push - bl_push);
push_vector_x += (fr_push - br_push);
void racer_think()
{
- float a, b, c;
-
- a = autocvar_g_vehicle_racer_anglestabilizer;
+ /*
+ float a, b, c;a = autocvar_g_vehicle_racer_anglestabilizer;
b = autocvar_g_vehicle_racer_springlength;
c = autocvar_g_vehicle_racer_hoverpower;
autocvar_g_vehicle_racer_anglestabilizer = 36;
autocvar_g_vehicle_racer_springlength = 96;
autocvar_g_vehicle_racer_hoverpower = 300;
+ */
racer_align4point(); //time - self.nextthink);
+ /*
//if(self.velocity_z > 0)
// self.velocity_z *= 0.95;
autocvar_g_vehicle_racer_anglestabilizer = a;
autocvar_g_vehicle_racer_springlength = b;
autocvar_g_vehicle_racer_hoverpower = c;
+ */
- self.velocity_x *= 0.95;
- self.velocity_y *= 0.95;
-
+ self.velocity_x *= 0.9;
+ self.velocity_y *= 0.9;
+ self.velocity_z *= 0.8;
+ self.velocity_z += sin(time * 2) * 16;
self.nextthink = time + 0.05;
}
{
self.think = racer_think;
self.nextthink = time;
- self.movetype = MOVETYPE_BOUNCEMISSILE;
+ self.movetype = MOVETYPE_TOSS;
if not (self.owner)
return;
void racer_blowup()
{
-
sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
self.avelocity_z = -16;
self.avelocity_x = -vlen(self.velocity) * 0.2;
- self.velocity += '0 0 700';
- self.colormod = '-0.5 -0.5 -0.5';
+ self.velocity += '0 0 700';
+ self.colormod = '-0.5 -0.5 -0.5';
self.think = racer_blowup;
self.nextthink = 2 + time + random() * 3;
// FIXME: this be hakkz, fix the models insted (scale body, add tag_viewport to the hudmodel).
self.scale = 0.5;
- setattachment(self.vehicle_hudmodel, self, "");
- setattachment(self.vehicle_viewport, self, "tag_viewport");
+ //setattachment(self.vehicle_hudmodel, self, "");
+ //setattachment(self.vehicle_viewport, self, "tag_viewport");
self.mass = 900;
}
if(self.cnt > time)
if(autocvar_g_vehicle_raptor_bomblet_alt)
{
+ UpdateCSQCProjectile(self);
self.nextthink = time;
traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
if(trace_fraction == 1.0)
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.movetype = bomb_2.movetype = MOVETYPE_BOUNCE;
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;
self.solid = SOLID_BBOX;
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;
+
+ self.velocity_z = 1; // Nudge upwards to takeoff sequense can work.
#ifdef RAPTOR_RETARDCAMERA
setorigin(self.vehicle_viewport, self.origin);
remove(self);
return;
}
+
//FIXME: Camera is in a bad place in HUD model.
- setorigin(self.vehicle_viewport, '25 0 5');
+ //setorigin(self.vehicle_viewport, '25 0 5');
self.frame = 0;
self.angles = self.bomb1.angles;
self.bomb1.angles = '0 0 0';
-
spinner = spawn();
spinner.owner = self;
setmodel(spinner,"models/vehicles/spinner.dpm");
self.owner.vehicle_reload1 = self.vehicle_reload1;
self.owner.vehicle_reload2 = self.vehicle_reload2;
+ // Cnnt do this, hides attached objects too.
+ //self.exteriormodeltoclient = self.owner;
+ //self.tur_head.exteriormodeltoclient = self.owner;
+
other.flags &~= FL_ONGROUND;
self.flags &~= FL_ONGROUND;
WriteByte (MSG_ONE, SVC_SETVIEWPORT);
WriteEntity(MSG_ONE, self.vehicle_viewport);
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
if(self.tur_head)
{
- WriteAngle(MSG_ONE, self.tur_head.angles_x + self.angles_x); // tilt
- WriteAngle(MSG_ONE, self.tur_head.angles_y + self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
+ WriteAngle(MSG_ONE, self.tur_head.angles_x + self.angles_x); // tilt
+ WriteAngle(MSG_ONE, self.tur_head.angles_y + self.angles_y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
}
else
{
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, self.angles_x * -1); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+ WriteAngle(MSG_ONE, self.angles_x * -1); // tilt
+ WriteAngle(MSG_ONE, self.angles_y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
}
vehicles_clearrturn();
self.alpha -= 0.1;
if (self.alpha <= 0)
{
- setmodel(self, "");
+ //setmodel(self, "");
self.alpha = -1;
}
else
void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- float ddmg_take;
-
self.dmg_time = time;
if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
{
- if (wasfreed(self.tur_head.enemy) || self.tur_head.enemy == world)
+ if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world)
{
- self.tur_head.enemy = spawn();
- self.tur_head.enemy.effects = EF_LOWPRECISION;
+ self.vehicle_shieldent = spawn();
+ self.vehicle_shieldent.effects = EF_LOWPRECISION;
+
+ setmodel(self.vehicle_shieldent, "models/vhshield.md3");
+ setattachment(self.vehicle_shieldent, self, "");
+ setorigin(self.vehicle_shieldent, real_origin(self) - self.origin);
+ self.vehicle_shieldent.scale = 256 / vlen(self.maxs - self.mins);
+ self.vehicle_shieldent.think = shieldhit_think;
}
- setmodel(self.tur_head.enemy, "models/vhshield.md3");
- setattachment(self.tur_head.enemy, self, "");
- 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.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
- self.tur_head.enemy.think = shieldhit_think;
- self.tur_head.enemy.nextthink = time;
+ self.vehicle_shieldent.colormod = '1 1 1';
+ self.vehicle_shieldent.alpha = 0.45;
+ self.vehicle_shieldent.angles = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
+ self.vehicle_shieldent.nextthink = time;
self.vehicle_shield -= damage;
+
if(self.vehicle_shield < 0)
{
- 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;
- self.vehicle_health -= ddmg_take;
+ self.vehicle_shieldent.colormod = '2 0 0';
+ self.vehicle_shield = 0;
+ self.vehicle_shieldent.alpha = 0.75;
+ self.vehicle_health -= fabs(self.vehicle_shield);
}
}
else
e = findchainentity(tag_entity, self);
while(e)
{
- e.effects = _effects;
- e.colormod = _colormod;
- e.colormap = _colormap;
- e.alpha = 1;
-
+ if(e != self.vehicle_shieldent)
+ {
+ e.effects = _effects;
+ e.colormod = _colormod;
+ e.colormap = _colormap;
+ e.alpha = 1;
+ }
e = e.chain;
}
-
self.vehicle_hudmodel.effects = self.effects = _effects;
self.vehicle_hudmodel.colormod = self.colormod = _colormod;
self.vehicle_hudmodel.colormap = self.colormap = _colormap;