<?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="Life Strip, Stripped Pipe" el:subtitle="" el:id="zephyr22"/>
      <el:version el:score="1" el:release="1" el:revision="1" el:status="released"/>
      <el:author el:name="Zephyr" el:email=""/>
      <el:copyright>Copyright © 2009 Zephyr</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="1.10"/>
      <el:modes el:easy="false" el:single="true" el:network="true"/>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
wo["ConserveLevel"] = false

ti[" "] = {"fl_redslab"}
ti["-"] = {"fl_blueslab"}
ti["."] = {"fl_aquamarine", name="aqua#"}
ti["~"] = {"fl_water"}
ti["#"] = {"st_lightglass"}
ti["X"] = {"st_door_a", name="door#"}
ti["1"] = ti["#"] .. {"it_pipe_ne"}
ti["2"] = ti["#"] .. {"it_pipe_ns"}
ti["3"] = ti["#"] .. {"it_pipe_nw"}
ti["4"] = ti["#"] .. {"it_pipe_es"}
ti["5"] = ti["#"] .. {"it_pipe_ew"}
ti["6"] = ti["#"] .. {"it_pipe_sw"}
ti["S"] = {"st_switch", target="pipe"}
ti["W"] = {"st_switch", target="water"}
ti["O"] = {"st_oxyd_a"}
ti["@"] = {"#ac_marble_black"}
ti["A"] = {"#ac_marble_white", essential=INDISPENSABLE}

wo(ti, " ", {
    "#################",
    "#O#O#O#O#       #",
    "#X#X#X#X#       #",
    "#.......#-------#",
    "#.......#-------#",
    "#.......#-------#",
    "#.. A ..#-- @ --#",
    "#.......#-------#",
    "#.......#-------#",
    "#.......#-------#",
    "#X#X#X#X#       #",
    "#O#O#O#O#SSSSSSW#",
    "#########123456~#"})

wo:shuffleOxyd()

function pipe(value, sender)
    wo:add(YIN, {"it_pipe", connections=it(sender+S)["connections"]})
end

function water()
    for tile in no["aqua#*"] do
        item = it(tile + 8*E)
        if item and item:is("it_pipe") then
            wo[tile] = ti["~"] .. {"it_strip", connections=item["connections"]}
        else
            wo[tile] = ti["~"]
        end
    end
    no["door#*"]:open()
end
 ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
