-void turret_hellion_missile_explode();
-void turret_hellion_missile_think();
-void turret_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
-
-void turret_hellion_postthink()
-{
- if (autocvar_g_turrets_reloadcvars)
- {
- if (!self.shot_speed_max) self.shot_speed_max = autocvar_g_turrets_unit_hellion_std_shot_speed_max;
- if (!self.shot_speed_gain) self.shot_speed_gain = autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
- }
-
- if (self.tur_head.frame != 0)
- self.tur_head.frame += 1;
-
- if (self.tur_head.frame >= 7)
- self.tur_head.frame = 0;
-}
-
-void turret_hellion_attack()
-{
- entity missile;
-
- if(self.tur_head.frame != 0)
- self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
- else
- self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
-
- sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
-
- missile = spawn ();
- setorigin(missile, self.tur_shotorg);
- setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
-
- missile.classname = "hellion_missile";
- missile.owner = self;
- missile.bot_dodge = TRUE;
- missile.bot_dodgerating = self.shot_dmg;
- missile.takedamage = DAMAGE_YES;
- missile.event_damage = turret_hellion_missile_damage;
- missile.damageforcescale = 2;
- missile.health = 10;
- missile.enemy = self.enemy;
- missile.think = turret_hellion_missile_think;
- missile.nextthink = time;// + 0.2;
- missile.solid = SOLID_BBOX;
- missile.movetype = MOVETYPE_FLY;
- missile.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
- missile.angles = vectoangles(missile.velocity);
- missile.touch = turret_hellion_missile_explode;
- missile.flags = FL_PROJECTILE;
- missile.solid = SOLID_BBOX;
- missile.tur_health = time + 9;
- missile.tur_aimpos = randomvec() * 128;
- te_explosion (missile.origin);
- CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
-
- self.tur_head.frame += 1;
-}
-
-void turret_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
-{
- self.health = self.health - damage;
- self.velocity = self.velocity + vforce;
- if (self.health <= 0) turret_hellion_missile_explode();
-}