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.restore_sheet = false;
	
	SaveGame1();
	delete_tree_leaf("Root","mech");
	NextLevel(21);
end;

flags.glove_taken = true;	
	flags.rentgen_taken = true;
	flags.nvg_taken = true;
	flags.scaner_taken = true;
	
rentgen_is_usable=false;
flags.first_time_load = true;
flags.parts_plased = 0;
flags.all_items = false;
flags.anim = false;
flags.comics1 = true;
flags.comics2 = true;
flags.comics3 = true;
flags.finish = false;
flags.n = 0;
flags.light1=true;
flags.light=false;
flags.nv_done=true;
flags.nvg_block=false;

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

AddTreeLeaf( "Root", "mech", 28, 0 );

AddTxt();

LoadLeafRes( 28, 0 );

flags.parts_plased = 0;
if flags.gear1_20 then detail(26,obj.gear1_201.id,403); set_visible_object(266,true) set_visible_object(26,false) end; 
if flags.gear3_20 then detail(28,obj.gear3_201.id,404);set_visible_object(288,true) set_visible_object(28,false) end; 
if flags.gear5_20 then detail(30,obj.gear5_201.id,402); set_visible_object(300,true) set_visible_object(30,false)end; 
if flags.mayatnik_20 then detail(34,obj.mayatnik_201.id,401); set_visible_object(344,true) set_visible_object(34,false) end; 
if flags.ball_20 then detail(31,obj.ball_201.id,405); set_visible_object(311,true) set_visible_object(31,false)end; 
if flags.weight_20 then detail(37,obj.weight_201.id,406); set_visible_object(377,true) set_visible_object(37,false)end;
if flags.anim then flags.comics3 = true; end; 

-- scene logic
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
-- end scene logic
StartAnimation( 5555555555,5,5 );
SetCurrentLeaf("mech",28,0);