function SelectRandom()

    if not flags.fire_complete and obj.solar~=nil and obj.solar.is_collapsed and obj.gaga~=nil and obj.gaga.is_collapsed then
       selectrandomobject1(1.5,12,false);
    return;end;        
    if flags.fire_complete and not flags.stop_fire and obj.krugwa~=nil and obj.krugwa.is_collapsed then
       selectrandomobject1(1.5,9,false);
    return;end;    
    if flags.stop_fire and not obj.lomato.is_collapsed then
       selectrandomobject1(1.5,obj.lomaot.id,false);
    return;end;            
    if not flags.zavareno and obj.bolgar~=nil and obj.bolgar.is_collapsed then
       selectrandomobject1(1.5,13,false);
    return;end;   
 not_hint=true	
CreatePlashechka(900000,"10005")
return;end;

function SetCursors()
    ItemsCur={}
    PointingItems={}
    Set_Anim_Cur(11,11);
    if flags.generator then
    if not flags.stop_fire then
        --if not flags.solar_complete then
            Set_Anim_Cur(12,2)
        -- end;
       -- if flags.solar_complete then
          -- Set_Anim_Cur(9,2)
      -- end;        
    end;
    if flags.stop_fire and not flags.zavareno then
      Set_Anim_Cur(13,2);
    end;
    if flags.zavareno then
      Set_Anim_Cur(8,14);      
    end;
    if not obj.lomaot.is_collapsed and flags.stop_fire then
        Set_Anim_Cur(obj.lomaot.id,4);
    end;
    end;
end;

function SetParticles()
    if flags.generator then
    if not obj.lomaot.is_collapsed and flags.stop_fire then
      AddParticleToObject(obj.lomaot.id,"nog",769,292);
      MoveEmiter("nog",769,292);
      StartEmiter("nog");
    end;
    if not flags.stop_fire then
      
      AddParticleToObject(11,"krysaki",530,523);
      MoveEmiter("krysaki",530,523);
      StartEmiter("krysaki");
    end;
    if flags.fire_complete and (not flags.stop_fire) then
      AddParticleToObject(12,"fire_krysy_loc",526,640);
      MoveEmiter("fire_krysy_loc",526,640);
      StartEmiter("fire_krysy_loc");
    end;
    if flags.stop_fire then
      AddParticleToObject(13,"zavareno",547,322);
      MoveEmiter("zavareno",547,322);
      StartEmiter("zavareno");
      if not obj.lomaot.is_collapsed then
        AddParticleToObject(obj.lomaot.id,"nog",769,292);
        MoveEmiter("nog",769,292);
        StartEmiter("nog");
      end;
    end;
    end;
end;

function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID)  
CursorTreatment(obj_id,sender,attachedID);
  if sender==33 then
      Block_Show_Cur(false);
  return;end; 
  
  if sender==100 then
  playeffect("fon_dark",true);
  SetParticles()
  SetCursors()
  BlockCursor(false)
  if flags.fire_complete and (not flags.stop_fire) then
   playeffect("fire",true);
  end;
    if not flags.generator then
    CreatePlashechka(900000,"358")
    return; end;  
    if not flags.fire_complete and not flags.first_rat then
    flags.first_rat=true
    CreatePlashechka(900000,"3029")
    end;
  return;end;
 
  if sender==41 then
    if obj_id==50 then
        speciale_action(2,obj_id)
        StartTimer(4219999,3)
    end;
    if obj_id==51 then
        speciale_action(2,obj_id)
        StartTimer(4229999,4)
    end;    
    if obj_id==52 then
        speciale_action(2,obj_id)
        StartTimer(4239999,2)
    end;        
  return;end;
  
  if sender==36 then
    if obj_id==4219999 then
        speciale_action(2,50)
        StartTravel(50,1,nil,nil,k_gad1);
    end;    
    if obj_id==4229999 then
        speciale_action(2,51)
        StartTravel(51,1,nil,nil,k_gad2);
    end;
    if obj_id==4239999 then
        speciale_action(2,52)
        StartTravel(52,1,nil,nil,k_gad3);
    end;                
  return;end;
  

  
  if sender == 1 then
    g_attachedID = attachedID;
    if obj_id == 11 then
        flags.is_jumping = false;
        playeffect("step_room")
        RemObjFromMouse() 
        jump("koridor","turma",14,0);
    --     flags.zavareno = true;
        if flags.is_jumping and flags.zavareno and not flags.hidden_reshetka_dwa then
            AddParticleToObject(10,"reshetka",512,472);
            MoveEmiter("reshetka",512,472);
            StartEmiter("reshetka");
            ActivateObject(10,true);
            Set_Anim_Cur(10,2);
        return; end;
    return; end;
    
    if flags.generator then
    if obj_id == 13 then
        RemObjFromMouse()
        s_obj=attachedID    
        Set_Sat("zavareno",15,2,"koridor")        
    return; end;
    if obj_id == 12  then
      if attachedID ~= -1 then
        RemObjFromMouse()
      end;
      if flags.fire_complete then
        StopEmiter("fire_krysy_loc");
      end;
        RemObjFromMouse()
        s_obj=attachedID
        Set_Sat("krysy",15,1,"koridor")            
    return; end;
    if obj_id == obj.lomaot.id and flags.stop_fire then
      RemObjFromMouse()
      clicking_now=true      
      StoreObj(obj.lomato.id,obj_id,"448",335,350,"lom",290,217)
      StopEmiter("nog");
    return; end;
    if obj_id == 8 then
        playeffect("step_room")
        StopEmiter("Emitter")    
        RemObjFromMouse()     
        jump("koridor","electro",19,0);
    return; end;
    return;end;
  return; end;
  
end
function SheetSwitched(nCount)
end;