<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" xmlns:el="http://enigma-game.org/schema/level/1">
  <el:protected>
    <el:info el:type="level">
      <el:identity el:title="Land of Impulses" el:subtitle="Oxyd Magnum 28" el:id="siegfried89"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Siegfried Fennig" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2003 Siegfried Fennig</el:copyright>
      <el:license el:type="GPL version 2" el:open="true"/>
      <el:compatibility el:enigma="0.92" el:engine="oxyd.magnum">
      </el:compatibility>
      <el:modes el:easy="false" el:single="true" el:network="false"/>
      <el:comments>
        <el:code>Lua 5.1 and XML converted by Leveladministrators</el:code>
      </el:comments>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
levelw = 20
levelh = 13

create_world(levelw, levelh)
draw_border("st-glass2")
enigma.ConserveLevel = FALSE
oxyd_default_flavor = "d"
fill_floor("fl-abyss")
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-n",i-1,line)
      elseif c == "S" then
         set_stone("st-oneway-s",i-1,line)
      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)
        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()
    SendMessage("impulse1", "trigger")
end

function st2()
    SendMessage("impulse2", "trigger")
end

function st3()
    SendMessage("impulse3", "trigger")
    SendMessage("impulse5", "trigger")
end

function st4()
    SendMessage("impulse3", "trigger")
end

function st5()
    SendMessage("impulse4", "trigger")
end
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
