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;
	
	SaveGame1();
	delete_tree_leaf("Root","lava");	
	NextLevel(23);

end;

flags.glove_taken = true;	
	flags.rentgen_taken = true;
	flags.nvg_taken = true;
	flags.scaner_taken = true;
	
flags.all_items = false;
flags.first_time_load = true;
flags.mini1 = true;
flags.mini_complete = false;
flags.finish = false;
flags.parts_plased = 0;
flags.comics1 = true;
flags.wheel = false;

flags.n = 0;
flags.nvg_block=false;
flags.light1=true;
flags.light=false;
flags.nv_done=true;
flags.mini_start=false;
flags.storedobj=0

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

AddTreeLeaf( "Root", "lava", 22, 0 );

AddTxt();

LoadLeafRes( 22, 0 );
-- playfile(".\\sound\\game_theme2.ogg",true,true);

-- playeffect("114");

-- scene logic
flags.start_draw = true;
flags.parts_plased = 0;
if flags.planka_22 then detail(1,obj.planka_22.id); set_visible_object(111,true) set_visible_object(1,false) end; 
if flags.gear1_22 then detail(2,obj.gear1_22.id); set_visible_object(22222222,true) set_visible_object(22222,false) end; 
if flags.gear2_22 then detail(3,obj.gear2_22.id);  set_visible_object(33,true) set_visible_object(3,false)end; 
if flags.gear3_22 then detail(4,obj.gear3_22.id);  set_visible_object(44,true) set_visible_object(4,false)end; 
if flags.gear4_22 then detail(5,obj.gear4_22.id);  set_visible_object(55,true) set_visible_object(5,false)end; 
if flags.gear5_22 then detail(6,obj.gear5_22.id); set_visible_object(66,true) set_visible_object(6,false) end; 
if flags.pruzhina_22 then detail(7,obj.pruzhina_22.id);  set_visible_object(77,true) set_visible_object(7,false) end; 
if flags.gear6_22 then detail(8,obj.gear6_22.id);  set_visible_object(88,true) set_visible_object(8,false)end;
if flags.rychag_22 then detail(10,obj.rychag_22.id);  set_visible_object(1000,true) set_visible_object(10,false)end;
if not flags.mini_complete then
	flags.mini1 = true;
end;

if flags.n >= 15 and flags.mini_start then
speciale_action(2,11);					
speciale_action(2,10);
speciale_action(2,7)
set_visible_object(obj.prujina.id,true);
end;
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

-- end scene logic
StartAnimation( 5555555555,5,5 );
SetCurrentLeaf("lava",22,0);
-- playfile(".\\sound\\038.ogg",true,true);
playeffect("114",true)