playeffect("korr_b",true)
if not flags.firstloc15 then
  flags.firstloc15=true
  CreatePlashechka("487")
if not Journal.pages[14] then
  Journal:addText(13,"9024",148,129,330)
  Journal:addPicture(13,"page13",147,206,0,0,339,333);
end  
end;
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.door_ZalBratyev_15_0.id,6);
setCursor(obj.door_Mid_15_0.id,2);
setCursor(obj.door_Older_15_0.id,2);
setCursor(obj.door_Guest_15_0.id,2);
setCursor(obj.door_Younger_15_0.id,2);
setCursor(obj.door_KoridorBratyevHidden_15_0.id,2);
setCursor(obj.masl_cor.id,4)

function SelectRandom()
  if not obj.masl_cor.is_collapsed then
    giveMeHint(obj.masl_cor.id)
  return;end
  if not neighbors.KoridorBratyevHidden.lock then
    giveMeHint(obj.door_KoridorBratyevHidden_15_0.id)
  return end
  if obj.parts_puz and obj.parts_puz.is_collapsed and not flags.MiddleOpen  then
    giveMeHint(obj.door_Mid_15_0.id)
  return end
  if obj.gems_17_14 and obj.gems_17_14.is_collapsed and not flags.OlderOpen then
    giveMeHint(obj.door_Older_15_0.id)
  return end
  if not flags.LockGuestFinish 
  and (obj.heart_sign and obj.heart_sign.is_collapsed)
  and (obj.tree_sign and obj.tree_sign.is_collapsed)
  and  (obj.apple_sign and obj.apple_sign.is_collapsed)
  and  (obj.snake_sign and obj.snake_sign.is_collapsed) then
    giveMeHint(obj.door_Guest_15_0.id)
  return end
  if not flags.Sundukfinish and flags.videlKodNaKartine then
    if flags.sundukopenM then
      giveMeHint(2)
    else
      giveMeHint(1)
    end;
  return end
  CreatePlashechka("10001")
end


if not flags.Sundukfinish then
  setCursor(1,2)
end;
if flags.sundukopenM then
  setCursor(1,3)
  setCursor(2,2)  
end; 
if flags.Sundukfinish then
  setCursor(2,3)
end;

if neighbors.KoridorBratyevHidden.lock then
  set_visible_object(obj.door_KoridorBratyevHidden_15_0.id,false)
else
  set_visible_object(obj.door_KoridorBratyevHidden_15_0.id,true)
end

if neighbors.KoridorBratyevLock.lock then
  setCursor(obj.door_Mid_15_0.id,7);
  set_visible_object(112,true)
  StopEmiter("Standart_15_1");
  -- --out("\t111111111!!!\n")
else
  -- --out("\t222222222!!!\n")
  set_visible_object(112,false)
end;


if neighbors.KoridorBratyevKrystal.lock then
  set_visible_object(111,true)
  setCursor(obj.door_Older_15_0.id,8)
  StopEmiter("Standart_15_2");
else
  set_visible_object(111,false)
end;

if neighbors.LockGost.lock then
  setCursor(obj.door_Guest_15_0.id,8)
  set_visible_object(110,false)
else
  set_visible_object(110,true)
end;




function gameinput (sender,obj_id,attachedID)
  sendersProcessing(sender,obj_id,attachedID)
  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==1 or obj_id==2) and not flags.Sundukfinish then
      CreateSatelite("Sunduk");
      playeffect("sat")
    end;
    if obj_id==obj.masl_cor.id then
      speciale_action(2,14)
      StopEmiter("Inv_15_5");
      StoreObj(obj.masl_cor.id)
    end;
    if obj_id == obj.door_ZalBratyev_15_0.id then
      jump("ZalBratyev");
    end;
    if obj_id == obj.door_Mid_15_0.id then
      if neighbors.KoridorBratyevLock.lock then
        jump("Mid");
      else
        CreateSatelite("KoridorBratyevLock");
        playeffect("sat")
      end
    end;
    if obj_id == obj.door_Older_15_0.id then
      if neighbors.KoridorBratyevKrystal.lock then
        jump("Older");
      else
        CreateSatelite("KoridorBratyevKrystal");
        playeffect("sat")
      end
    end;
    if obj_id == obj.door_Younger_15_0.id then
      CreatePlashechka("587")
    end;
    if obj_id == obj.door_KoridorBratyevHidden_15_0.id then
      flags.is_hidden_loc = true;
      jump("KoridorBratyevHidden");
    end;
    if obj_id == obj.door_Guest_15_0.id then
      if neighbors.LockGost.lock then
        jump("Guest");
      else
        CreateSatelite("LockGost");
        playeffect("sat")
      end
    end;
  end
end


