--Siegfried Fennig 20.02.2003 Rev.0

levelw = 20
levelh = 25

create_world(levelw, levelh)
draw_border("st-rock5")
enigma.ConserveLevel = FALSE
oxyd_default_flavor = "d"
fill_floor("fl-samba", 0,0, level_width,level_height)

function renderLine( line, pattern)
    for i=1, strlen(pattern) do
      local c = strsub( pattern, i, i)
      if c =="#" then
         fill_floor("fl-abyss", i-1,line, 1,1)
      elseif c == "o" then
         oxyd( i-1, line)
      elseif c == "r" then
         set_stone("st-rock5",i-1,line)
      elseif c == "i" then
         set_stone("st-stoneimpulse",i-1,line)
      elseif c == "t" then
         set_stone("st-shogun",i-1,line)
      elseif c == "v" then
         set_stone("st-yinyang1",i-1,line)
      elseif c == "w" then
         set_stone("st-break_acwhite",i-1,line)
      elseif c == "b" then
         set_stone("st-break_acblack",i-1,line)
      elseif c == "a" then
         set_stone("st-wood",i-1,line)
      elseif c == "h" then
         set_item("it-hammer",i-1,line)
      elseif c == "k" then
         set_item("it-key_a",i-1,line)
      elseif c == "z" then
         set_actor("ac-blackball", i-.5,line+.5, {player=0})
         set_item("it-yinyang", i-1, line+.5)
      elseif c == "y" then
         set_actor("ac-whiteball", i-.5,line+.5, {player=1})
         set_item("it-yinyang", i-1, line+.5)
        end
    end
end
--              01234567890123456789
renderLine(00, "                    ")
renderLine(01, "                    ")
renderLine(02, "  r                 ")
renderLine(03, "  r     rrr         ")
renderLine(04, "  r     r r      o  ")
renderLine(05, "  rrrrrrr r         ")
renderLine(06, "  a       r      o  ")
renderLine(07, "  rrrrrrr r         ")
renderLine(08, "  r     rwr      o  ")
renderLine(09, "  r     r r         ")
renderLine(10, " hrrrrrrr r      o  ")
renderLine(11, "      rrr r         ")
renderLine(12, "  t   rrr r         ")
renderLine(13, "   r  rrr r         ")
renderLine(14, "   r  rrr rrrrrrrrr ")
renderLine(15, "   r  rrr r         ")
renderLine(16, "   r  rrr rrrbtw y  ")
renderLine(17, "   r     bb  wr     ")
renderLine(18, "  rr   r w w  r wrr ")
renderLine(19, "   vtrtr r r  r     ")
renderLine(20, "  tii  r   r#  vrtr ")
renderLine(21, "   tiz r rrrvr   v  ")
renderLine(22, "      r  rwtw       ")
renderLine(23, "          wkw   r   ")
renderLine(24, "                    ")
--              01234567890123456789

oxyd_shuffle()

doorh( 1,10, {name="door1"})
function sdot1()
    doora=enigma.GetNamedObject("door1")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1( 8,17, {action="callback", target="sdot1"})

doorh( 1, 9, {name="door2"})
function sdot2()
    doora=enigma.GetNamedObject("door2")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1( 8,18, {action="callback", target="sdot2"})

doorh( 1, 8, {name="door3"})
function sdot3()
    doora=enigma.GetNamedObject("door3")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1(11,17, {action="callback", target="sdot3"})

doorh( 1, 7, {name="door4"})
function sdot4()
    doora=enigma.GetNamedObject("door4")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1(11,18, {action="callback", target="sdot4"})

doorh( 1, 5, {name="door5"})
function sdot5()
    doora=enigma.GetNamedObject("door5")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1( 9,17, {action="callback", target="sdot5"})

doorh( 1, 4, {name="door6"})
function sdot6()
    doora=enigma.GetNamedObject("door6")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1( 9,18, {action="callback", target="sdot6"})

doorh( 1, 3, {name="door7"})
function sdot7()
    doora=enigma.GetNamedObject("door7")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1(10,17, {action="callback", target="sdot7"})

doorh( 1, 2, {name="door8"})
function sdot8()
    doora=enigma.GetNamedObject("door8")
    enigma.SendMessage(doora, "openclose", nil)
end
shogundot1(10,18, {action="callback", target="sdot8"})

set_stone("st-key_a",16,21, {action="openclose", target="door9"})
doorv( 16,22, {name="door9"})