#include "tracing.qh"
-#include "../_all.qh"
#include "accuracy.qh"
#include "common.qh"
#include "hitplot.qh"
+#include "weaponsystem.qh"
#include "../g_damage.qh"
#include "../g_subs.qh"
#include "../../common/weapons/all.qh"
-#include "../../warpzonelib/common.qh"
+#include "../../lib/warpzone/common.qh"
// this function calculates w_shotorg and w_shotdir based on the weapon model
// offset, trueaim and antilag, and won't put w_shotorg inside a wall.
if (trace_ent == ent.cursor_trace_ent)
w_shotdir = normalize(ent.cursor_trace_ent.origin - w_shotorg);
else
- print("antilag fail\n");
+ LOG_INFO("antilag fail\n");
}
}
}
if (snd != "")
{
- sound (ent, chan, snd, VOL_BASE, ATTN_NORM);
+ _sound (ent, chan, snd, VOL_BASE, ATTN_NORM);
W_PlayStrengthSound(ent);
}
#if 0
mspercallsum += gettime(GETTIME_HIRES);
mspercallcount += 1;
- print("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n");
+ LOG_INFO("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n");
#endif
proj.velocity = W_CalculateProjectileVelocity(proj.owner.velocity, pSpeed * dir, forceAbsolute);
// ====================
void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype)
-{
+{SELFPARAM();
vector hitloc, force, endpoint, dir;
entity ent, endent;
float endq3surfaceflags;
if(f <= 0)
continue;
- snd = strcat("weapons/nexwhoosh", ftos(floor(random() * 3) + 1), ".wav");
+ snd = SND(NEXWHOOSH_RANDOM());
if(!pseudoprojectile)
pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
}
void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
-{
+{SELFPARAM();
vector end;
dir = normalize(dir + randomvec() * spread);
float total_damage = 0;
if(tracereffects & EF_RED)
- fireBullet_trace_callback_eff = particleeffectnum("tr_rifle");
+ fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE);
else if(tracereffects & EF_BLUE)
- fireBullet_trace_callback_eff = particleeffectnum("tr_rifle_weak");
+ fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE_WEAK);
else
- fireBullet_trace_callback_eff = particleeffectnum("tr_bullet");
+ fireBullet_trace_callback_eff = particleeffectnum(EFFECT_BULLET);
float lag = ANTILAG_LATENCY(self);
if(lag < 0.001)
{
fireBullet_last_hit = hit;
yoda = 0;
+ MUTATOR_CALLHOOK(FireBullet_Hit, self, hit, start, end, damage);
+ damage = frag_damage;
float g = accuracy_isgooddamage(self, hit);
Damage(hit, self, self, damage * solid_penetration_left, dtype, start, force * dir * solid_penetration_left);
// calculate hits for ballistic weapons