entity axh;
axh_id = bound(0, axh_id, MAX_AXH);
- axh = own.AuxiliaryXhair[axh_id];
+ axh = own.(AuxiliaryXhair[axh_id]);
if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
{
setorigin(axh, loc);
axh.colormod = clr;
axh.SendFlags = 0x01;
- own.AuxiliaryXhair[axh_id] = axh;
+ own.(AuxiliaryXhair[axh_id]) = axh;
}
/*
proj.flags = FL_PROJECTILE | FL_NOTARGET;
if(_mzlsound)
- sound (self, CHAN_WEAPON, _mzlsound, VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTN_NORM);
if(_mzlfx)
pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
self.touch = vehicles_touch;
self.event_damage = vehicles_damage;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
return FALSE;
}
+void vehilces_impact(float _minspeed, float _speedfac, float _maxpain)
+{
+ if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
+ return;
+
+ if(self.play_time < time)
+ {
+ float wc = vlen(self.velocity - self.oldvelocity);
+ //dprint("oldvel: ", vtos(self.oldvelocity), "\n");
+ //dprint("vel: ", vtos(self.velocity), "\n");
+ if(_minspeed < wc)
+ {
+ float take = take = min(_speedfac * wc, _maxpain);
+ Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
+ self.play_time = time + 0.25;
+
+ //dprint("wc: ", ftos(wc), "\n");
+ //dprint("take: ", ftos(take), "\n");
+ }
+ }
+}
+
+.void() vehicle_impact;
void vehicles_touch()
{
// Vehicle currently in use
if(self.owner)
{
- // Colided with world?
- if(other == world)
- {
- }
- else
+ if(other != world)
+ if(vehicles_crushable(other))
{
- if(other.vehicle_flags & VHF_ISVEHICLE)
- {
- //other.velocity += self.velocity * (self.mass / other.mass);
- }
- else if(vehicles_crushable(other))
- {
- if(vlen(self.velocity) != 0)
- Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VHCRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
- }
+ if(vlen(self.velocity) != 0)
+ Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VHCRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
+
+ return; // Dont do selfdamage when hitting "soft targets".
}
+
+ if(self.play_time < time)
+ if(self.vehicle_impact)
+ self.vehicle_impact();
+
return;
}
if(self.team)
if(self.team != other.team)
return;
+
+ RemoveGrapplingHook(other);
self.vehicle_ammo1 = 0;
self.vehicle_ammo2 = 0;
if(!teamplay)
self.team = 0;
-
+ else
+ self.team = self.tur_head.team;
+
if(self.owner.flagcarried)
{
self.owner.flagcarried.scale = 0.6;
setorigin(self.owner.flagcarried, FLAG_CARRY_POS);
}
- sound (self, CHAN_TRIGGER, "misc/null.wav", 1, ATTN_NORM);
+ sound (self, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTN_NORM);
self.vehicle_exit(eject);
self.owner = world;
+ vehicles_reset_colors();
if(oldself)
self = oldself;
self.vehicle_shieldent.alpha = 0.75;
if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CHAN_PROJECTILE, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
+ spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
}
else
if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CHAN_PROJECTILE, "onslaught/electricity_explode.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
+ spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
}
else
self.vehicle_health -= damage;
if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CHAN_PROJECTILE, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
+ spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM); // FIXME: PLACEHOLDER
}
self.velocity += force; // * (vlen(force) / self.mass);
ret.classname = "vehicle_return";
ret.enemy = self;
ret.team = self.team;
- ret.think = vehicles_showwp;
+ ret.think = vehicles_showwp;
if(self.deadflag != DEAD_NO)
{
{
ret.nextthink = min(time + self.vehicle_respawntime, time + self.vehicle_respawntime - 1);
}
-
-
setmodel(ret, "null");
setorigin(ret, self.pos1 + '0 0 96');
if(self.team && !teamplay)
self.team = 0;
-
+
self.vehicle_flags |= VHF_ISVEHICLE;
setmodel(self, bodymodel);
self.takedamage = DAMAGE_AIM;
self.bot_attack = TRUE;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
self.hud = vhud;
self.vehicle_die = dieproc;
self.pos1 = self.origin;
self.pos2 = self.angles;
-
+ self.tur_head.team = self.team;
+
return TRUE;
}