<?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="U-Swap" el:subtitle="" el:id="ralf15"/>
      <el:version el:score="1" el:release="1" el:revision="0" 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="0.92">
       <el:dependency el:path="lib/ralf" el:id="lib/ralf" el:release="1" el:preload="true"/>
      </el:compatibility>
      <el:modes el:easy="true" 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[
level={
   "###o###########o####",
   "#_pgp_________pgp__#",
   "#p___p_______p___p_#",
   "#_____p_____p_____p#",
   "#______p___p_______#",
   "#gg_____p_p________#",
   "oag______p_________o",
   "#gg_____p_p________#",
   "# _____p___p_______#",
   "#_____p_____p_____p#",
   "#p___p_______p___p_#",
   "#_pgp_________pgp__#",
   "###o###########o####",
}

if not difficult then
   seed = 947360
else
   seed = 8375
end

function randstone(x,y)
   local r = random(1,7)
   local st = "st-death"
   if r<3 then
      st = "st-stoneimpulse_movable"
   elseif r<5 then
      st = "st-grate1"
   elseif r<7 then
      st = "st-swap"
   elseif r==7 then
      if (random(1,6)>1) then
         if (difficult) then
            return -- no stone
         else
            st = "st-grate1"
         end
      end
   end
   set_stone(st,x,y)
end

cells={}

cells[" "] = cell{floor="fl-sahara"}
cells["#"] = cell{parent=cells[" "],stone="st-rock1"}
cells["o"] = cell{oxyd}

--cells["x"] = cell{parent=cells[" "],stone="st-swap"}
cells["p"] = cell{parent=cells[" "],stone="st-pull"}
cells["g"] = cell{parent=cells[" "],stone="st-grate1"}
--cells["I"] = cell{parent=cells[" "],stone="st-stoneimpulse"}
--cells["i"] = cell{parent=cells[" "],stone="st-stoneimpulse_movable"}
cells["_"] = cell{parent={cells[" "],randstone}}

cells["a"] = cell{parent=cells[" "],actor={"ac-blackball", {player=0}}}

rs_create_world(level,cells)
oxyd_shuffle()

if not difficult then
   enigma.ConserveLevel=TRUE
else
   enigma.ConserveLevel=FALSE
end
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
