SetActivLeaf("kamera");
Spirit_Particles()
Back={
0,650,
1024,650,
1024,768,
0,768
}

Hidden={
541,271,
724,268,
925,453,
625,459
}

Brick={
64,403,
128,403,
128,441,
64,441
}
AddObjForCur()
add_animation(121)
add_animation_frame(121,"kamera_rat",0,600,0  ,0  ,105,49,0.05);
add_animation_frame(121,"kamera_rat",0,600,105,0  ,105,49,0.05);
add_animation_frame(121,"kamera_rat",0,600,210,0  ,105,49,0.05);
add_animation_frame(121,"kamera_rat",0,600,315,0  ,105,49,0.05);
add_animation_frame(121,"kamera_rat",0,600,0  ,0  ,105,49,0.05);
StartAnimation(121)
flyRat1 = {"InstantiationOfLine", 2, 1024, 620, 108, 768, 5, false};
StartTravel(121,1,nil,nil,flyRat1);

StartTimer(1222,20)

addstaticobjecttogame(60,"kamerag",953 ,800,"",0,0,15,28);
addstaticobjecttogame(61,"kamerag",71 ,800,"",15,0,15,28);
addstaticobjecttogame(62,"kamerag",71 ,800,"",15,0,15,28);

k1_gad1 = {"InstantiationOfLine", 2,251,195,-50,-50, 20, true};
k1_gad2 = {"InstantiationOfLine", 2,607,208 ,607,-20, 30, true};
k1_gad3 = {"InstantiationOfLine", 2,779,358,1036, 46, 25, true};

StartTravel(61,1,nil,nil,k1_gad2);
StartTimer(6219999,2)
StartTimer(6239999,3)
speciale_action(2,60)
speciale_action(2,62)

CreatePolygon(13,4,"Hidden")

-- addactivobjecttogame( 1,"kamera_all",470,494,"","",0,0,657,703,227,158); --кандалы на джонсе

-- addstaticobjecttogame( 2,"kamera_all",532,340,"",0,0,467,311); --джонс
-- addstaticobjecttogame( 3,"kamera_all",564,314,"",467,0,442,362); --джонс призрак
-- speciale_action(2,3,true,3);

addactivobjecttogame( 4,"kamera_all",322,422,"","",0,0,467,362,190,271); --табурет

if obj.tabura ~= nil and obj.tabura.is_collapsed then
  speciale_action(2,4);
end;

NewObj("tabura","tabur",5000,5000,"410"); --табуретка

addactivobjecttogame( 14,"kamera_all",274,334,"","",0,0,809,861,152,145); 
speciale_action(2,14);
addactivobjecttogame( 5,"kamera_all",274,334,"","",0,0,657,861,152,145); --цепь

addactivobjecttogame( 6,"kamera_all",391,381,"","",0,0,935,756,47,37); --кружка

addstaticobjecttogame( 7,"kamera_all",171,572,"",884,703,97,53); --кирпич на полу
speciale_action(2,7);

addactivobjecttogame( 9,"kamera_all",470,493,"","",0,0,657,544,227,159); --кандалы отдельно
speciale_action(2,9);

addactivobjecttogame(10,"kamera_all",72  ,395,"","",0,0,884,756,51,65); --кирпич в стене

CreatePolygon(15,4,"Brick")

CreatePolygon(12,4,"Back")

addstaticobjecttogame(11,"kamera_10",0  ,0  ,""); --бг

addfade(501,0);
kirp=false
perkr=false

 if flags.vilamatoM then
     kirp=true;
    speciale_action(2,7);
    speciale_action(2,10); 
 end;


if flags.perepilM then
   perkr=true;
   speciale_action(2,5)
   speciale_action(2,14) 
end;



if flags.hidden_ugol then
  speciale_action(2,13)
end;



if flags.cep_krugka then
  ActivateObject(6,false);
  ActivateObject(14,false);
  speciale_action(2,6);
  if not perkr then
      perkr =true;
      ActivateObject(5,false);
      
      speciale_action(2,5);
  end;
end;



if flags.kirpich then
  ActivateObject(10,false);
  ActivateObject(15,false);
if not kirp then
  kirp=true;
  speciale_action(2,7);
  speciale_action(2,10);
end;  
end;



if flags.kandaly_bolty then
  speciale_action(2,1);
  speciale_action(2,9);
  speciale_action(2,2);
  speciale_action(2,3);
end;