dofile("Scripts/utils.lua");

hits = 2;
fly1_timeout = 160;
fly2_timeout = 280;

function Fly1()
	unit.Bomb({ -420.39, 6.46854, 687.291 });
end

function Fly2()
	unit.Land("Airfield");
--	object.Die();
end

function CheckDirectDamage(WeaponDamage, Caliber, Point, Distance, ZoneId)
	hits = hits - 1;
	if hits <= 0 then
		object.Die();
	end
end

function CheckSplashDamage(DetonationDamage, Caliber, Point, DistanceFactor)
	hits = hits - 1;
	if hits <= 0 then
		object.Die();
	end
end

function CheckSplashDamageZones(DetonationDamage, Caliber, Zones)
	hits = hits - 1;
	if hits <= 0 then
		object.Die();
	end
end

------------------------------------------------
function Main()
	AIparts:Run();
end

function Initialize()
	AIparts = utils.CreateSubsystems();
	AIparts:AddOneTime("Fly1", fly1_timeout, Fly1);
	AIparts:AddOneTime("Fly2", fly2_timeout, Fly2);
end
