maslo=false
kriski=false;

SetActivLeaf("koridor");
Spirit_Particles()
To_Electro={
470,144,
614,144,
614,469,
470,469
}

To_Pris={
0,639,
1024,639,
1024,768,
0,768
}

Rats={
401,519,
709,519,
709,590,
401,590
}
AddObjForCur()
addfade(1,0.7)
speciale_action(10,1);
if flags.generator then
  speciale_action(2,1);
end;

addstaticobjecttogame( 3,"koridor",410,0  ,"",752,0,253,179); --свет лампы
if not flags.generator then
  speciale_action(2,3);
end;

CreatePolygon(12,4,"Rats")
CreatePolygon(11,4,"To_Pris")


CreatePolygon(13,4,"To_Electro")
speciale_action(2,13)
addstaticobjecttogame(50,"koridorg",953 ,800,"",0,0,15,28);
addstaticobjecttogame(51,"koridorg",71 ,800,"",15,0,15,28);
addstaticobjecttogame(52,"koridorg",71 ,800,"",15,0,15,28);

k_gad1 = {"InstantiationOfLine", 2,1020,654,770, 60, 15, true};
k_gad2 = {"InstantiationOfLine", 2,302, 79 ,750, 78, 25, true};
k_gad3 = {"InstantiationOfLine", 2,292,481, -50, -50,  25, true};

StartTravel(51,1,nil,nil,k_gad2);
StartTimer(4219999,2)
StartTimer(4239999,3)
speciale_action(2,50)
speciale_action(2,52)

add_animation(5)
add_animation_frame(5, "koridor4" ,462,434,327,0,163,178,5)
add_animation_frame(5, "koridor4" ,462,434,164,0,163,178,0.5)
add_animation_frame(5, "koridor4" ,461,427,0,0,164,185,1)
StartAnimation(5)


NewObj("lomato","lom",2000,2000,"448"); --лом
NewObj("lomaot","koridor",737,278,"448",752,179,37,237); --лом
set_pixel_check(obj.lomaot.id,false)

if obj.lomaot.is_collapsed then
  speciale_action(2,7);
end;
addstaticobjecttogame( 8,"koridor",469,143,"",532,0,220,366); --рез дверь
speciale_action(2,8);
addstaticobjecttogame( 9,"koridor",256,471,"",0,0,532,263); --топливо
speciale_action(2,9);


addstaticobjecttogame(10,"koridor9",0  ,0  ,""); --бг




  AddParticleToObject(10,"SvetMig2",538,56);
  MoveEmiter("SvetMig2",538,56);
  StartEmiter("SvetMig2");
  
addfade(501,0);





-- set_pixel_check(12,false);

if flags.solar_completeM and not flags.stop_fire then
    maslo=true;
    speciale_action(2,9);
end;

if flags.fire_complete and (not flags.stop_fire) then
    if not kriski then
        kriski=true;    
        --speciale_action(2,12)
        speciale_action(2,5)    
    end;    
    if not maslo then
        maslo = true;
        speciale_action(2,9);
    end;
end;

if flags.stop_fire then
   if not kriski then
      kriski=true;     
    --  
      speciale_action(2,5);
  end;
  speciale_action(2,12);
    set_visible_object(9,false)
  speciale_action(2,13)
end;

if flags.zavareno then
  speciale_action(2,13);
  speciale_action(2,8);
  ActivateObject(8,true);
end;