// Lighting Handler.
// Worthless Bums 2012.


// NOTE: Not used!
function bombArea ()
{//echo("bombArea()");
	%xIndex = $playerSquad[$activeCharacter].xIndex;
	%yIndex = $playerSquad[$activeCharacter].yIndex;
	%range = 8;
	// Loop through the area dropping explosions!
	for (%i = %xIndex - %range; %i < %xIndex + %range; %i++)
	{
		for (%j = %yIndex - %range; %j < %yIndex + %range; %j++)
		{
			handleExplosion(%i, %j);
		}
	}
}
function handleExplosion (%xIndex, %yIndex)
{//echo("handleExplosion()");
	%explosionPosition = getTilePositionFromIndices(%xIndex, %yIndex);
	%grenadierExplosionAnimation = new Sprite()
	{
		SceneLayer = 0;
		scenegraph = levelSceneGraph;
		Animation = "Sprites:Explosion";
		canSaveDynamicFields = "1";
		position = %explosionPosition;
		size = "6.000 6.000";
	};
	addObjectToScene(%grenadierExplosionAnimation);
	%grenadierExplosionAnimation.setLifetime(0.65);
	playExplosionSfx();
}