PromptHeading = ID_TUTORIAL_12_OFFSET + 1
g_currentprompt = 0;
g_counter = 0;
Tweaks.numyearsin24hours = 0;

-------------------------------------------------------------------------------------------------
-- INITIALISE_Level. Standard level event
-------------------------------------------------------------------------------------------------
function EVENTINITIALISE_Level()
	--Game.Pause();
	-- load the building and business file
	C_RunScript("scripts\\maps\\monopolymap.lua");
	C_RunScript("scripts\\tutorial12\\initialpref.lua");

end;

-------------------------------------------------------------------------------------------------
-- Level. Standard level event.
-------------------------------------------------------------------------------------------------
function EVENT_Level()
	-- create an initial prompt
	C_TriggerEvent("BlockCam", 1, INDIANA_AVENUE);
	-- Game.Unpause();
	Interface.DisableAllControls();
	Interface.DisableAll3DPicking();
	Interface.DisableCameraControl();
	C_TriggerEvent("SetPlanView", 1);
	-- create the initial prompt
	CreatePrompt(1);
end;

function EVENT_AIBid(a)
		Interface.ForcePlayerToBid(a, 1181+(500*a)+(g_counter*50)); 	
end;

function EVENT_AIPass(a)
		Interface.ForcePlayerToPass(a);  	
end;

function EVENT_AIPullout(a)
		Interface.ForcePlayerToPullOut(a);  	
end;

function CATCHEVENT_InterfacePromptDismiss(a)

	if g_currentprompt == 4 then
		Game.Unpause();
	else
		if g_currentprompt ~= 10 then
			CreatePrompt(a);
		end;
	end;

end;

function CATCHEVENT_TutorialEvent(a)

   if a == TUT_END_BUILD then
		CreatePrompt(11);
	end;

	if a == TUT_BUILD_ACCEPT and g_currentprompt == 10 then
		Interface.DismissPrompt();
	end;

	if g_currentprompt == 9 then
		Interface.DismissPrompt();
	end;

	if g_currentprompt == 8 then
		Interface.DismissPrompt();
	end;
	
	if g_currentprompt == 7 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
	end;

	if a == TUT_BEGINAUCTION then
		C_TriggerEvent("AIPullout", 50, 1);
		return 0;
	end;


   if g_currentprompt == 6 then
			Game.Unpause();
	end;

	if g_currentprompt == 5 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_INFOBUTTON_5);
	end;

	if a == TUT_ENDAUCTION then
		CreatePrompt(5);
	end;


	if g_currentprompt == 4 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_BLOCK_BUYBLOCK);
	end;

	if g_currentprompt == 3 then
		Interface.DismissPrompt();
		Interface.DisableControl(TUT_MPP_GREENBUTTON_2);
	end;

	if g_currentprompt == 2 then
		Interface.DismissPrompt();
	end;
end;


function CATCHEVENT_Picked3D(a)

	if a == 1 and g_currentprompt == 2 then
		Interface.DismissPrompt();
		Interface.DisableAll3DPicking();
	end;
end;

-- prompt manager
function CreatePrompt(a)
	g_currentprompt = a;
	body = a+PromptHeading;
	if a == 1 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"Let's look at what benefits you gain by holding a Monopoly.", a+1);
		Interface.PositionPrompt(0,100);
	elseif a == 2 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"First you must bid for the last block in the set - you already own the other two. Double click Illinois Avenue.", a+1);
		Interface.AddArrow( 332, 170 );
		Interface.EnableBlockPicking(ILLINOIS_AVENUE);
	elseif a == 3 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Ok lets lease the block...", a+1);
		Interface.AddArrow( 30,94 );
		Interface.EnableControl(TUT_MPP_GREENBUTTON_2);		
	elseif a == 4 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Click here to lease the block...", a+1);
		Interface.EnableControl(TUT_MPP_BLOCK_BUYBLOCK);		
		Interface.AddArrow( 115, 143 );
	elseif a == 5 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Now select the Buy / Sell Value button.", a+1);
		Interface.EnableControl(TUT_MPP_INFOBUTTON_5);
		Interface.AddArrow(157, 53);
	elseif a == 6 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"The values that you can buy out your opponents stores for is greatly reduced. This will remain the case until you lose the monopoly. If you need to buy out an opponent, having the monopoly makes it much more affordable.", a+1);
		Interface.AddArrow(176,117);
	elseif a == 7 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Once you have a monopoly, you can also build Hotels. Click on the build button.", a+1);
		Interface.EnableControl(TUT_MPP_GREENBUTTON_3);
		Interface.AddArrow(30,118);
	elseif a == 8 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Because we have just bought this block we need to activate the building rights on it...click here now", a+1);
		Interface.EnableControl(TUT_BUILD_RIGHTS_BUTTON);
		Interface.AddArrow(125, 78);
	elseif a == 9 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"Choose a residential building.", a+1);
		Interface.PositionPrompt(0,-120);
		Interface.SetTutorialType(1);
		Interface.SetTutorialUse(1);
		Interface.EnableControl(TUT_BUILD_ACCEPT);
		Interface.EnableControl(TUT_BUILD_CHANGE_DESIGN);
		Interface.EnableControl(TUT_BUILD_QUALITY_LOW);
		Interface.EnableControl(TUT_BUILD_QUALITY_MED);
		Interface.EnableControl(TUT_BUILD_QUALITY_HIGH);
		Interface.EnableControl(TUT_BUILD_CHANGE_FLOOR);
		Interface.EnableControl(TUT_BUILD_SELECT_BACK_DRAG_BUTTON);
		Interface.EnableControl(TUT_BUILD_SELECT_USE);
		Interface.EnableControl(TUT_BUILD_SELECT_TYPE);
		Interface.AddArrow(175,63);
		Interface.EnableBlockPicking(ILLINOIS_AVENUE);
	elseif a == 10 then
		Interface.CreateMessage(PromptHeading,body, a+1); --"And there it is. The Hotel. If you build a Hotel, some of the tourists that visit the city will decide to stay for an extra day or two. Not only do they pay for the hotel room, they will also be ready for a full days shopping ahead. ", a+1);
	elseif a == 11 then
		Interface.CreatePrompt(PromptHeading,body, a+1); --"Well, that's the last of the tutorials. You should now be ready to play the game. Get in there and make some money!", a+1);
	elseif a == 12 then
		Game.End(true);
	end;
end;

