<?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="Turnstile City" el:subtitle="" el:id="duffy39"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Jacob Scott" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2003 Jacob Scott</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

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

function renderLine( line, pattern)
    for i=1, strlen(pattern) do
        local c = strsub( pattern, i, i)
        if c =="#" then
            set_stone( "st-greenbrown", i-1, line)
        elseif c =="X" then
            set_stone( "st-death", i-1, line)
        elseif c == "o" then
            oxyd( i-1, line)
        elseif c == "*" then
            set_stone( "st-brownie", i-1, line)
                elseif c == "!" then
            abyss(i-1,line)
--            fill_floor("fl-water", i-1,line, 1,1)
                elseif c == "~" then
--            abyss(i-1,line)
            fill_floor("fl-water", i-1,line, 1,1)
        elseif c=="z" then
                set_actor("ac-blackball", i-.5,line+.5)
        elseif c == "g" then
            draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
        elseif c=="+" then
            set_stone( "st-wood", i-1, line)
        elseif c =="A" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge1"})
        elseif c =="B" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge2"})
        elseif c =="C" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge3"})
        elseif c =="D" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge4"})
        elseif c =="E" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge5"})
        elseif c =="H" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge6"})
        elseif c =="K" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge7"})
        elseif c =="M" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge8"})
        elseif c =="N" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge9"})
        elseif c =="P" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge10"})
        elseif c =="Q" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge11"})
        elseif c =="R" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge12"})
        elseif c =="S" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge13"})
        elseif c =="T" then
            set_item("it-trigger", i-1,line, {action="openclose", target="bridge14"})
        elseif c=="=" then
           set_stone("st-turnstile",i-1,line)
           set_stone("st-turnstile-w",i-2,line)
           set_stone("st-turnstile-e",i,line)
        elseif c=="i" then
           set_stone("st-turnstile",i-1,line)
           set_stone("st-turnstile-n",i-1,line-1)
           set_stone("st-turnstile-s",i-1,line+1)
        elseif c=="l" then
           set_stone("st-turnstile",i-1,line)
           set_stone("st-turnstile-n",i-1,line-1)
           set_stone("st-turnstile-e",i,line)
        elseif c=="j" then
           set_stone("st-turnstile",i-1,line)
           set_stone("st-turnstile-n",i-1,line-1)
           set_stone("st-turnstile-w",i-2,line)
        elseif c=="f" then
           set_stone("st-turnstile",i-1,line)
           set_stone("st-turnstile-s",i-1,line+1)
           set_stone("st-turnstile-e",i,line)
        elseif c=="7" then
           set_stone("st-turnstile",i-1,line)
           set_stone("st-turnstile-s",i-1,line+1)
           set_stone("st-turnstile-w",i-2,line) 
        elseif c=="a" then
           set_floor("fl-bridge",i-1,line,{name="bridge1"})
        elseif c=="b" then
           set_floor("fl-bridge",i-1,line,{name="bridge2"})
        elseif c=="c" then
           set_floor("fl-bridge",i-1,line,{name="bridge3"})
        elseif c=="d" then
           set_floor("fl-bridge",i-1,line,{name="bridge4"})
        elseif c=="e" then
           set_floor("fl-bridge",i-1,line,{name="bridge5"})
        elseif c=="h" then
           set_floor("fl-bridge",i-1,line,{name="bridge6"})
        elseif c=="k" then
           set_floor("fl-bridge",i-1,line,{name="bridge7"})
        elseif c=="m" then
           set_floor("fl-bridge",i-1,line,{name="bridge8"})
        elseif c=="n" then
           set_floor("fl-bridge",i-1,line,{name="bridge9"})
        elseif c=="p" then
           set_floor("fl-bridge",i-1,line,{name="bridge10"})
        elseif c=="q" then
           set_floor("fl-bridge",i-1,line,{name="bridge11"})
        elseif c=="r" then
           set_floor("fl-bridge",i-1,line,{name="bridge12"})
        elseif c=="s" then
           set_floor("fl-bridge",i-1,line,{name="bridge13"})
        elseif c=="t" then
           set_floor("fl-bridge",i-1,line,{name="bridge14"})
        elseif c =="O" then
            set_item("it-extralife", i-1,line)
        elseif c =="`" then
           set_item("it-puller-s", i-1, line)
         end
    end    
end

function yy1( color, x, y)
       stone = format( "st-%s4", color)
        set_stone( stone, x, y)
     end

renderLine(00,"#######o#o#o#o#o#o##")
renderLine(01,"#edcba             #")
renderLine(02,"#h#### i i i i i i #")
renderLine(03,"#k#z               #")
renderLine(04,"#m#   ` ` ` ` ` `  #")
renderLine(05,"#n#  j j j j j j j #")
renderLine(06,"#p#  7A7B7C7D7E7H7K#")
renderLine(07,"#q#                o")
renderLine(08,"#r#                #")
renderLine(09,"#s#  l l l l l l l o")
renderLine(10,"#t# MfNfPfQfRfSfTf #")
renderLine(11,"o o                o")
renderLine(12,"#o##o#############o#")

oxyd_shuffle()
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
