--Siegfried Fennig 02.05.2003 Rev.0

levelw = 20
levelh = 13

create_world(levelw, levelh)
draw_border("st-glass2")
enigma.ConserveLevel = FALSE
oxyd_default_flavor = "d"
fill_floor("fl-abyss", 0, 0, level_width, level_height)
fill_floor("fl-marble", 1, 1, level_width-2, level_height-2)

function renderLine( line, pattern)
    for i=1, strlen(pattern) do
      local c = strsub( pattern, i, i)
      if c =="s" then
         set_stone("st-stoneimpulse",i-1,line)
      elseif c == "c" then
         set_stone("st-stoneimpulse-hollow",i-1,line)
      elseif c == "g" then
         set_stone("st-glass2",i-1,line)
      elseif c == "H" then
         set_stone("st-glass2_hole",i-1,line)
      elseif c == "A" then
         set_stone("st-stoneimpulse",i-1,line, {name="impulse1"})
      elseif c == "B" then
         set_stone("st-stoneimpulse",i-1,line, {name="impulse2"})
      elseif c == "C" then
         set_stone("st-stoneimpulse-hollow",i-1,line, {name="impulse3"})
      elseif c == "D" then
         set_stone("st-stoneimpulse-hollow",i-1,line, {name="impulse4"})
      elseif c == "E" then
         set_stone("st-stoneimpulse-hollow",i-1,line, {name="impulse5"})
      elseif c == "N" then
         set_stone("st-oneway",i-1,line, {orientation=enigma.NORTH})
      elseif c == "S" then
         set_stone("st-oneway",i-1,line, {orientation=enigma.SOUTH})
      elseif c == "w" then
         set_stone("st-wood",i-1,line)
      elseif c == "1" then
         set_item("it-trigger",i-1,line, {action="callback", target="st1"})
      elseif c == "2" then
         set_item("it-trigger",i-1,line, {action="callback", target="st2"})
      elseif c == "3" then
         set_item("it-trigger",i-1,line, {action="callback", target="st3"})
      elseif c == "4" then
         set_item("it-trigger",i-1,line, {action="callback", target="st4"})
      elseif c == "5" then
         set_item("it-trigger",i-1,line, {action="callback", target="st5"})
      elseif c == "o" then
         oxyd( i-1, line)
      elseif c == "#" then
         set_item("it-seed",i-1,line)
      elseif c == "a" then
         set_actor("ac-blackball", i-.5,line+.5, {player=0})
        end
    end
end

--              01234567890123456789
renderLine(00, "                    ")
renderLine(01, "   gggggss          ")
renderLine(02, "    12  #ss       o ")
renderLine(03, "   gggHs##ss      o ")
renderLine(04, " gNEggSss##ss     o ")
renderLine(05, " gcwwc gss##ss    o ")
renderLine(06, " Cc45cDg ss##ss   o ")
renderLine(07, "     ggg  ss##ss  o ")
renderLine(08, "     g     ss# B  o ")
renderLine(09, " o   g     gssw   o ")
renderLine(10, " o   ggggggg sA     ")
renderLine(11, "       3 a gggggggg ")
renderLine(12, "                    ")
--              01234567890123456789

oxyd_shuffle()

function st1()
    impa=enigma.GetNamedObject("impulse1")
    enigma.SendMessage(impa, "trigger", nil)
end

function st2()
    impa=enigma.GetNamedObject("impulse2")
    enigma.SendMessage(impa, "trigger", nil)
end

function st3()
    impa=enigma.GetNamedObject("impulse3")
    impb=enigma.GetNamedObject("impulse5")
    enigma.SendMessage(impa, "trigger", nil)
    enigma.SendMessage(impb, "trigger", nil)
end

function st4()
    impa=enigma.GetNamedObject("impulse3")
    enigma.SendMessage(impa, "trigger", nil)
end

function st5()
    impa=enigma.GetNamedObject("impulse4")
    enigma.SendMessage(impa, "trigger", nil)
end

