5 float autocvar_g_turrets_unit_hk_shot_speed;
6 float autocvar_g_turrets_unit_hk_shot_speed_accel;
7 float autocvar_g_turrets_unit_hk_shot_speed_accel2;
8 float autocvar_g_turrets_unit_hk_shot_speed_decel;
9 float autocvar_g_turrets_unit_hk_shot_speed_max;
10 float autocvar_g_turrets_unit_hk_shot_speed_turnrate;
12 void turret_hk_missile_think(
entity this);
20 turret_initparams(actor);
24 actor.tur_head = actor;
28 te_explosion (missile.origin);
30 setthink(missile, turret_hk_missile_think);
31 missile.nextthink =
time + 0.25;
33 missile.velocity = actor.tur_shotdir_updated * (actor.shot_speed * 0.75);
35 missile.cnt =
time + 30;
40 if (actor.tur_head.frame == 0)
41 actor.tur_head.frame = actor.tur_head.frame + 1;
46 void turret_hk_missile_think(
entity this)
48 vector vu, vd, vf, vl, vr, ve;
49 float fu, fd, ff, fl, fr, fe;
50 vector olddir,wishdir,newdir;
70 if(
vdist(it.origin, >, 5000))
81 this.angles_x = this.angles_x * -1;
83 this.angles_x = this.angles_x * -1;
88 if(
vdist(this.
origin - this.
enemy.origin, <=, (
this.owner.shot_radius * 0.25)))
114 lt_for = myspeed * 3;
115 lt_seek = myspeed * 2.95;
126 if ( ((ff < 0.7) || (ad > 4)) && (myspeed > (autocvar_g_turrets_unit_hk_shot_speed)) )
127 myspeed =
max(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_decel), (autocvar_g_turrets_unit_hk_shot_speed));
130 if ( (ff > 0.7) && (myspeed < (autocvar_g_turrets_unit_hk_shot_speed_max)) )
131 myspeed =
min(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_accel), (autocvar_g_turrets_unit_hk_shot_speed_max));
135 pt_seek =
bound(0.15,pt_seek,0.8);
136 if (ff < 0.5) pt_seek = 1;
167 if (fl > fr) wishdir = -1 *
v_right;
168 if (fu > fl) wishdir =
v_up;
169 if (fd > fu) wishdir = -1 *
v_up;
174 wishdir =
normalize( (vl * fl) + (vr * fr) + (vu * fu) + (vd * fd) );
179 if (fe < 0.1) fe = 0.1;
180 wishdir = (wishdir * (1 - fe)) + (ve * fe);
187 if (myspeed < (autocvar_g_turrets_unit_hk_shot_speed_max))
188 myspeed =
min(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_accel2),(autocvar_g_turrets_unit_hk_shot_speed_max));
193 if ((myspeed > (autocvar_g_turrets_unit_hk_shot_speed)) && (this.
cnt >
time))
194 myspeed =
min(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_accel2),(autocvar_g_turrets_unit_hk_shot_speed_max));
207 newdir =
normalize(olddir + wishdir * (autocvar_g_turrets_unit_hk_shot_speed_turnrate));
216 #ifdef TURRET_DEBUG_HK 233 this.atime =
time + 0.2;
260 if (this.target_select_playerbias < 0)
268 if ((targ.flags & FL_PROJECTILE) && (
this.target_select_missilebias < 0))
272 if ((targ.team ==
this.team) || (
this.team == targ.owner.team))
#define WEP_CVAR_PRI(wepname, name)
#define IL_EACH(this, cond, body)
IntrusiveList g_damagedbycontents
float autocvar_sys_ticrate
float MOVETYPE_BOUNCEMISSILE
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
string W_Sound(string w_snd)
#define METHOD(cname, name, prototype)
void turret_projectile_explode(entity this)
void UpdateCSQCProjectile(entity e)
const int PROJECTILE_ROCKET
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim)
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#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)
#define SOUND(name, path)
void set_movetype(entity this, int mt)