SetActivLeaf("to_another_world");
Spirit_Particles()
Idol1={
628,422,
650,422,
650,520,
628,520
}

Idol2={
591,423,
620,423,
620,523,
591,523
}

Idol3={
368,255,
395,255,
395,355,
368,355
}

Idol4={
390,355,
415,355,
415,455,
390,455
}

Idol5={
342,354,
387,354,
387,454,
342,454
}

Back={
0,577,
1024,577,
1024,768,
0,768
}

ToAn_World={
314,154,
719,154,
719,630,
314,630
}

Part={
0,0,
1,0,
1,1,
0,1
}

CreatePolygon(15,4,"Back")

CreatePolygon(800,4,"Part")
CreatePolygon(803,4,"Part")
CreatePolygon(801,4,"Part")
CreatePolygon(802,4,"Part")

CreatePolygon(811,4,"Part")
CreatePolygon(804,4,"Part")
CreatePolygon(805,4,"Part")
CreatePolygon(806,4,"Part")
CreatePolygon(807,4,"Part")
CreatePolygon(808,4,"Part")
CreatePolygon(809,4,"Part")
CreatePolygon(810,4,"Part")


AddObjForCur()
addstaticobjecttogame( 60,"an_tuman",0  ,0  ,""); --бг
MoveTexture(60,0.00007,0.0)
addstaticobjecttogame( 1,"to_another_world_01",0  ,0  ,""); --арка и туман
-------------------------------------------
addstaticobjecttogame( 2,"to_another_world_02",632,426,""); --идол1
addstaticobjecttogame( 3,"to_another_world_02",593,427,""); --идол2
addstaticobjecttogame( 4,"to_another_world_02",370,259,""); --идол3
addstaticobjecttogame( 5,"to_another_world_02",391,358,""); --идол4
addstaticobjecttogame( 6,"to_another_world_02",345,356,""); --идол5
for i = 2, 6, 1 do
  speciale_action(2,i);
end;
-------------------------------------------
CreatePolygon(10,4,"Idol1")
CreatePolygon(11,4,"Idol2")
CreatePolygon(12,4,"Idol3")
CreatePolygon(13,4,"Idol4")
CreatePolygon(14,4,"Idol5")

-------------------------------------------
lock={
437,250,
575,250,
575,470,
437,470
}
CreatePolygon(7,4,"lock")
speciale_action(2,7)

addstaticobjecttogame(51,"to_another1",486,380,"",0,0,40,135); --планочка левая
addstaticobjecttogame(50,"to_another1",544,374,"",40,0,202,231); --штука с идолами правая
addstaticobjecttogame(49,"to_another1",465,400,"",242,0,264,90); --засов правый
addstaticobjecttogame(48,"to_another1",542,477,"",242,90,137,148);--шестерёнка правая
--SetHotPoint(48,610-542,550-477)
SetHotPoint(48,69,64)
addstaticobjecttogame(47,"to_another1",511,116,"",506,0,290,548); --закрытая правая

addstaticobjecttogame(46,"to_another1",512,285,"",0,135,40,135); --планочка правая
addstaticobjecttogame(45,"to_another1",263,230,"",40,231,198,293); --штука с идолами- левая
addstaticobjecttogame(44,"to_another1",301,311,"",506,548,268,89); -- засов левый
addstaticobjecttogame(43,"to_another1",345,187,"",242,238,142,156); --шестерёнка левая
--SetHotPoint(43,424-345,252-187)
SetHotPoint(43,73,64)
addstaticobjecttogame(42,"to_another2",226,116,"",0,0,289,548); --левая закрытая
addstaticobjecttogame(41,"to_another2",711,131,"",289,0,90,533); --правая открытая
addstaticobjecttogame(40,"to_another2",216,136,"",379,0,104,550); --левая открытая
if not flags.zamok_in_world then
    speciale_action(2,40)
    speciale_action(2,41)
end;

if flags.zamok_in_world then
    for i=42,51,1 do
        speciale_action(2,i)
    end;
end;

CreatePolygon(16,4,"ToAn_World")
speciale_action(2,16)

addstaticobjecttogame( 9,"to_another_world_09",0  ,0  ,""); --бг

addfade(501,0);



if flags.idol_one then
  speciale_action(2,2);
  ActivateObject(10,false);
end;

if flags.idol_two then
  speciale_action(2,3);
  ActivateObject(11,false);
end;

if flags.idol_three then
  speciale_action(2,4);
  ActivateObject(12,false);
end;

if flags.idol_four then
  speciale_action(2,5);
  ActivateObject(13,false);
end;

if flags.idol_five then
  speciale_action(2,6);
  ActivateObject(14,false);
end;



if flags.idol_one and flags.idol_two and flags.idol_three and flags.idol_four and flags.idol_five and not  flags.zamok_in_world then
    speciale_action(2,7)
    AddParticleToObject(811,"EyeS1",166,191);
    MoveEmiter("EyeS1",166,191);
    StartEmiter("EyeS1");

    AddParticleToObject(804,"EyeS2",212,188);
    MoveEmiter("EyeS2",212,188);
    StartEmiter("EyeS2");

    AddParticleToObject(805,"EyeS3",161,375);
    MoveEmiter("EyeS3",161,375);
    StartEmiter("EyeS3");

    AddParticleToObject(806,"EyeS4",211,374);
    MoveEmiter("EyeS4",211,374);
    StartEmiter("EyeS4");

    AddParticleToObject(807,"EyeS5",826,203);
    MoveEmiter("EyeS5",826,203);
    StartEmiter("EyeS5");

    AddParticleToObject(808,"EyeS6",851,202);
    MoveEmiter("EyeS6",851,202);
    StartEmiter("EyeS6");

    AddParticleToObject(809,"EyeS7",830,392);
    MoveEmiter("EyeS7",830,392);
    StartEmiter("EyeS7");

    AddParticleToObject(810,"EyeS8",857,392);
    MoveEmiter("EyeS8",857,392);
    StartEmiter("EyeS8");


    AddParticleToObject(800,"EyeG",460,48);
    MoveEmiter("EyeG",460,48);
    StartEmiter("EyeG");
    AddParticleToObject(803,"EyeG1",556,48);
    MoveEmiter("EyeG1",556,48);
    StartEmiter("EyeG1");  
end;

if flags.zamok_in_world then
--  speciale_action(2,7);
  speciale_action(2,8);
  speciale_action(2,16)
  for i = 2, 6, 1 do
    speciale_action(2,i);
  end;
  for i = 10, 14, 1 do
    speciale_action(2,i);
  end;
  
end;