26 actor.tur_head = actor;
30 te_explosion(missile.origin);
33 missile.nextthink =
time + 0.25;
35 missile.velocity = actor.tur_shotdir_updated * (actor.shot_speed * 0.75);
37 missile.cnt =
time + 30;
41 && actor.tur_head.frame == 0)
42 ++actor.tur_head.frame;
49 vector vu, vd, vf, vl, vr, ve;
50 float fu, fd, ff, fl, fr, fe;
51 vector olddir, wishdir, newdir;
71 if (
vdist(it.origin, >, 5000))
89 if (
vdist(this.
origin - this.
enemy.origin, <=, (
this.owner.shot_radius * 0.25)))
113 lt_for = myspeed * 3;
114 lt_seek = myspeed * 2.95;
125 if ((ff < 0.7 || ad > 4)
135 pt_seek =
bound(0.15, 1 - ff, 0.8);
168 if (fl > fr) wishdir = -
v_right;
169 if (fu > fl) wishdir =
v_up;
170 if (fd > fu) wishdir = -
v_up;
175 wishdir =
normalize((vl * fl) + (vr * fr) + (vu * fu) + (vd * fd));
182 wishdir = wishdir * (1 - fe) + (ve * fe);
218#ifdef TURRET_DEBUG_HK
234 this.atime =
time + 0.2;
255 if (this.target_select_playerbias < 0)
262 if ((targ.flags &
FL_PROJECTILE) &&
this.target_select_missilebias < 0)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void UpdateCSQCProjectile(entity e)
IntrusiveList g_damagedbycontents
void turret_hk_missile_think(entity this)
float autocvar_g_turrets_unit_hk_shot_speed_decel
float autocvar_g_turrets_unit_hk_shot_speed_accel2
float autocvar_g_turrets_unit_hk_shot_speed_turnrate
float autocvar_g_turrets_unit_hk_shot_speed_accel
float autocvar_g_turrets_unit_hk_shot_speed_max
float autocvar_g_turrets_unit_hk_shot_speed
bool hk_is_valid_target(entity this, entity proj, entity targ)
#define IL_EACH(this, cond, body)
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCEMISSILE
const int MOVETYPE_BOUNCE
#define METHOD(cname, name, prototype)
const int PROJECTILE_ROCKET
string W_Sound(string w_snd)
#define SOUND(name, path)
entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim)
void turret_initparams(entity tur)
void turret_projectile_explode(entity this)
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)