next_timeout = 5;
count = 3;
size = GetMapSize();
delta = 20;
x = -size/2;
z = -size/2;

function Initialize()
	--log("Initialize");
	AIparts = utils.CreateSubsystems();
	--AIparts:AddPeriodic("Start", start_timeout, Start);
	AIparts:AddPeriodic("NextDetonation", next_timeout, NextDetonation);
end

function NextDetonation()
	for i = -size/2,size/2,delta do
		CreateDetonation("Detonations/fuel_large.dsc",GetTerrainType(i, 0, z), GetTerrainPoint(i, 0, z));
	end
	z = z + delta;
	if z > size/2 then
		count = count -1;
		if count > 0 then
			z = -size/2;
		else
			AIparts:RemovePeriodic("NextDetonation");
		end
	end
end
 
function Main()
	AIparts:Run();
end

Initialize();