- return 1;
-}
-
-void W_BallisticBullet_Touch (void)
-{
- //float density;
-
- if(self.think == W_BallisticBullet_LeaveSolid_think) // skip this!
- return;
-
- PROJECTILE_TOUCH;
- W_BallisticBullet_Hit ();
-
- if(self.dmg_radius < 0) // these NEVER penetrate solid
- {
- remove(self);
- return;
- }
-
- // if we hit "weapclip", bail out
- //
- // rationale of this check:
- //
- // any shader that is solid, nodraw AND trans is meant to clip weapon
- // shots and players, but has no other effect!
- //
- // if it is not trans, it is caulk and should not have this side effect
- //
- // matching shaders:
- // common/weapclip (intended)
- // common/noimpact (is supposed to eat projectiles, but is erased farther above)
- if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
- if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)
- if not(trace_dphitcontents & DPCONTENTS_OPAQUE)
- {
- remove(self);
- return;
- }
-
- // go through solid!
- if(!W_BallisticBullet_LeaveSolid(-1))
- {
- remove(self);
- return;
- }
-
- self.projectiledeathtype |= HITTYPE_BOUNCE;
-}
-
-void endFireBallisticBullet()
-{
- endzcurveparticles();
-}
-
-entity fireBallisticBullet_trace_callback_ent;
-float fireBallisticBullet_trace_callback_eff;
-void fireBallisticBullet_trace_callback(vector start, vector hit, vector end)
-{
- if(vlen(trace_endpos - fireBallisticBullet_trace_callback_ent.origin) > 16)
- zcurveparticles_from_tracetoss(fireBallisticBullet_trace_callback_eff, fireBallisticBullet_trace_callback_ent.origin, trace_endpos, fireBallisticBullet_trace_callback_ent.velocity);
- WarpZone_trace_forent = world;
- self.owner = world;
-}
-
-void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
-{
- float lag, dt, savetime; //, density;
- entity pl, oldself;
- float antilagging;
-
- antilagging = (autocvar_g_antilag_bullets && (pSpeed >= autocvar_g_antilag_bullets));
-
- entity proj;
- proj = spawn();
- proj.classname = "bullet";
- proj.owner = proj.realowner = self;
- PROJECTILE_MAKETRIGGER(proj);
- if(gravityfactor > 0)
- {
- proj.movetype = MOVETYPE_TOSS;
- proj.gravity = gravityfactor;
- }
- else
- proj.movetype = MOVETYPE_FLY;
- proj.think = SUB_Remove;
- proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed);
- W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, antilagging);
- proj.angles = vectoangles(proj.velocity);
- if(bulletconstant > 0)
- proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant;
- else if(bulletconstant == 0)
- proj.dmg_radius = 0;
- else
- proj.dmg_radius = -1;
- // so: bulletconstant = bullet mass / area of bullet circle
- setorigin(proj, start);
- proj.flags = FL_PROJECTILE;
-
- proj.touch = W_BallisticBullet_Touch;
- proj.dmg = damage;
- proj.dmg_force = force;
- proj.projectiledeathtype = dtype;
-
- proj.oldvelocity = proj.velocity;
-
- other = proj; MUTATOR_CALLHOOK(EditProjectile);