//=============================================================================
// SacredHeadSwarm.
//=============================================================================
class SacredHeadSwarm expands DeadBodySwarm;

auto state buzzing
{
ignores EnemyNotVisible, SeePlayer, EncroachedBy;

	function SpawnFly()
	{
		local horsefly fly;

		if ( !Region.Zone.bWaterZone && (swarmsize > 0) )
		{
			swarmsize--;
			fly = spawn(class 'horsefly',self,'', Location + VRand() * CollisionRadius);
			//fixme - create a sacred head fly - it should destroy self if under water 			
			fly.AmbientGlow = 70;
			fly.bUnlit = true;
			fly.LightType=LT_Pulse;
		    fly.LightEffect=LE_None;  //LE_TorchWaver?
			fly.LightBrightness=255;
			fly.LightHue=Rand(64);
			fly.LightRadius=2;
			fly.AirSpeed = 300;
			fly.LightSaturation= Max(0, Rand(24) - 8);
		}
		if ( swarmsize > 0 )
			SetTimer(3.0 * FRand(), false);
	}

	function Timer()
	{
		SpawnFly();
	}

	function BeginState()
	{
		SetTimer(1.0, false);
	}
}

