+// ============================
+// Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
+// ============================
+void Seeker_Flac_Explode ()
+{
+ self.event_damage = SUB_Null;
+
+ RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_flac_damage, autocvar_g_balance_seeker_flac_edgedamage, autocvar_g_balance_seeker_flac_radius, world, autocvar_g_balance_seeker_flac_force, self.projectiledeathtype, other);
+
+ remove (self);
+}
+
+void Seeker_Flac_Touch()
+{
+ PROJECTILE_TOUCH;
+
+ Seeker_Flac_Explode();
+}
+
+void Seeker_Fire_Flac()
+{
+ local entity missile;
+ vector f_diff;
+ float c;
+
+ W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_flac_ammo, autocvar_g_balance_seeker_reload_ammo);
+
+ c = mod(self.bulletcounter, 4);
+ switch(c)
+ {
+ case 0:
+ f_diff = '-1.25 -3.75 0';
+ break;
+ case 1:
+ f_diff = '+1.25 -3.75 0';
+ break;
+ case 2:
+ f_diff = '-1.25 +3.75 0';
+ break;
+ case 3:
+ default:
+ f_diff = '+1.25 +3.75 0';
+ break;
+ }
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CH_WEAPON_A, autocvar_g_balance_seeker_flac_damage);
+ w_shotorg += f_diff;
+
+ pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+
+ missile = spawn ();
+ missile.owner = missile.realowner = self;
+ missile.classname = "missile";
+ missile.bot_dodge = TRUE;
+ missile.bot_dodgerating = autocvar_g_balance_seeker_flac_damage;
+ missile.touch = Seeker_Flac_Explode;
+ missile.use = Seeker_Flac_Explode;
+ missile.think = adaptor_think2use_hittype_splash;
+ missile.nextthink = time + autocvar_g_balance_seeker_flac_lifetime + autocvar_g_balance_seeker_flac_lifetime_rand;
+ missile.solid = SOLID_BBOX;
+ missile.movetype = MOVETYPE_FLY;
+ missile.projectiledeathtype = WEP_SEEKER;
+ missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
+ missile.flags = FL_PROJECTILE;
+
+ // csqc projectiles
+ //missile.angles = vectoangles (missile.velocity);
+ //missile.scale = 0.4; // BUG: the model is too big
+
+ setorigin (missile, w_shotorg);
+ setsize (missile, '-2 -2 -2', '2 2 2');
+
+ W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_flac);
+ CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
+
+ other = missile; MUTATOR_CALLHOOK(EditProjectile);
+}
+
+// ============================
+// Begin: Tag and rocket controllers
+// ============================
+entity Seeker_Tagged_Info(entity isowner, entity istarget)
+{
+ entity tag;
+ for(tag = world; (tag = find(tag, classname, "tag_tracker")); )
+ if ((tag.realowner == isowner) && (tag.tag_target == istarget))
+ return tag;
+
+ return world;
+}
+
+void Seeker_Attack()
+{
+ entity tracker, closest_target;
+
+ for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self)
+ {
+ if (closest_target)
+ {
+ if (vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin))
+ closest_target = tracker.tag_target;
+ }
+ else
+ closest_target = tracker.tag_target;
+ }
+
+ traceline(self.origin + self.view_ofs, closest_target.origin, MOVE_NOMONSTERS, self);
+ if ((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
+ closest_target = world;
+
+ Seeker_Fire_Missile('0 0 0', closest_target);
+}
+
+void Seeker_Vollycontroller_Think() // TODO: Merge this with Seeker_Attack