1 void spawnfunc_turret_hellion();
2 void turret_hellion_dinit();
3 void turret_hellion_attack();
5 void turret_hellion_missile_think()
11 self.nextthink = time + 0.05;
13 olddir = normalize(self.velocity);
15 if(self.tur_health < time)
16 turret_projectile_explode();
18 // Enemy dead? just keep on the current heading then.
19 if ((self.enemy == world) || (self.enemy.deadflag != DEAD_NO))
22 // Make sure we dont return to tracking a respawned player
26 self.angles = vectoangles(self.velocity);
28 if ( (vlen(self.origin - self.owner.origin)) > (self.owner.shot_radius * 5) )
29 turret_projectile_explode();
32 self.velocity = olddir * min(vlen(self.velocity) * autocvar_g_turrets_unit_hellion_std_shot_speed_gain, autocvar_g_turrets_unit_hellion_std_shot_speed_max);
34 UpdateCSQCProjectile(self);
40 if (vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 0.2)
41 turret_projectile_explode();
43 // Predict enemy position
44 itime = vlen(self.enemy.origin - self.origin) / vlen(self.velocity);
45 pre_pos = self.enemy.origin + self.enemy.velocity * itime;
47 pre_pos = (pre_pos + self.enemy.origin) * 0.5;
49 // Find out the direction to that place
50 newdir = normalize(pre_pos - self.origin);
53 newdir = normalize(olddir + newdir * 0.35);
56 self.angles = vectoangles(self.velocity);
59 self.velocity = newdir * min(vlen(self.velocity) * autocvar_g_turrets_unit_hellion_std_shot_speed_gain, autocvar_g_turrets_unit_hellion_std_shot_speed_max);
62 self.think = turret_projectile_explode;
64 UpdateCSQCProjectile(self);
66 void turret_hellion_attack()
70 if(self.tur_head.frame != 0)
71 self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
73 self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
75 missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
76 te_explosion (missile.origin);
77 missile.think = turret_hellion_missile_think;
78 missile.nextthink = time;
79 missile.flags = FL_PROJECTILE;
80 missile.tur_health = time + 9;
81 missile.tur_aimpos = randomvec() * 128;
82 missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
83 self.tur_head.frame += 1;
86 void turret_hellion_postthink()
88 if (self.tur_head.frame != 0)
89 self.tur_head.frame += 1;
91 if (self.tur_head.frame >= 7)
92 self.tur_head.frame = 0;
95 void turret_hellion_dinit()
97 if (self.netname == "") self.netname = "Hellion Missile Turret";
99 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_FASTPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
100 self.aim_flags = TFL_AIM_SIMPLE;
101 self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK ;
102 self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_TEAMCECK | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF | TFL_FIRECHECK_OWM_AMMO;
103 self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
105 if (turret_stdproc_init("hellion_std", "models/turrets/base.md3", "models/turrets/hellion.md3", TID_HELLION) == 0)
111 self.turret_firefunc = turret_hellion_attack;
112 self.turret_postthink = turret_hellion_postthink;
115 /*QUAKED turret_hellion (0 .5 .8) ?
117 void spawnfunc_turret_hellion()
119 precache_model ("models/turrets/hellion.md3");
120 precache_model ("models/turrets/base.md3");
122 self.think = turret_hellion_dinit;
123 self.nextthink = time + 0.5;