SetActivLeaf("parom_main");
Spirit_Particles()
To_Pris={
0,0,
330,0,
330,250,
0,250
}



To_MP={
459,600,
1024,600,
1024,768,
459,768
}


Box={
367,402,
215,281,
377,275,
600,381,
600,600,
383,529,
208,403
}

Wheel={
465,71,
650,71,
650,339,
465,339
}

Auto={
465,71,
654,71,
654,303,
465,303
}

P_Luk={
558,240,
698,240,
698,275,
558,275
}

AddObjForCur()
CreatePolygon(20,4,"To_Pris")
speciale_action(2,20);


CreatePolygon(16,4,"To_MP")


addstaticobjecttogame( 80,"p_main_big" ,6,309 ,"",0,264+373,83,300); --борт
addstaticobjecttogame( 81,"p_main_big" ,42,395,"",585,0,163,373); --борт
addstaticobjecttogame( 82,"p_main_big" ,0,309 ,"",83,264+373,88,297); --борт
addstaticobjecttogame( 83,"p_main_big" ,31,395,"",412,0,173,373); --борт

 speciale_action(2,81)
 speciale_action(2,82)
 
 speciale_action(2,80,true,3.7)
 speciale_action(2,83,true,3.7)
 speciale_action(2,82,true,4)
 speciale_action(2,81,true,4)


addactivobjecttogame( 3,"p_main_big" ,198,261,"","",0,0,0,0,412,155); --крышка
CreatePolygon(4,7,"Box")
NewObj("napiln","napiln" ,2000,2000,"209"); --напильник



CreatePolygon(18,4,"Wheel")


addstaticobjecttogame( 7,"parom_main5" ,447,0  ,""); --машина без колеса

CreatePolygon(19,4,"Auto")
speciale_action(2,19);
set_pixel_check(19,false)

addstaticobjecttogame( 8,"parom_main7" ,237,0  ,""); --машина с колесом
speciale_action(2,8);
NewObj("napinl","p_main_big" ,664,322,"209",601,264+373,71,50); --напильник
addactivobjecttogame( 9,"p_main_big" ,543,138,"","",0,0,171,264+373,154,155); --открытый люк
speciale_action(2,9);

CreatePolygon(10,4,"P_Luk")
speciale_action(2,10)

addactivobjecttogame(11,"parom_main9",0  ,0  ,"",""); --рубка


addstaticobjecttogame(13,"p_main_big",24 ,72 ,"",0,154+373,1000,110); --натянутый канат
speciale_action(2,13);
addstaticobjecttogame(14,"p_main_big",24 ,72 ,"",0,373,1000,154); --спущенный канат

add_animation(122)
add_animation_frame(122,"seagul_sm",1024,40,0 ,0 ,40,42,0.1);
add_animation_frame(122,"seagul_sm",1024,40,40,0 ,40,42,0.1);
add_animation_frame(122,"seagul_sm",1024,40,80,0 ,40,42,0.1);
add_animation_frame(122,"seagul_sm",1024,40,0 ,0 ,40,42,0.1);
StartAnimation(122)
flySeagulp = {"InstantiationOfLine", 2, -100, 40, 1024, 20, 5, false};
StartTravel(122,1,nil,nil,flySeagulp);
StartTimer(1223,30)


addstaticobjecttogame(21,"clouds",0  ,-100,"");
MoveTexture(21,0.00002,0.0)
addstaticobjecttogame(15,"parom_main12",0  ,0  ,""); --бг
  AddParticleToObject(15,"water4",356,103);
  MoveEmiter("water4",356,103);
  StartEmiter("water4");
addfade(501,0);

maselko=false

if flags.masloM then
    maselko=true;

    speciale_action(2,3);    
end;

if flags.lebedka then
  speciale_action(2,13);
  speciale_action(2,14);
  flags.g_tros = true;
end;

if flags.motor then
  ActivateObject(9,false);
  speciale_action(2,20);
end;

if (flags.auto or flags.is_coleso)  then
      speciale_action(2,8);
      speciale_action(2,7);
      speciale_action(2,18);
      speciale_action(2,19);
end;



    
if flags.ugon_auto then
  speciale_action(2,8);
  speciale_action(2,19);
end;
    
if not flags.luk_parom and flags.ugon_auto then
  speciale_action(2,10)
end;
    
if flags.luk_parom and not flags.motor then
  ActivateObject(10,false);
  speciale_action(2,9);
  ActivateObject(9,true);
end;
    
if not flags.conteiner then
  if not maselko then
    maselko=true;
  end;
end;

if flags.conteiner then
  if not maselko then
  maselko=true;  
  speciale_action(2,3);
    end;
  ActivateObject(4,false);
end;


if flags.hidden_rubka then
  ActivateObject(11,false);
end;

