<?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="Stairway to Heaven" el:subtitle="" el:id="zephyr30"/>
      <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="true" el:single="true" el:network="false"/>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
wo["ConserveLevel"] = false
wo["GlobalForce"] = cond(wo["IsDifficult"], po(0.0,20.0), po(0.0,10.0))

ti[" "] = {"fl_bright"}
ti["~"] = {"fl_water"}
ti["#"] = {"st_purplegray"}
ti["1"] = {"st_door", name="door%1", faces="ns", _gravity=po(0.0,-20.0)}
ti["2"] = {"st_door", name="door%2", faces="ns", _gravity=po(20.0,0.0)}
ti["3"] = {"st_door", name="door%3", faces="ns", _gravity=po(-20.0,0.0)}
ti["t"] = {"it_trigger", action="callback", target="gravity", _doorid="door%%"}
ti["O"] = {"st_oxyd", flavor="a"}
ti["@"] = {"#ac_marble"}

wo(res.autotile(ti, {"a", "c", "t"}), " ", {
   "##################",
   "#O#~~~~~~~~~~   a#",
   "#3#~~~~~~~~~  ##2#",
   "#b~~~~~~~~~  ### #",
   "# ~~~~~~~~  #### #",
   "# ~~~~~~~  ##### #",
   "# ~~~~~~  ###### #",
   "# ~~~~~  ####### #",
   "# ~~~~  ######## #",
   "# ~~~  ######### #",
   "#1#~  ##########c#",
   "# @  ###########O#",
   "##################"})

function gravity(value, sender)
    sender["target"] = DEFAULT
    if wo["IsDifficult"] then
	wo["GlobalForce"] = no[sender["_doorid"]]["_gravity"]
    else
	wo["GlobalForce"] = 0.5 * no[sender["_doorid"]]["_gravity"]
    end
    no[sender["_doorid"]]:open()
end
 ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
