dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");
set_inpun_fun("gameinput");


location={}
location["hotel"] = true
location["hotel"] = {}
location["hotel"]["id"] = 15
location["hotel"]["sub_id"] = 0

function LoadingLevel(param)
    SetAlfaValue(501,0)
	SetAlfaValue(503,0)
	SLevel=param;
return;end;

function LevelComplete()
	flags.levelcomplete=true;

	DeleteElement("gr",1);
	DeleteElement("gr",8);

	DeleteElement("gr",32);
	DeleteElement("gr",38);
	DarkScreen(true);
	ShowMenu(false);
end;

function StartLevel()
	if not flags.shkaf then
		AddParticleToObject(173,"Door",0,0);
		StartEmiter("Door");
		MoveEmiter("Door",432,330);	
	end;
	if flags.shkaf and not flags.minicomplete then
		SetAlfaValue(173,0)
		SetAlfaValue(167,0.001)		
		AddParticleToObject(167,"Apt",0,0);
		StartEmiter("Apt");
		MoveEmiter("Apt",415,394);	

		-- SetAlfa(173,0.001,0,0.1)
		-- SetAlfa(167,0,0.001,0.1)
		-- Set_Cursor(167,2)		
	end;
	if not flags.lighton then
		AddParticleToObject(44,"Switch",0,0);
		StartEmiter("Switch");
		MoveEmiter("Switch",790,211)	
	end;
	if flags.lighton and not flags.key then
		AddParticleToObject(2,"Key",0,0);
		StartEmiter("Key");
		MoveEmiter("Key",530,40);			
	end;
	if flags.body and not flags.but then
		AddParticleToObject(77,"But",0,0);
		StartEmiter("But");
		MoveEmiter("But",693,532);		
	end;
	if not flags.wine then
		AddParticleToObject(45,"Glass",0,0);
		StartEmiter("Glass");
		MoveEmiter("Glass",814,595)		
	end;	
end;


flags={};
flags["whole_darkness"]=false;
flags["minicompete"]=false;
flags["stepladder"]=false;
flags["lamp"]=false;
flags["shkaf"]=false;
flags["battery"]=false;
flags["key"]=false;
flags["but"]=false;
flags["wine"]=false;
flags["body"]=false;
flags["lighton"]=false;
flags["levelcomplete"]=false;
flags["HintCount"]=5;
flags["comics"]=false

add_tree_leaf("Root","hotel",15,0);-- Добавляет лист в дерево 
SetCurrentRM("menu");
	addstaticobjecttogame(877777777,"menubuttons",63,622,"",60,0,61,61);
	AddSheet(1002,"re","red_b",63,622,61,61,"",128,640,650,115,15,5,7,7,0,59,877777777);
SetCurrentRM("main");
	loadresource("data\\photoaparat.png","photoaparat",112121212);
	AddImgToBook("photoaparat",838,580);
	AddHints()
ShowMenu(false);



dofile("./data/15/0/res.lua");


setcurentleaf("hotel",15,0);
SwitchToSheet("re");

DarkScreen(true);
speciale_action(2,503,true);
speciale_action(4,503)

playfile(".\\sound\\Music_1.ogg",true,true);