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

location={}
location["photolab"] = true
location["photolab"] = {}
location["photolab"]["id"] = 6
location["photolab"]["sub_id"] = 0


function LoadingLevel(param)
    SetAlfaValue(501,0)
	SetAlfaValue(503,0)
	SLevel=param;
return;end;
function LevelComplete()
	flags.levelcomplete=true;
	DeleteElement("gr",101);
	DeleteElement("gr",102);
	DeleteElement("gr",103);
	DeleteElement("gr",104);
	DeleteElement("gr",106);
	DeleteElement("gr",107);	
	--Emitters(false)	
--	speciale_action(2,500);
	DarkScreen(true)
	ShowMenu(false);	
end;

function StartLevel()
	AddParticleToObject(37,"water",0,0,0,0);
	AddParticleToObject(35,"probirka_b",0,0,0,0);
	AddParticleToObject(36,"probirka_y",0,0,0,0);
	AddParticleToObject(41,"banka",0,0,0,0);	
	StartEmiter("water");
	MoveEmiter("water",126,391);			
	StartEmiter("probirka_b");
	MoveEmiter("probirka_b",202,283);
	StartEmiter("probirka_y");
	MoveEmiter("probirka_y",365,183);
	StartEmiter("banka");
	MoveEmiter("banka",400,189);	
	if not flags.caseopen then
		AddParticleToObject(9,"Bag",0,0);
		StartEmiter("Bag");
		MoveEmiter("Bag",213,474);			
	end;	
	if flags.caseopen then
		AddParticleToObject(27,"Powder",0,0);
		AddParticleToObject(19,"MGlass",0,0);
		AddParticleToObject(14,"Micro",0,0);
		AddParticleToObject(30,"Glass",0,0);
		AddParticleToObject(40,"Ash",0,0);			
		MoveEmiter("Powder",588,358);
		MoveEmiter("MGlass",589,446);
		MoveEmiter("Micro",430,420);	
		MoveEmiter("Glass",61,417);
		MoveEmiter("Ash",685,211);	
		if not flags.minicomplete then
			StartEmiter("Powder");
		end;	
		if not flags.minicomplete1 then
			StartEmiter("MGlass");
		end;	
		if not flags.minicomplete2 then
			StartEmiter("Micro");
		end;	
		if not flags.glass_in then
			StartEmiter("Glass");
		end;
		if not flags.ash_in then
			StartEmiter("Ash");					
		end;
	end;
end;

frame=0;
ffingerprint=false;
ashes1=false;
ashes2=false;
ok=false;

flags={};

flags["whole_darkness"]=false;
flags["minicomplete"]=false;
flags["minicomplete1"]=false;
flags["minicomplete2"]=false;

flags["minitext1"]=false;
flags["minitext2"]=false;
flags["minitext3"]=false;

flags["minirun1"]=false;
flags["minirun2"]=false;
flags["minirun3"]=false;

flags["inv"]=false;
flags["caseopen"]=false;
flags["hanlde"]=false;
flags["ashes"]=false;
flags["powder"]=false;
flags["photo"]=false;
flags["sigara"]=false;
flags["skip"]=false;

flags["glass_in"]=false;
flags["ash_in"]=false;
flags["comics"]=false
flags["HintCount"]=5;

add_tree_leaf("Root","photolab",6,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");
	ShowMenu(false);
	loadresource("data\\photoaparat.png","photoaparat",112121212);
	AddImgToBook("photoaparat",838,580);
	AddHints()
dofile("./data/6/0/res.lua");

setcurentleaf("photolab",6,0);
DarkScreen(true);
speciale_action(2,503,true);		
speciale_action(4,503)

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