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

function LevelComplete()
if not flags.scaner_taken then
		flags.scaner_taken = true;
		SetCurrentRM("menu");
		AddButtonToBook(100005,"scaner_active",nil,nil,nil,957,170,45,29,true);
		SetCurrentRM("main");
	end;	
	
	
if not flags.nvg_taken then
		flags.nvg_taken = true;
		SetCurrentRM("menu");
		AddButtonToBook(100002,"nvg_active",nil,nil,nil,960,130,45,29,true);
		SetCurrentRM("main");
	end;
	if not flags.rentgen_taken then
		flags.rentgen_taken = true;
		SetCurrentRM("menu");
		AddButtonToBook(100001,"rentgen_active",nil,nil,nil,902,108,56,40,true);
		SetCurrentRM("main");
	end;
	if not flags.glove_taken then
		flags.glove_taken = true;
		SetCurrentRM("menu");
		AddButtonToBook(100004,"glove_active",nil,nil,nil,911,179,43,51,true);
		SetCurrentRM("main");
	end;	
	
	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.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;

addstaticobjecttogame(1000002,"menu",-78,624,"");
if flags.restore_sheet then
	LoadGame();
	AddTool();
end;
flags.restore_sheet = true;

AddTreeLeaf( "Root", "dark_cave", 27, 0 );

AddTxt();

LoadLeafRes( 27, 0 );


-- scene logic
flags.start_draw = true;
if flags.n_vision then
	--flags.n_vision = false;
	--gameinput(100002,-1,-1);
	speciale_action(2,55);
	speciale_action(2,60);
	StartEmiter("Highlight_cup");
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;
end;
SetObjectPosition(111,-1000,-1000)
-- end scene logic

SetCurrentLeaf("dark_cave",27,0);