SetActivLeaf("vhod_turmy");
Spirit_Particles()
s_obj=0

direct_gate="left"

BackToPr={
0,595,
1024,595,
1024,768,
0,768
}

ToPrison={
235,313,
328,343,
334,430,
256,399
}

Gen={
596,342,
703,342,
703,429,
596,429
}

Bush={
739,366,
842,366,
842,447,
739,447
}

Gate_pile={
0,396,
385,396,
385,609,
0,609
}
AddObjForCur()
addstaticobjecttogame(111,"tuman",0,554,"");
MoveTexture(111,0.0001,0.0)
speciale_action(10,111)


CreatePolygon(11,4,"ToPrison")
speciale_action(2,11);

CreatePolygon(3,4,"Gate_pile")


CreatePolygon(9,4,"BackToPr")

NewObj("kosa","kosa",2000,2000,"326"); --коса
NewObj("koas","vhod_turmy",385,309,"326",795,0,131,249); --коса


if obj.koas.is_collapsed then
  speciale_action(2,2);
end;

addstaticobjecttogame(16,"vhod_turmy",852,272,"",520,0,152,277);
addstaticobjecttogame(17,"vhod_turmy",857,274,"",672,0,123,276);

speciale_action(2,16)
speciale_action(2,17)

addstaticobjecttogame(4,"vhod_turmy",480,252,"",926,0,58,309); --ворота открыты
speciale_action(2,4);
addstaticobjecttogame(19,"vhod_turmy",848,272,"",344,0,176,274); --ворота открыты
speciale_action(2,19);
addactivobjecttogame(5,"vhod_turmy",531,246,"","",0,0,0,0,344,301); --ворота закрыты

addstaticobjecttogame(112,"tuman",0,271,"");
MoveTexture(112,0.00009,0.0)
speciale_action(10,112)

CreatePolygon(6,4,"Bush")
speciale_action(2,6)
CreatePolygon(7,4,"Gen")
speciale_action(2,7)


addstaticobjecttogame(42,"clouds2",0  ,-40  ,"");
MoveTexture(42,-0.00002,0.0)


addstaticobjecttogame(8,"vhod_turmy8",0  ,0  ,""); --бг

addfade(501,0);

if flags.turma_zamok then
  speciale_action(2,4);
  speciale_action(2,19);
  speciale_action(2,19,true,3.2);
  speciale_action(2,17,true,3.4);  
  speciale_action(2,5);
  speciale_action(2,11);
  speciale_action(2,6)
  speciale_action(2,7)
end;



if flags.hidden_metall then
  ActivateObject(3,false);
end;



if flags.hidden_metall_dwa then
  ActivateObject(3,false);
end;

if flags.kusty then
  ActivateObject(6,false);
end;

if flags.generator then
  ActivateObject(7,false);
end;