3 /* TUR_##id */ HELLION,
4 /* function */ t_hellion,
5 /* spawnflags */ TUR_FLAG_SPLASH | TUR_FLAG_FASTPROJ | TUR_FLAG_PLAYER | TUR_FLAG_MISSILE,
6 /* mins,maxs */ '-32 -32 0', '32 32 64',
7 /* model */ "base.md3",
8 /* head_model */ "hellion.md3",
9 /* netname */ "hellion",
10 /* fullname */ _("Hellion Missile Turret")
13 #define HELLION_SETTINGS(turret) \
14 TUR_ADD_CVAR(turret, shot_speed_gain) \
15 TUR_ADD_CVAR(turret, shot_speed_max)
19 HELLION_SETTINGS(hellion)
24 void turret_hellion_missile_think()
30 self.nextthink = time + 0.05;
32 olddir = normalize(self.velocity);
34 if(self.max_health < time)
35 turret_projectile_explode();
37 // Enemy dead? just keep on the current heading then.
38 if ((self.enemy == world) || (self.enemy.deadflag != DEAD_NO))
41 // Make sure we dont return to tracking a respawned player
45 self.angles = vectoangles(self.velocity);
47 if ( (vlen(self.origin - self.owner.origin)) > (self.owner.shot_radius * 5) )
48 turret_projectile_explode();
51 self.velocity = olddir * min(vlen(self.velocity) * TUR_CVAR(hellion, shot_speed_gain), TUR_CVAR(hellion, shot_speed_max));
53 UpdateCSQCProjectile(self);
59 if (vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 0.2)
60 turret_projectile_explode();
62 // Predict enemy position
63 itime = vlen(self.enemy.origin - self.origin) / vlen(self.velocity);
64 pre_pos = self.enemy.origin + self.enemy.velocity * itime;
66 pre_pos = (pre_pos + self.enemy.origin) * 0.5;
68 // Find out the direction to that place
69 newdir = normalize(pre_pos - self.origin);
72 newdir = normalize(olddir + newdir * 0.35);
75 self.angles = vectoangles(self.velocity);
78 self.velocity = newdir * min(vlen(self.velocity) * TUR_CVAR(hellion, shot_speed_gain), TUR_CVAR(hellion, shot_speed_max));
81 self.think = turret_projectile_explode;
83 UpdateCSQCProjectile(self);
86 void spawnfunc_turret_hellion() { if not(turret_initialize(TUR_HELLION)) remove(self); }
88 float t_hellion(float req)
96 if(self.tur_head.frame != 0)
97 self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
99 self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
101 missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
102 te_explosion (missile.origin);
103 missile.think = turret_hellion_missile_think;
104 missile.nextthink = time;
105 missile.flags = FL_PROJECTILE;
106 missile.max_health = time + 9;
107 missile.tur_aimpos = randomvec() * 128;
108 missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
109 self.tur_head.frame += 1;
115 if (self.tur_head.frame != 0)
116 self.tur_head.frame += 1;
118 if (self.tur_head.frame >= 7)
119 self.tur_head.frame = 0;
129 self.aim_flags = TFL_AIM_SIMPLE;
130 self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK ;
131 self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_TEAMCHECK | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF | TFL_FIRECHECK_AMMO_OWN;
132 self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
138 precache_model ("models/turrets/base.md3");
139 precache_model ("models/turrets/hellion.md3");
144 TUR_CONFIG_SETTINGS(HELLION_SETTINGS(hellion))
154 float t_hellion(float req)
164 precache_model ("models/turrets/base.md3");
165 precache_model ("models/turrets/hellion.md3");
174 #endif // REGISTER_TURRET