playeffect("sred",true)

speciale_action(2,125)
speciale_action(2,125,true,3)
speciale_action(2,124,true,2.9)
speciale_action(2,127)
speciale_action(2,127,true,3)
speciale_action(2,126,true,2.9)

setCursor(obj.mini_MidTaynik_17_0.id,2);
setCursor(obj.door_KoridorBratyev_17_0.id,1);
setCursor(obj.door_MidHidden_17_0.id,2);
setCursor(obj.mini_MidCyferblat_17_0.id,2);
setCursor(obj.mini_MidAngel_17_0.id,2);
setCursor(obj.mini_MidRuchka_17_0.id,2);
setCursor(obj.door_KoridorBratyev_17_0.id,8);

function SelectRandom()
  if not neighbors.MidHidden.lock then
    giveMeHint(obj.door_MidHidden_17_0.id)
  return end
  if obj.luk_14_11 and obj.luk_14_11.is_collapsed
  and obj.kolchan_18_1 and obj.kolchan_18_1.is_collapsed 
  and not neighbors.MidAngel.lock then
    giveMeHint(obj.mini_MidAngel_17_0.id)
  return end
  if obj.trafaret_16_12 and obj.trafaret_16_12.is_collapsed
  and not (neighbors.Pryazhki.lock and neighbors.MidRuchka.lock)then
    giveMeHint(obj.mini_MidRuchka_17_0.id)
  return end
  if not neighbors.MidTaynik.lock then
    giveMeHint(obj.mini_MidTaynik_17_0.id)
  return end
  if obj.gruz_16_1 and obj.gruz_16_1.is_collapsed
  and obj.gruz_19_1 and obj.gruz_19_1.is_collapsed
  and not neighbors.MidCyferblat.lock then
    giveMeHint(obj.mini_MidCyferblat_17_0.id)
  return end
  CreatePlashechka("10001")
end;

if flags.MidHidden2  then
  neighbors.MidHidden.lock=false
end;

if neighbors.MidHidden.lock then
  set_visible_object(obj.door_MidHidden_17_0.id,false)
else
  set_visible_object(obj.door_MidHidden_17_0.id,true)
end

if neighbors.MidCyferblat.lock then
  set_visible_object(obj.mini_MidCyferblat_17_0.id,false)
else
  set_visible_object(obj.mini_MidCyferblat_17_0.id,true)
end

if neighbors.MidAngel.lock then
  set_visible_object(obj.mini_MidAngel_17_0.id,false)
  --set_visible_object(obj.luk_i_strela_17_0.id,true)
else
  --set_visible_object(obj.luk_i_strela_17_0.id,false)
end

if flags.luk then
  set_visible_object(obj.luk_17_0.id,true)
else
  set_visible_object(obj.luk_17_0.id,false)
end;

if flags.streli then
  set_visible_object(obj.strela_17_0.id,true)
else
  set_visible_object(obj.strela_17_0.id,false)
end;

if flags.luk and flags.streli then
set_visible_object(obj.strela_17_0.id,false)
set_visible_object(obj.luk_17_0.id,false)
  set_visible_object(obj.spu4eno_17_0.id,true)
else
  set_visible_object(obj.spu4eno_17_0.id,false)
end;

if neighbors.MidRuchka.lock then
  set_visible_object(obj.yaschik_otkryt_17_0.id,true)
  if neighbors.Pryazhki.lock then
    set_visible_object(obj.mini_MidRuchka_17_0.id,false)
  end
else
  set_visible_object(obj.yaschik_otkryt_17_0.id,false)
end

if neighbors.MidTaynik.lock then
  set_visible_object(obj.mini_MidTaynik_17_0.id,false)
  set_visible_object(obj.otkrytyj_tajnik_s_chasami_17_0.id,false)
else
  playeffect("wall_holl")
  if not flags.plashka_17_0 then
    flags.plashka_17_0 = true
    CreatePlashechka("676")
  end
  set_visible_object(obj.mini_MidTaynik_17_0.id,true)
  set_visible_object(obj.otkrytyj_tajnik_s_chasami_17_0.id,true)
end

function gameinput (sender,obj_id,attachedID)
  sendersProcessing(sender,obj_id,attachedID)
  if sender==36 then
    if obj_id==7111 then
      StartTravel(211,2,nil,nil,flySp,flySp1);
      StartTimer(7111,11)
    return;end;
    if obj_id==7121 then
      StartTravel(212,2,nil,nil,flySp2,flySp1);
      StartTimer(7121,12)
    return;end;    
    if obj_id==7131 then
      StartTravel(213,2,nil,nil,flySp3,flySp1);
      StartTimer(7131,15)
    return;end;    
    if obj_id==7141 then
      StartTravel(214,2,nil,nil,flySp4,flySp1);
      StartTimer(7141,13)
    return;end;        
  return;end;    
  
  if sender==16 then
    if obj_id==124 then
      speciale_action(2,125,true,3)
      speciale_action(2,124,true,2.9)    
    return;end;
    if obj_id==125 then
      speciale_action(2,124,true,3)
      speciale_action(2,125,true,2.9)    
    return;end;    
    if obj_id==126 then
      speciale_action(2,127,true,3)
      speciale_action(2,126,true,2.9)    
    return;end;
    if obj_id==127 then
      speciale_action(2,126,true,3)
      speciale_action(2,127,true,2.9)    
    return;end;              
  return;end;    
  
  if sender==1 then
    if obj_id == obj.door_KoridorBratyev_17_0.id then
      jump("KoridorBratyev");
    end;
    if obj_id == obj.door_MidHidden_17_0.id then
      flags.is_hidden_loc = true;
      jump("MidHidden");
    end;
    if obj_id == obj.mini_MidCyferblat_17_0.id then
      CreateSatelite("MidCyferblat");
      playeffect("sat")
    end;
    if obj_id == obj.mini_MidAngel_17_0.id then
      CreateSatelite("MidAngel");
      playeffect("sat")
    end;
    if obj_id == obj.mini_MidRuchka_17_0.id then
      if neighbors.MidRuchka.lock then
        CreateSatelite("Pryazhki");
        playeffect("sat")
      else
        CreateSatelite("MidRuchka");
        playeffect("sat")
      end
    end;
    if obj_id == obj.mini_MidTaynik_17_0.id then
      CreateSatelite("MidTaynik");
      playeffect("sat")
    end;
  end
end