-- timer_count = 0;


flag = -1;
function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID)
-----------------------------------------------------------------------------------------------------------------------
    if sender==30 then --комикс завершился
        

    return;end;
    
    if sender == 100 then
      -- if deleteres then
      -- deleteres=false

       -- return;end;        
      if finish_comics then
        flags.comics_run=false;
        neighbors.stol.lock=false;
        LoadLocation("stol");
        neighbors.comics2.lock=true; 
        fromcomics2=true
        flags.is_comics=false    
        Block_Show_Cur(false)
        -- StopTimer(12542)
        -- PlayMusic()
        finish_comics=false
        SetCurrentRM("menu");
        ReplaceObjectToWnd1("s","starost6",102,43,93,170,false)
        SetCurrentRM("main");        
        jump("comics2","laborator",2,0);
      return;end;
      if frame == 40 then
        loadresource("data\\0\\51\\BigTexture9.png","BigTexture9",1)      
        addstaticobjecttogame(15,"BigTexture9",341,57 ,"",0,0,351,400); --свет алтаря
        addstaticobjecttogame(22,"BigTexture9",270,133,"",351,232,485,575); --свет пролома
        speciale_action(2,22);
        StopEmiter("pil_comics");
        StopEmiter("pil_comics2");
        StopEmiter("pil_comics3");
        speciale_action(2,25,true);
        speciale_action(2,24,true);
        speciale_action(2,22,true);
        MoveObjectY(23,322,822,3.5);
        playeffect("earth");
        penta_out=true
        set_visible_object(19,false)
        set_visible_object(20,false)
        -- SetAlfa(19,1,0,0.4)
        -- SetAlfa(20,1,0,0.4)
        MoveObjectY(18,164,822-158,3.5); --уезжает алтарь
        speciale_action(2,15);        
      return; end;
      if startHarugma then
       StartTimer(8881,0.12);
       end;
       
       -- if startHarugma then
       -- StartTimer(8881,0.12);
       -- end;
      -- messageboxi(timer_count);
      -- timer_count = timer_count + 1;
    return; end;
    
    if sender == 33 then  
      Block_Show_Cur(false);
    return;end;
---------------------------------------------------------------------------------------------------------------    
    if sender==28 then---- объект доехал
      if obj_id == 18 then
    
        MoveObjectY(17,802,102,3);        --102
        -- speciale_action(2,17);
        StartTimer(888777,0.5);
        -- messageboxi(timer_count);
        -- timer_count = timer_count + 1;
      return; end;
      if obj_id == 17 then
        speciale_action(2,16,true);
        ScaleObject(16,1,1.5,4,115,84);
      return; end;
    return;end;    
---------------------------------------------------------------------------------------------------------------
    if sender==29 then -- отработал скейл
      if obj_id == 16 then
        StartTimer(8882,1.5);
        -- messageboxi(timer_count);
        -- timer_count = timer_count + 1;
      return; end;
    return;end;
    
    -- if sender == 6 then
      -- if flag == 0 then
        -- set_text(1100,"226");
        -- flag = 1;
      -- return; end;
      -- if flag == 1 then
      -- return; end;
    -- return; end;
    
    if sender == 1 then --кликнули левой кнопкой мыши на активный объект
      if obj_id == 30 then
        --SetAlfa(501,0,1,2)
        finish_comics =true
        WaitRender()
      return; end;
    return;end;

    if sender==16 then
        if obj_id==43 then
            StartTimer(88829,0.5)
        return;end;
        if obj_id==50 then
            del_object_from_game(46)
            del_object_from_game(47)
            del_object_from_game(43)
            del_object_from_game(44)
            DeleteResource("com2cadr1_32");    
            DeleteResource("com2cadr1_33");    
            DeleteResource("com2cadr1_M" );    
            DeleteResource("com2cadr1_M" );
            addstaticobjecttogame(14,"BigTexture5",68 ,360,"",0,465,888,348); --кусок обрыва
            addstaticobjecttogame(16,"BigTexture6",380,178 ,"",533+19,720,240,304); --дух морда --788
            speciale_action(2,16);
            addstaticobjecttogame(17,"BigTexture6",333,802,"",0,367,371,468); --дух свет --102
            speciale_action(2,17);
            addstaticobjecttogame(18,"BigTexture6",396,164,"",820,736,204,288); --алтарь
            addstaticobjecttogame(19,"BigTexture6",282,325,"",473,0,454,233); --пента3
            addstaticobjecttogame(20,"BigTexture6",282,325,"",473,233,454,233); --пента2
            speciale_action(2,20);
            addstaticobjecttogame(23,"BigTexture6",276,322,"",0,0,473,365); --земля пролома
            addstaticobjecttogame(24,"BigTexture3",68 ,188,"",0,499,888,499); --земля с провалом
            speciale_action(2,24);
            addstaticobjecttogame(26,"BigTexture3",98 ,188,"",20,0,848,499); --земля целая
            addstaticobjecttogame(27,"com2cadr1_27",0 ,0 ,"",0,0,1024,768); --бг            
            speciale_action(2,43)
            speciale_action(2,46)
            speciale_action(2,47)
            speciale_action(2,501)
            StartTimer(88830,0.5)
        return;end;
    return;end;
    
    if sender==15 then
        if obj_id==50 then
            del_object_from_game(50)
            DeleteResource("com2cadr1_34" );    
            startHarugma =true
            flag = 0;
            StartTimer(7878,1)
        --    StartTimer(8881,0.12);
    
        return;end;
    return;end;
    
    if sender == 36 and not finish_comics then
      if obj_id==88828 then

         speciale_action(2,43,true,2);
         speciale_action(2,44,true,1.9);
         loadresource("data\\0\\51\\0001.png","com2cadr1_34",1)
         addstaticobjecttogame(50,"com2cadr1_34",0,0,""); --майкл старый
         speciale_action(2,50)
         speciale_action(4,50)
      return;end;

      if obj_id==88829 then
        loadresource("data\\0\\51\\0026.jpg","com2cadr1_27",1)
        loadresource("data\\0\\51\\BigTexture3.png","BigTexture3",1)
        loadresource("data\\0\\51\\BigTexture5.png","BigTexture5",1)
        loadresource("data\\0\\51\\BigTexture6.png","BigTexture6",1)
        speciale_action(2,50,true,1)
      return;end;
      
      if obj_id==88830 then
        speciale_action(2,50,true,2)
      return;end;    
    
      if obj_id==7878 then
        -- AddParticleToObject(30,"pil_comics",810,492);
        -- MoveEmiter("pil_comics",810,492);
        -- StartEmiter("pil_comics");
         -- AddParticleToObject(1,"pil_comics2",204,500);
        -- MoveEmiter("pil_comics2",204,500);
        -- StartEmiter("pil_comics2");
        -- AddParticleToObject(28,"pil_comics3",254,415);
        -- MoveEmiter("pil_comics3",254,415);
        -- StartEmiter("pil_comics3");
        StartTimer(8881,0.1);
        StartTimer(8889,1.1);
      return;end;
      
      if obj_id == 8889 then
        Block_Show_Cur(false);
      return; end;
      
      if obj_id == 888777 then
        speciale_action(2,17);
      return; end;
      
      if obj_id == 8881 then
          setcolor(1100,1,1,1,1,1); 
        if frame < 8 then --8
          -- for i=2,11,1 do
            -- speciale_action(2,i,true,0.11); --0.05
          -- end;
          if not penta_out then
          for i=19,20,1 do
            -- SetAlfa(i,1,0,0.4)
           speciale_action(2,i,true,0.4);
          end;
          end;
          frame = frame + 1;
          WaitRender();
        else
          frame = 40;
          AddParticleToObject(24,"upalo",476,650);
          MoveEmiter("upalo",476,650);
          StartEmiter("upalo");
          WaitRender();
        end;
      return; end;    
      if obj_id == 8882 then
      finish_comics=true;
      WaitRender()
      return; end;      
      

      
    return;end;    
end
function SheetSwitched(nCount)
end;