-- Siegfried Fennig 26.12.2002 Rev. 0

levelw = 20
levelh = 25

create_world(levelw, levelh)
draw_border("st-rock5")
fill_floor("fl-rough", 0,0, level_width,level_height)
fill_floor("fl-water", 3,17, 16,2)
fill_floor("fl-water", 3,22, 16,2)
fill_floor("fl-water", 3,11,  2,5)
fill_floor("fl-water",17,11,  2,5)
fill_floor("fl-water", 7,13,  6,1)
fill_floor("fl-water", 8,15,  4,1)

oxyd_default_flavor = "c"

oxyd ( 3,21)
oxyd ( 5,19)
oxyd ( 7,21)
oxyd ( 9,20)
oxyd (11,19)
oxyd (13,20)
oxyd (15,19)
oxyd (17,21)
oxyd ( 5,11)
oxyd (14,13)
oxyd ( 6,15)
oxyd (13,15)

oxyd_shuffle()

draw_stones("st-rock5", { 2, 2}, {0,1}, 4)
draw_stones("st-rock5", { 2, 6}, {1,0}, 2)
draw_stones("st-rock5", { 2, 8}, {1,0}, 2)
draw_stones("st-rock5", { 4, 2}, {1,0}, 3)
draw_stones("st-rock5", { 4, 4}, {1,0}, 2)
draw_stones("st-rock5", { 5, 6}, {1,0}, 3)
draw_stones("st-rock5", { 5, 8}, {1,0}, 3)
draw_stones("st-rock5", { 7, 1}, {0,1}, 4)
draw_stones("st-rock5", { 9, 1}, {1,0}, 2)
draw_stones("st-rock5", { 9, 3}, {1,0}, 2)
draw_stones("st-rock5", {10, 7}, {1,0}, 3)
draw_stones("st-rock5", { 9, 4}, {0,1}, 4)
draw_stones("st-rock5", {11, 5}, {1,0}, 2)
draw_stones("st-rock5", {12, 4}, {1,0}, 3)
draw_stones("st-rock5", {14, 2}, {1,0}, 3)
draw_stones("st-rock5", {16, 4}, {1,0}, 2)
draw_stones("st-rock5", {14, 6}, {1,0}, 4)
draw_stones("st-rock5", {14, 8}, {1,0}, 4)
draw_stones("st-rock5", {13, 9}, {1,0}, 2)
draw_stones("st-rock5", {18, 1}, {0,1}, 2)
draw_stones("st-rock5", { 2,10}, {1,0}, 5)
draw_stones("st-rock5", { 8,10}, {1,0}, 4)
draw_stones("st-rock5", {13,10}, {1,0}, 6)
draw_stones("st-rock5", { 2,16}, {1,0},17)
draw_stones("st-rock5", { 2,17}, {0,1}, 2)
draw_stones("st-rock5", { 2,20}, {0,1}, 4)
draw_stones("st-rock5", { 2,11}, {0,1}, 5)
set_stones("st-rock5", {{5,5},{9,9},{11,9},{12,1},{12,3},{16,3}})
set_stones("st-rock5", {{3,17},{5,17},{7,17},{9,17},{11,17},
                       {13,17},{15,17},{17,17}})
set_stones("st-rock5", {{3,23},{5,23},{7,23},{9,23},{11,23},
                       {13,23},{15,23},{17,23}})
set_stones("st-rock5", {{3,11},{3,13},{3,15},{18,11},{18,13},{18,15}})

set_stone("st-oneway", 2, 7, {orientation=enigma.EAST})
set_stone("st-oneway", 4, 3, {orientation=enigma.EAST})
set_stone("st-oneway", 5, 7, {orientation=enigma.EAST})
set_stone("st-oneway", 7, 7, {orientation=enigma.EAST})
set_stone("st-oneway", 7, 9, {orientation=enigma.EAST})
set_stone("st-oneway", 9, 2, {orientation=enigma.EAST})
set_stone("st-oneway", 9, 8, {orientation=enigma.EAST})
set_stone("st-oneway",12, 2, {orientation=enigma.EAST})
set_stone("st-oneway",14, 1, {orientation=enigma.EAST})
set_stone("st-oneway",14, 3, {orientation=enigma.EAST})
set_stone("st-oneway",15, 5, {orientation=enigma.WEST})
set_stone("st-oneway",17, 5, {orientation=enigma.WEST})
set_stone("st-oneway",18, 6, {orientation=enigma.WEST})
set_stone("st-oneway", 1, 4, {orientation=enigma.NORTH})
set_stone("st-oneway", 3, 2, {orientation=enigma.NORTH})
set_stone("st-oneway", 4, 6, {orientation=enigma.NORTH})
set_stone("st-oneway", 7,10, {orientation=enigma.NORTH})
set_stone("st-oneway", 8, 4, {orientation=enigma.NORTH})
set_stone("st-oneway",13, 7, {orientation=enigma.NORTH})
set_stone("st-oneway", 1, 6, {orientation=enigma.SOUTH})
set_stone("st-oneway", 1, 8, {orientation=enigma.SOUTH})
set_stone("st-oneway", 4, 8, {orientation=enigma.SOUTH})
set_stone("st-oneway", 6, 4, {orientation=enigma.SOUTH})
set_stone("st-oneway",11, 3, {orientation=enigma.SOUTH})
set_stone("st-oneway",15, 4, {orientation=enigma.SOUTH})
set_stone("st-oneway",18, 7, {orientation=enigma.SOUTH})

set_stone("st-switch", 11,1, {action="openclose", target="door1"})
set_stone("st-switch", 10,9, {action="openclose", target="door2"})
doorh(12, 9, {name="door1"})
doorh(12,10, {name="door2"})

swc1 = 0;
function sw1()
   if (swc1 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder01"), "direction",SOUTH)
      swc1 = 1
   end
end
function sw2()
   if (swc1 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder01"), "direction",NORTH)
      swc1 = 0
   end
end
set_stone("st-bolder",  4,21, {name="bolder01", direction=NORTH})
set_item("it-trigger",  4,17, {invisible=1, action="callback", target="sw1"})
set_item("it-trigger",  4,23, {invisible=1, action="callback", target="sw2"})

swc2 = 0;
function sw3()
   if (swc2 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder02"), "direction",SOUTH)
      swc2 = 1
   end
end
function sw4()
   if (swc2 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder02"), "direction",NORTH)
      swc2 = 0
   end
end
set_stone("st-bolder",  6,22, {name="bolder02", direction=NORTH})
set_item("it-trigger",  6,17, {invisible=1, action="callback", target="sw3"})
set_item("it-trigger",  6,23, {invisible=1, action="callback", target="sw4"})

swc3 = 0;
function sw5()
   if (swc3 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder03"), "direction",NORTH)
      swc3 = 1
   end
end
function sw6()
   if (swc3 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder03"), "direction",SOUTH)
      swc3 = 0
   end
end
set_stone("st-bolder",  8,19, {name="bolder03", direction=SOUTH})
set_item("it-trigger",  8,23, {invisible=1, action="callback", target="sw5"})
set_item("it-trigger",  8,17, {invisible=1, action="callback", target="sw6"})

swc4 = 0;
function sw7()
   if (swc4 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder04"), "direction",SOUTH)
      swc4 = 1
   end
end
function sw8()
   if (swc4 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder04"), "direction",NORTH)
      swc4 = 0
   end
end
set_stone("st-bolder", 10,21, {name="bolder04", direction=NORTH})
set_item("it-trigger", 10,17, {invisible=1, action="callback", target="sw7"})
set_item("it-trigger", 10,23, {invisible=1, action="callback", target="sw8"})

swc5 = 0;
function sw9()
   if (swc5 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder05"), "direction",SOUTH)
      swc5 = 1
   end
end
function sw10()
   if (swc5 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder05"), "direction",NORTH)
      swc5 = 0
   end
end
set_stone("st-bolder", 12,18, {name="bolder05", direction=NORTH})
set_item("it-trigger", 12,17, {invisible=1, action="callback", target="sw9"})
set_item("it-trigger", 12,23, {invisible=1, action="callback", target="sw10"})

swc6 = 0;
function sw11()
   if (swc6 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder06"), "direction",SOUTH)
      swc6 = 1
   end
end
function sw12()
   if (swc6 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder06"), "direction",NORTH)
      swc6 = 0
   end
end
set_stone("st-bolder", 14,19, {name="bolder06", direction=NORTH})
set_item("it-trigger", 14,17, {invisible=1, action="callback", target="sw11"})
set_item("it-trigger", 14,23, {invisible=1, action="callback", target="sw12"})

swc7 = 0;
function sw13()
   if (swc7 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder07"), "direction",SOUTH)
      swc7 = 1
   end
end
function sw14()
   if (swc7 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder07"), "direction",NORTH)
      swc7 = 0
   end
end
set_stone("st-bolder", 16,21, {name="bolder07", direction=NORTH})
set_item("it-trigger", 16,17, {invisible=1, action="callback", target="sw13"})
set_item("it-trigger", 16,23, {invisible=1, action="callback", target="sw14"})

swc8 = 0;
function sw15()
   if (swc8 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder08"), "direction",EAST)
      swc8 = 1
   end
end
function sw16()
   if (swc8 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder08"), "direction",WEST)
      swc8 = 0
   end
end
set_stone("st-bolder",  6,12, {name="bolder08", direction=WEST})
set_item("it-trigger",  3,12, {invisible=1, action="callback", target="sw15"})
set_item("it-trigger", 18,12, {invisible=1, action="callback", target="sw16"})

swc9 = 0;
function sw17()
   if (swc9 == 0) then
      enigma.SendMessage(enigma.GetNamedObject("bolder09"), "direction",EAST)
      swc9 = 1
   end
end
function sw18()
   if (swc9 == 1) then
      enigma.SendMessage(enigma.GetNamedObject("bolder09"), "direction",WEST)
      swc9 = 0
   end
end
set_stone("st-bolder", 14,14, {name="bolder09", direction=WEST})
set_item("it-trigger",  3,14, {invisible=1, action="callback", target="sw17"})
set_item("it-trigger", 18,14, {invisible=1, action="callback", target="sw18"})

set_actor("ac-blackball", 1.5, 5.5, {player=0})
