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

function LevelComplete()

	
	flags = {};
	
	flags.glove_taken = true;	
	flags.rentgen_taken = true;
	flags.nvg_taken = true;
	flags.scaner_taken = true;
	flags.pointer_taken = true;
	flags.restore_sheet = false;
	nice_19_level = false;
	flags.finish = false;
	
	SaveGame1();
	delete_tree_leaf("Root","dark_cave");
	NextLevel(28);

end;

	
	flags.glove_taken = true;	
	flags.rentgen_taken = true;
	flags.nvg_taken = true;
	flags.scaner_taken = true;
	
	
flags.first_time_load = true;
flags["level_19_dark"] = true;
flags.light = false;
flags.all_items19 = false;
flags["comics1"] = true;
flags.comics2 = true;
flags.comics3 = true;
flags.comics4 = true;
flags.mini1 = false;
flags.bat = true;
flags.nv_done = false;
flags.xray_done = false;
flags.n_vision = false;
flags.nv = false;
flags.xray = false;
flags.n = 0;
flags.rentgen=false;
flags.dver=false;
flags.nvg_block=false;
flags.light1=true;

if flags.restore_sheet then
	LoadGame();
	AddTool();
end;
flags.restore_sheet = true;

AddTreeLeaf( "Root", "dark_cave", 27, 0 );
-- playfile(".\\sound\\game_theme2.ogg",true,true);

AddTxt();

LoadLeafRes( 27, 0 );
-- dofile("./data/27/0/res1.lua")
-- function f1(param)
	-- if param == a then
		-- messagebox("A")
		-- dofile("./data/27/10/res1.lua")
	-- end
-- end;
--PreLoadResource("./data/27/10/res0.lua","res","")

-- scene logic
flags.start_draw = true;
if flags.n_vision then	
	speciale_action(2,55);
	speciale_action(2,60);
	StartEmiter("Highlight_cup");
	
		RotateWheel(414,270,342,487,198,3,4,3);
		StartTimer(9000,1);
		StartTimer(8889,1);
		StartTimer(99,1);
		nvg_on = true;
		-- flags.lvl27flag=true
		StartTimer(343423,7,"ggggg")
		function ggggg()
			canmenu=true	
			
		end
		
		
end;
if flags.light then
	flags.n_vision = false;
	flags.nv_done = true;
	set_visible_object(56,false);
	set_visible_object(54,false);
	set_visible_object(55,false);
	set_visible_object(60,false);
end;
if not flags.comics2 and not flags.xray_done then
	rentgen_is_usable = true;
end;
if flags.xray then
	speciale_action(4,61);
	speciale_action(2,61,true);
	flags.xray = true;
	
	RotateWheel(270,126,198,342,54,1.5,2,1);	
	letrotate=true;
	rentgenselect=true	
	rentgen_rotate=true;
	userent=true;
	rentgen_on=true;
	flags.rentgen_1=false;
	StartTimer(9000,1);
	StartTimer(8888,1);
end;
SetObjectPosition(111,-1000,-1000)
-- end scene logic
StartAnimation( 5555555555,5,5 );
SetCurrentLeaf("dark_cave",27,0);
-- playfile(".\\sound\\038.ogg",true,true);
playeffect("038",true)
