He = 1004;
She = 1003;
BHe = 1008;
BShe = 1009;

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;
		for name,obj in pairs(obj) do-------------------------------обнуление таблицы 
	if obj.is_collapsed then
	obj.is_collapsed= false
	end;
end
	ShowMenu(false);
	delete_tree_leaf("Root","dno");
	
	NextLevel(16);
	
end;

flags.glove_taken = true;	
	flags.rentgen_taken = true;
	flags.nvg_taken = true;
	flags.scaner_taken = true;
dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");
set_inpun_fun("gameinput");

-- playfile(".\\sound\\game_theme2.ogg",true,true);
-- CreateConsole()

flags["items"] = 0;
flags["items2"] = 0;
rentgen_is_usable=false;
flags["comics"] = true;
flags["comics1"] = false;
flags["comics2"] = false;
flags["comicsend"] = false;
flags.items_collected = false;
flags["start_draw"] = true;
flags["first_time_load"] = true;
flags["paluba"]=false;
flags["finish"]=false;
flags["upship"]=false;
flags["add_kamni"]=false;

flags["kamni"]=false;
flags["riba2"]=false;

flags["comics22"]=false;



pointer_is_usable=true
scaner_is_usable=true
flags.rentgen_is_usable= false;
rentgen_is_usable= false;


flags.rentgen_is_usable= false;
rentgen_is_usable= false;

flags.light1=true;
flags.light=false;
flags.nv_done=true;
flags.nvg_block=false;


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



AddTreeLeaf( "Root", "dno", 26, 0 );
AddTxt();
dofile("./data/26/0/res.lua");

SwitchToSheet("gr");
	





if flags.kamni ==true and not flags.comics2 and not flags.dirka and flags.items_collected then

AddParticleToObject(obj.kusok.id,"Korabl");
MoveEmiter("Korabl",569,429);
StartEmiter("Korabl");

if flags.items_collected then
AddParticleToObject(obj.paluba.id,"machta1");
MoveEmiter("machta1",810,355);
StartEmiter("machta1");

Set_Cursor(obj.kusok.id,4);
set_visible_object(obj.kusok.id,true);
Set_Cursor(obj.paluba.id,4);
end;
end;

if flags.upship and not flags.dirka then
	CreatePolygon(555,4,"paluba")
end;

if flags.dirka then
CreatePolygon(255,4,"dirka");
Set_Cursor(255,1);
set_visible_object(obj.kusok.id,false);
set_visible_object(obj.korabl1.id,false);
speciale_action(4,obj.koralli.id);         

set_visible_object(obj.paluba.id,false);
speciale_action(4,255)
SetHotPoint(obj.korabl1.id,0,300)	
speciale_action(2,obj.korabl1.id);		
speciale_action(10,obj.korabl1.id);  
SetHotPoint(obj.Rotatemachta.id,100,100)		  
set_visible_object(obj.paluba1.id,false);		
set_visible_object(obj.Rotatemachta.id,true);		  
RotateObject(obj.korabl1.id,0,-8,0.6,false)
RotateObject(obj.Rotatemachta.id,0,8,0.6,false)	
set_visible_object(obj.paluba1.id,false);
end

flags.start_draw = true;
StartAnimation( 5555555555,5,5 );
SetCurrentLeaf( "dno", 26, 0 );
ShowMenu(false );

-- playfile(".\\sound\\094.ogg",true,true);
playeffect("094",true)