<?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="Door Maze" el:subtitle="" el:id="immanuel02"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Immanuel Herrmann" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2003 Immanuel Herrmann</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="0.92">
      </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)
enigma.ConserveLevel = FALSE

oxyd_default_flavor = "a"

fill_floor("fl-bluegray", 0, 0, levelw, levelh)

zaehler = 1

function tuer(x, y, ri)
  set_floor( "fl-bluegreen", x, y)
  set_stone( "st-bolder", x, y, {direction=ri, name="tuer"..strsub("dcbae",zaehler, zaehler)})
  zaehler = zaehler + 1
end


function kabel(x, y, co)
  set_stone( "st-puzzle", x, y, {connections = co})
end

function renderLine( y, pattern)
    for x=0, strlen(pattern) - 1 do
        local c = strsub( pattern, x + 1, x + 1)
        if c =="#" then
            set_stone( "st-metal", x, y)
        elseif c == "o" then
            oxyd( x, y)
        elseif c == "s" then
            set_actor("ac-blackball", x+0.5, y+0.5)

        elseif c == "-" then
            kabel(x, y, 6)
        elseif c == "|" then
            kabel(x, y, 11)
        elseif c == "`" then
            kabel(x, y, 13)
        elseif c == "'" then
            kabel(x, y, 10)
        elseif c == "," then
            kabel(x, y, 7)
        elseif c == "." then
            kabel(x, y, 4)
        elseif c == "+" then
            kabel(x, y, 16)
        elseif c == ":" then
            set_stone( "st-puzzle", x, y, {connections = 1})
            --set_stone("st-grate1", x, y)
        elseif c == "~" then
            set_stone("st-grate1", x, y)

        elseif (c >= "A" and c <= "E") or (c >= "a" and c <= "e") then
            set_item("it-trigger", x, y, {action="callback", target="tt"..c})
        elseif c == "t" then
            set_floor( "fl-bluegreen", x, y)
        elseif c == "^" then
            tuer(x, y, NORTH)
        elseif c == ">" then
            tuer(x, y, EAST)
        elseif c == "v" then
            tuer(x, y, SOUTH)
        elseif c == "<" then
            tuer(x, y, WEST)
        elseif c == "" then
            set_stone( "", x, y)
        elseif c == "" then
            set_stone( "", x, y)
        elseif c == "" then
            set_stone( "", x, y)
        end
    end
end

renderLine( 0, "####,------.########")
renderLine( 1, "#   D#     |      C.")
renderLine( 2, "# ## # # # `:.## ##|")
renderLine( 3, ",ao,:-:-:-t<t'o#   |")
renderLine( 4, "| #|s,:. # # ,t>t-:'")
renderLine( 5, "| e: t | B #E: # # #")
renderLine( 6, "|,+'#v#|,'  ||#,t<t.")
renderLine( 7, "|dt  t `+b# || : # |")
renderLine( 8, "|#v# `:-'c-:+' |   |")
renderLine( 9, "| t  #      :  |###|")
renderLine(10, "|~`---------'##|   |")
renderLine(11, "|     ~        : #A'")
renderLine(12, "`--------------'####")

--renderLine( 0, ",------------------.")
--renderLine( 1, "|   D------.      C|")
--renderLine( 2, "| ## #     `:.## ,'|")
--renderLine( 3, "`ao,:-:-:-t<t'o# : |")
--renderLine( 4, "# #|s,:. # # ,t>t' |")
--renderLine( 5, "# e: t | B #E: ,:-:'")
--renderLine( 6, "#,+'#v#|,'  ||#`t<t.")
--renderLine( 7, "#dt  t `+b# ||   # |")
--renderLine( 8, "##v# `:-'c-:+' #   |")
--renderLine( 9, "# t  #      :  ####|")
--renderLine(10, "# `---------'##   #|")
--renderLine(11, "#               # A'")
--renderLine(12, "####################")

function tuer_bewegen(tnr, ri)
   SendMessage("tuer"..tnr, "direction", ri);
end

-- Grossbuchstabe bewegt nach west / nord...

function ttA()
  tuer_bewegen("a", WEST)
end
function tta()
  tuer_bewegen("a", EAST)
end
function ttB()
  tuer_bewegen("b", NORTH)
end
function ttb()
  tuer_bewegen("b", SOUTH)
end
function ttC()
  tuer_bewegen("c", WEST)
end
function ttc()
  tuer_bewegen("c", EAST)
end
function ttD()
  tuer_bewegen("d", WEST)
end
function ttd()
  tuer_bewegen("d", EAST)
end
function ttE()
  tuer_bewegen("e", NORTH)
end
function tte()
  tuer_bewegen("e", SOUTH)
end
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
