dofile("Scripts/utils.lua");
dofile("Scripts/Init/ship.lua");

function Main()
	AIparts:Run();
end

function EventMan()
end

function Fire()
	if fire then
		if GetGameTime() < 400 then
			unit.AttackPlace(-200, 0, -200);
		elseif GetGameTime() < 800 then
			unit.AttackPlace(0, 0, 0);
		else
			unit.AttackPlace(500, 0, 500);
		end
	end
end

function FirstFire()
	if GetGameTime() < 5 then return end
	SetEvent("ship_firing");
	if not text then
		ScreenLog("USS North Carolina has arrived.\nShe will support you in the course\nof your mission with ordnance.");
		text = true;
	end
	unit.AttackPlace(-200, 0, -100);
	AIparts:RemovePeriodic("FirstFire");
end

function Move()
	if move1 then
		move1 = false;
		unit.MoveTo(0,0,-800);
	elseif move2 then
		move2 = false;
		fire = false;
		unit.MoveTo(980,0,-960);
	end
end

function MicroAILog()
--	ScreenLog("MT's action: " .. mai_action .. " MOVE state: " .. " " .. mai_move_state .. "  MOVE order: " .. mai_move_order);
end

