4 /* TUR_##id */ HELLION,
5 /* function */ t_hellion,
6 /* spawnflags */ TUR_FLAG_SPLASH | TUR_FLAG_FASTPROJ | TUR_FLAG_PLAYER | TUR_FLAG_MISSILE,
7 /* mins,maxs */ '-32 -32 0', '32 32 64',
8 /* model */ "base.md3",
9 /* head_model */ "hellion.md3",
10 /* netname */ "hellion",
11 /* fullname */ _("Hellion Missile Turret")
17 float autocvar_g_turrets_unit_hellion_shot_speed_gain;
18 float autocvar_g_turrets_unit_hellion_shot_speed_max;
20 void turret_hellion_missile_think()
26 self.nextthink = time + 0.05;
28 olddir = normalize(self.velocity);
30 if(self.max_health < time)
31 turret_projectile_explode();
33 // Enemy dead? just keep on the current heading then.
34 if ((self.enemy == world) || (self.enemy.deadflag != DEAD_NO))
37 // Make sure we dont return to tracking a respawned player
41 self.angles = vectoangles(self.velocity);
43 if ( (vlen(self.origin - self.owner.origin)) > (self.owner.shot_radius * 5) )
44 turret_projectile_explode();
47 self.velocity = olddir * min(vlen(self.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max));
49 UpdateCSQCProjectile(self);
55 if (vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 0.2)
56 turret_projectile_explode();
58 // Predict enemy position
59 itime = vlen(self.enemy.origin - self.origin) / vlen(self.velocity);
60 pre_pos = self.enemy.origin + self.enemy.velocity * itime;
62 pre_pos = (pre_pos + self.enemy.origin) * 0.5;
64 // Find out the direction to that place
65 newdir = normalize(pre_pos - self.origin);
68 newdir = normalize(olddir + newdir * 0.35);
71 self.angles = vectoangles(self.velocity);
74 self.velocity = newdir * min(vlen(self.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max));
77 self.think = turret_projectile_explode;
79 UpdateCSQCProjectile(self);
82 void spawnfunc_turret_hellion() { SELFPARAM(); if(!turret_initialize(TUR_HELLION.m_id)) remove(self); }
84 float t_hellion(float req)
92 if(self.tur_head.frame != 0)
93 self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
95 self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
97 missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
98 te_explosion (missile.origin);
99 missile.think = turret_hellion_missile_think;
100 missile.nextthink = time;
101 missile.flags = FL_PROJECTILE;
102 missile.max_health = time + 9;
103 missile.tur_aimpos = randomvec() * 128;
104 missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
105 self.tur_head.frame += 1;
111 if (self.tur_head.frame != 0)
112 self.tur_head.frame += 1;
114 if (self.tur_head.frame >= 7)
115 self.tur_head.frame = 0;
125 self.aim_flags = TFL_AIM_SIMPLE;
126 self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK ;
127 self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_TEAMCHECK | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF | TFL_FIRECHECK_AMMO_OWN;
128 self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
143 float t_hellion(float req)
161 #endif // REGISTER_TURRET