24 actor.tur_head = actor;
28 te_explosion (missile.origin);
31 missile.nextthink =
time + 0.25;
33 missile.velocity = actor.tur_shotdir_updated * (actor.shot_speed * 0.75);
35 missile.cnt =
time + 30;
39 if (actor.tur_head.frame == 0)
40 actor.tur_head.frame = actor.tur_head.frame + 1;
47 vector vu, vd, vf, vl, vr, ve;
48 float fu, fd, ff, fl, fr, fe;
49 vector olddir,wishdir,newdir;
69 if(
vdist(it.origin, >, 5000))
80 this.angles_x = this.angles_x * -1;
82 this.angles_x = this.angles_x * -1;
87 if(
vdist(this.
origin - this.
enemy.origin, <=, (
this.owner.shot_radius * 0.25)))
113 lt_for = myspeed * 3;
114 lt_seek = myspeed * 2.95;
134 pt_seek =
bound(0.15,pt_seek,0.8);
135 if (ff < 0.5) pt_seek = 1;
166 if (fl > fr) wishdir = -1 *
v_right;
167 if (fu > fl) wishdir =
v_up;
168 if (fd > fu) wishdir = -1 *
v_up;
173 wishdir =
normalize( (vl * fl) + (vr * fr) + (vu * fu) + (vd * fd) );
178 if (fe < 0.1) fe = 0.1;
179 wishdir = (wishdir * (1 - fe)) + (ve * fe);
215#ifdef TURRET_DEBUG_HK
232 this.atime =
time + 0.2;
259 if (this.target_select_playerbias < 0)
267 if ((targ.flags &
FL_PROJECTILE) && (
this.target_select_missilebias < 0))
271 if ((targ.team ==
this.team) || (
this.team == targ.owner.team))
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)