set g_ballistics_materialconstant 1414213562
set g_ballistics_mindistance 16
+set g_ballistics_density_player 0.50 // players are 2x as easy to pass as walls
+set g_ballistics_density_corpse 0.10 // corpses are 10x as easy to pass as walls
// unit: qJ / qu^3 (energy needed per volume unit of solid to push/burn away
// parameter: bullet constant: mass / area in g/qu^2
// = mass / (pi/4 * caliber^2)
self.movetype = MOVETYPE_TOSS;
// shootable corpse
self.solid = SOLID_CORPSE;
+ self.ballistics_density = cvar("g_ballistics_density_corpse");
// don't stick to the floor
self.flags &~= FL_ONGROUND;
// dying animation
void W_BallisticBullet_Touch (void)
{
+ float density;
+
if(self.think == W_BallisticBullet_LeaveSolid_think) // skip this!
return;
PROJECTILE_TOUCH;
W_BallisticBullet_Hit ();
+ density = other.ballistics_density;
+ if(density == 0)
+ density = 1;
+
// go through solid!
- if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius))
+ if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius * density))
{
remove(self);
return;
void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
{
- float lag, dt, savetime;
+ float lag, dt, savetime, density;
entity pl, oldself;
entity proj;
W_BallisticBullet_Hit();
}
+ density = other.ballistics_density;
+ if(density == 0)
+ density = 1;
+
// go through solid!
- if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius))
+ if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius * density))
break;
W_BallisticBullet_LeaveSolid_think();