float autocvar_g_vehicles_crush_force;
float autocvar_g_vehicles_delayspawn;
float autocvar_g_vehicles_delayspawn_jitter;
+float autocvar_g_vehicles_allow_flagcarry;
void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
void vehicles_return();
// Colided with world?
if(other == world)
{
- // Apply velocity based self damage here
}
else
{
if(other.flagcarried)
{
- other.flagcarried.scale = 1;
- setattachment(other.flagcarried, self, "");
- setorigin(other, '0 0 96');
+ if(!autocvar_g_vehicles_allow_flagcarry)
+ DropFlag(other.flagcarried, world, world);
+ else
+ {
+ other.flagcarried.scale = 1;
+ setattachment(other.flagcarried, self, "");
+ setorigin(other, '0 0 96');
+ }
}
self.vehicle_enter();
**/
void vehicles_exit(float eject)
{
+ entity oldself;
+ if(self.flags & FL_CLIENT)
+ {
+ oldself = self;
+ self = self.vehicle;
+ }
+
self.flags |= FL_NOTARGET;
if (self.owner)
setorigin(self.owner.flagcarried, FLAG_CARRY_POS);
}
+ sound (self, CHAN_TRIGGER, "misc/null.wav", 1, ATTN_NORM);
self.vehicle_exit(eject);
self.owner = world;
+
+ if(oldself)
+ self = oldself;
}
}
}
+void vehicles_painframe()
+{
+//.float pain_finished; //Added by Supajoe
+
+ if(self.owner.vehicle_health <= 50)
+ if(self.pain_frame < time)
+ {
+ float _ftmp;
+ _ftmp = self.owner.vehicle_health / 50;
+ self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
+ pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+
+ if(self.vehicle_flags & VHF_DMGSHAKE)
+ self.velocity += randomvec() * 30;
+
+ if(self.vehicle_flags & VHF_DMGROLL)
+ if(self.vehicle_flags & VHF_DMGHEADROLL)
+ self.tur_head.angles += randomvec();
+ else
+ self.angles += randomvec();
+
+ }
+}
+
void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
self.dmg_time = time;
void vehicles_showwp()
{
entity oldself;
+ vector rgb;
if(self.cnt)
{
self.think = vehicles_showwp_goaway;
}
- WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE);
+ if(teamplay && self.team)
+ rgb = TeamColor(self.team);
+ else
+ rgb = '1 1 1';
+ WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
if(self.waypointsprite_attached)
- {
-
- if(teamplay && self.team)
- WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, TeamColor(self.team));
- else
- WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, '1 1 1');
-
+ {
WaypointSprite_UpdateRule(self.waypointsprite_attached, self.enemy.team, SPRITERULE_DEFAULT);
if(oldself == world)
- {
WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);
- dprint("Oldies is goldies\n");
- }
-
WaypointSprite_Ping(self.waypointsprite_attached);
}
{
if(e != self.vehicle_shieldent)
{
- e.effects = _effects | EF_LOWPRECISION;
+ e.effects = _effects; // | EF_LOWPRECISION;
e.colormod = _colormod;
e.colormap = _colormap;
e.alpha = 1;
e = e.chain;
}
- self.vehicle_hudmodel.effects = self.effects = _effects | EF_LOWPRECISION;
+ self.vehicle_hudmodel.effects = self.effects = _effects; // | EF_LOWPRECISION;
self.vehicle_hudmodel.colormod = self.colormod = _colormod;
self.vehicle_hudmodel.colormap = self.colormap = _colormap;
self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
self.team = 0;
self.vehicle_flags |= VHF_ISVEHICLE;
-
+
setmodel(self, bodymodel);
self.vehicle_viewport = spawn();