local voln = 0.7;
local tros = 0.4;
local speed = 11;
local finish = false;

function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID)
-----------------------------------------------------------------------------------------------------------------------

    if sender==33 then
      if obj_id==501 and changeframe then
        changeframe=false
        speciale_action(2,22)
        speciale_action(2,21)
        StartTimer(8881,0.7)
      end;
    end;
    if sender==28 then---- объект доехал
      if obj_id  == 22 then
        if vverh then
            vverh=false
            MoveObjectY(22,475,495,1.5);                
        else
            vverh=true
            MoveObjectY(22,495,475,1.5);        
        end;
      return;end;
      if obj_id  == 13 then
      if not movex then
        if vverh1 then
            vverh1=false
            MoveObjectY(13,353,343,1.3);                
        else
            vverh1=true
            MoveObjectY(13,343,353,1.3);        
        end;
      else
      MoveObjectX(13,481,481+1024,speed);
        end;      
      return;end;      
      if obj_id  == 19 then
        movex=true
        --speciale_action(4,2);
    --    SetAlfa(2,0,1,5)
    --    StartTimer(8882,5);
      AddGlobalFade(19999999,0);
      speciale_action(4,19999999)
      SetAlfa(19999999,0,1,2)      
      StartTimer(565656,2.2)    
      return; end;
    return;end;    
---------------------------------------------------------------------------------------------------------------

    if sender == 1 then --кликнули левой кнопкой мыши на активный объект
   --   finish = true;
      AddGlobalFade(19999999,0);
      speciale_action(4,19999999)
      SetAlfa(19999999,0,1,2)      
      StartTimer(565656,2.2)
--      DarkScreen1(true);
    return;end;

    
    if sender == 6 then  
    return; end; 
    
    if sender == 15 then
      if obj_id == 4 and light==4 then
     -- finish = true;

    --  DarkScreen1(true);
      return; end;       
    return; end;
    
    if sender == 16 then
    ---------------волны-------------------------

      if obj_id == 9 then
        speciale_action(2,10,true,voln);
        speciale_action(2,9,true,voln-1);
      return; end;
      if obj_id == 10 then
        speciale_action(2,9,true,voln);
        speciale_action(2,10,true,voln-1);
      return; end;
    ----------------трос---------------------------
      if obj_id == 15 then
        speciale_action(2,16,true,tros);
        speciale_action(2,15,true,tros);
      return; end;
      if obj_id == 16 then
        speciale_action(2,14,true,tros);
        speciale_action(2,16,true,tros);
      return; end;
      if obj_id == 14 then
        speciale_action(2,15,true,tros);
        speciale_action(2,14,true,tros);
      return; end;
    --------------молния----------------------------
      if obj_id == 4 then
        playeffect("groza")
        speciale_action(2,4,true,4);
      return; end;
    return; end;
    
    if sender == 36 then
      if obj_id==77776 then
        if light==1 then
            SetObjectPosition(4,62,28)
            speciale_action(2,4,0.3);
            light=2
            StartTimer(77776,5)
        return;end;
        if light==2 then
            SetObjectPosition(4,462,28)
            speciale_action(2,4,0.3);
            light=3
            StartTimer(77776,5)
        return;end;        
        if light==3 then
            SetObjectPosition(4,-200,28)
            speciale_action(2,4,0.3);
            -- light=3
            -- StartTimer(77776,5)
        return;end;                
      return;end;
      
      if obj_id == 565656 then
          neighbors.comics6.lock=true;
          neighbors.parom.lock=true;    
          neighbors.parom_main.lock=true;      
          flags.is_comics=false    
          -- StopTimer(12542)
          -- PlayMusic()
          jump("comics6","prichal_turmy",12,0); 
          jumpfromcomics=true        
      return;end;
      
      if obj_id==8888 then
         addfade(501,0)
         changeframe=true

          loadresource("data\\10\\50\\comics6_b.png","comics6_b",1)
          loadresource("data\\10\\50\\0018.jpg","com6_18",1)
          addstaticobjecttogame(19,"com6_18",   0,   0,"",0,0,2048,768); --бг

         SetAlfa(501,0,1,1)
         StartTimer(8887,2)
         -- StartTimer(8881,1.8)
      return;end;

      if obj_id==8887 then
      del_object_from_game(21)
      del_object_from_game(22)
               DeleteResource("com6_20");
            DeleteResource("com6_21");
            addstaticobjecttogame( 3,"comics6_b",0   , 341,"",0,299,2048,258); --туман
            addstaticobjecttogame(12,"comics6_b",   0, 469,"",0,0,2048,299); --море ближн
            addstaticobjecttogame(14,"comics6_b",   0, 480,"",0,568,2017,11); --трос3
            addstaticobjecttogame(15,"comics6_b",   0, 469,"",0,557,2017,11); --трос2
            speciale_action(2,15);
            addstaticobjecttogame(16,"comics6_b",   0, 477,"",0,579,2048,3); --трос1
            speciale_action(2,16);
          speciale_action(4,16)
          speciale_action(4,15)
          speciale_action(4,14)
            speciale_action(4,13)
            speciale_action(4,4)
          speciale_action(4,12)
          speciale_action(4,3)
          speciale_action(4,1)
          speciale_action(4,20)
          -- speciale_action(4,2);
        vverh1=true
        MoveObjectY(13,343,353,1.5);          
          --
         SetAlfa(501,1,0,1)

      return;end;
      if obj_id==8983 then
          AddGlobalFade(19999999,0);
          speciale_action(4,19999999)
          SetAlfa(19999999,0,1,2)      
          StartTimer(565656,2.2)      
      return;end;
      
      if obj_id==8984 then
        SetObjectPosition(4,262,  28)
        speciale_action(2,4,true,0.3);
        speciale_action(2,5,true);
        speciale_action(2,6,true);
        speciale_action(2,7,true);
      return;end;
      
      if obj_id == 8889 then
        playeffect("fon_storm",true);        
        Block_Show_Cur(false);        
        StartTimer(8888,5)
        speciale_action(2,10,true,voln)
        speciale_action(2,9,true,voln-1);
      return; end;      
      if obj_id == 8881 then
        playeffect("fon_storm",true);
        Block_Show_Cur(false);
        MoveObjectX(2,1254,1254-1024,speed);
        MoveObjectX(3,0,0-1024,speed);
        MoveObjectX(11,860,860-1024,speed);
        MoveObjectX(12,0,0-1024,speed);
        MoveObjectX(16,0,0-1024,speed);
        MoveObjectX(17,0,0-1024,speed);
        MoveObjectX(18,-500,-500-1024,speed);
        MoveObjectX(19,0,0-1024,speed);        
        StartTimer(8883,3.5)
        StartTimer(8983,speed-2)
        StartTimer(8984,speed-3)
        speciale_action(2,15,true,tros);
        speciale_action(2,14,true,tros);
      return; end;
      -- if obj_id == 8882 then
        -- light=4
        
        -- SetObjectPosition(4,262,  28)
        -- speciale_action(2,4,true,0.3);
        -- speciale_action(2,5,true);
        -- speciale_action(2,6,true);
        -- speciale_action(2,7,true);
      -- return; end;
      if obj_id == 8883 then
        RotateObject(5,360,0,40,true);
        speciale_action(2,5,true);--\
        speciale_action(2,6,true);---> появление мачехи
        speciale_action(2,7,true);--|
      return; end;       
    return;end;    
end
function SheetSwitched(nCount)
end;