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

function LevelComplete()
		
	delete_tree_leaf( "Root","piedmont" );
	
	
	if not flags.nvg_taken then
		flags.nvg_taken = true;
		SetCurrentRM("menu");
		AddButtonToBook(100002,"5","nvg_blue",nil,nil,nil,963,143,30,30,true,true,1);
		SetCurrentRM("main");
	end;
	PushButton(100002,false)
	if not flags.rentgen_taken then
		flags.rentgen_taken = true;
		SetCurrentRM("menu");
		AddButtonToBook(100001,"8","rentgen_blue",nil,nil,nil,902,178,30,30,true,true,3);
		SetCurrentRM("main");
	end;
	PushButton(100001,false)
	
	flags = {};	
	flags.glove_taken = true;	
	flags.nvg_taken=true;
	flags.rentgen_taken=true;
	flags.restore_sheet = false;
	SaveGame1();
	
	ShowMenu(false);
	if gloveselect then	RotateToPos(2);		end;
	if nvgselect then	RotateToPos(3);			end;
	if rentgenselect then 	RotateToPos(1);			end;
	if scanerselect then	RotateToPos(0);			end;
	obj={}
	NextLevel(2);
end;
He = 1004;
She = 1003;
SPEED = 2;

flags.start_arrow = false;
flags.items_collected = false;
flags.glove_vkl=false;
flags.glove_vikl=false;
flags.ngv_vkl=false;
flags.ngv_vikl=false;
flags.rentgen_vkl=false;
flags.rentgen_vikl=false;
flags.animation=false;
flags.nvg_block = false;
flags.start_tutor = true;
flags.start_tutor2 = true;
flags["first_time_load"]=true;
flags["start_draw"] = true;
flags["comics"]=true;
flags["comics1"]=false;
flags["comics2"]=false;
flags["mini1"] = false;
flags["seen"] = false;
flags["Hanoi"] = true;
flags["items"] = 0;
flags["collected"] = false;
flags["finish"] = false;
flags["finish2"] = false;
flags["ESC"] = false;
flags["flag58"] = false;
flags["comics2_finished"] = false;
flags["firsttime"] = true;
flags.takenvg=false;

pointer_is_usable = true;
flags.use_rent=false;
flags.rentgen=false;
flags["comicsend"]=false;
flags.plawes = false;
flags.plawes1 = false;
flags.light1=true;
flags.light=false;
flags.nv_done=true;
flags.nvg_block=true;
flags.start_mini=false;
c1(flags.restore_sheet)

if flags.restore_sheet  then
	LoadGame();
	AddTool();
end;
flags.restore_sheet = true;
Hanoika=true
add_tree_leaf("Root","piedmont",1,0);

AddTxt();

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

flags.start_draw = true;
-- for name,o in pairs(obj) do
	-- if o.is_stored then
	-- SetObjectPosition(o.id,-1000,-1000)
	-- AddElement( sheet, obj[name].id );
	-- set_visible_object( o.id, true );
	-- end;
-- end

if flags.rentgen and not flags.mini1 then
Set_Cursor(21,2);
Set_Cursor(22,2);
Set_Cursor(23,2);
Set_Cursor(24,2);
Set_Cursor(25,2);
StartEmiter("kamni");
end;

if flags.rentgen then
StartEmiter("Highlight");
Set_Cursor(obj.lever.id,4);
end;

-- if flags.mini1 then
-- Set_Cursor(21,3);
-- Set_Cursor(22,3);
-- Set_Cursor(23,3);
-- Set_Cursor(24,3);
-- Set_Cursor(25,3);
-- StopEmiter("kamni");

-- end
flags.ngv_vkl=false;
flags.ngv_vikl=false;
flags.rentgen_vkl=false;
flags.rentgen_vikl=false;

if obj.loc_rent.is_collapsed then
setcolor( obj.loc_rent.id, 0, 0, 0, 0.5, 1 );
end

if not flags.takerent  and flags.prepareforarrow then
	speciale_action(2,obj.arrow11.id);
	StartAnimation(obj.arrow11.id)

end

if  flags.takerent  and not flags.rentgen then
	set_visible_object(5556,true);
	StartAnimation(5556);
	rentgen_is_usable=true;
	CreatePlashechka(9999,"211","goodgirl",true)
end

SetCurrentLeaf("piedmont",1,0);
StartAnimation( 5555555555,5,5 );
--playfile(".\\sound\\030.ogg",true,true);
playeffect("030",true)