<?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="- Meditation -" el:subtitle="" el:id="ralf12"/>
      <el:version el:score="1" el:release="2" el:revision="3" el:status="released"/>
      <el:author  el:name="Ralf Westram" el:email="amgine@reallysoft.de" el:homepage=""/>
      <el:copyright>Copyright © 2003 Ralf Westram</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="1.10">
        <el:dependency el:path="lib/libpuzzle" el:id="lib/libpuzzle" el:release="3" el:preload="true"/>
      </el:compatibility>
      <el:modes el:easy="true" el:single="true" el:network="false"/>
      <el:comments><el:code>New API converted by R. Bourquin</el:code></el:comments>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
ti["  "] = {"fl_hay"}
ti["--"] = {"fl_abyss"}
ti["##"] = {"st_brick"}
ti["#1"] = {"st_brick", cluster=1}
ti["**"] = {"st_puzzle", cluster=1}
ti["door"] = {"st_door", flavor="b", name="door%%#"}
ti["trigger"] = {"it_trigger", target="counter%%", action="signal"}
ti["R"] = {"st_puzzle", color=YELLOW}
ti["S"] = ti({"st_puzzle", color=YELLOW}) .. {"it_meditation_hollow"}
ti["@ "] = {"#ac_pearl", essential=INDISPENSABLE}

local resolver = res.autotile(res.puzzle(ti, "R", "S"), {"t", "trigger"}, {"D", "door"})

if wo["IsDifficult"] then
    map = {
    "----##--#1#1#################1#1--##----",
    "----R2--#1#1    t1t1t1t1    #1#1--R2----",
    "##R2S2R2D1      ********      D1R2S2R2##",
    "----R2##    R0R0R0R0**R0R0R0    ##R2----",
    "#1#1D4      R0  R0R0R0R0          D2#1#1",
    "#1#1t4    **R0R0        R1R1**    t2#1#1",
    "##t4@ t4******R0  @ @   R1******t2@ t2##",
    "#1#1t4    **R0R0        R1R1**    t2#1#1",
    "#1#1D4          R1R1R1R1  R1      D2#1#1",
    "----R2##    R1R1R1**R1R1R1R1    ##R2----",
    "##R2S2R2D3      ********      D3R2S2R2##",
    "----R2--#1#1    t3t3t3t3    #1#1--R2----",
    "----##--#1#1#################1#1--##----"}
else
    map = {
    "----##--#1#1#################1#1--##----",
    "----R4--#1#1    t1t1t1t1    #1#1--R4----",
    "##R4S4R4D1      ********      D1R4S4R4##",
    "----R4##        R0R0**R0        ##R4----",
    "#1#1D4          R0R0R0R0          D2#1#1",
    "#1#1t4    **R3R3        R1R1**    t2#1#1",
    "##t4@ t4******R3  @ @   R1******t2@ t2##",
    "#1#1t4    **R3R3        R1R1**    t2#1#1",
    "#1#1D4          R2R2R2R2          D2#1#1",
    "----R4##        R2**R2R2        ##R4----",
    "##R4S4R4D3      ********      D3R4S4R4##",
    "----R4--#1#1    t3t3t3t3    #1#1--R4----",
    "----##--#1#1#################1#1--##----"}
end

wo(resolver, "  ", map)

wo:add({"ot_counter", name="counter%1", state=0, target="door%1#*", action_3="close", action_4="open"})
wo:add({"ot_counter", name="counter%2", state=0, target="door%2#*", action_3="close", action_4="open"})
wo:add({"ot_counter", name="counter%3", state=0, target="door%3#*", action_3="close", action_4="open"})
wo:add({"ot_counter", name="counter%4", state=0, target="door%4#*", action_3="close", action_4="open"})
 ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
