<?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="Walk the Dog" el:subtitle="" el:id="luc04"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Lukas Schüller" el:email="Lucky_Luc@web.de" el:homepage=""/>
      <el:copyright>Copyright © 2005 Lukas Schüller</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/ant" el:id="lib/ant" el:release="1" el:preload="true"/>
      </el:compatibility>
      <el:modes el:easy="true" el:single="true" el:network="false"/>
      <el:comments>
        <el:credits>Thanks to Petr Machata for his ant.lua script</el:credits>
        <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[

--environment
wand="st-marble"
wandinnen="st-marble"
cells={}
cells[" "]=cell{floor="fl-marble"}
cells["+"]=cell{floor="fl-rough"}
cells["a"]=cell{floor="fl-abyss"}
cells["*"]=cell{parent=cells[" "], stone=wandinnen}
cells["_"]=cell{parent=cells["a"], stone="st-glass"}
cells["#"]=cell{parent=cells[" "], stone=wand}
cells["f"]=cell{parent=cells["a"], item={"it-trigger", {invisible=1, action="callback", target="new1"}}}
cells["B"]=cell{parent=cells[" "], stone={"st-fart", {name="fart"}}}
cells["O"]=cell{parent=cells["+"], actor={"ac-blackball", {player=0}}}
cells["o"]=cell{parent=cells[" "], item={"it-trigger",{action="onoff",target="laser"}}}
level = {
  "B###################",
  "# f   f      f     #",
  "# f f f f_ff   f_f #",
  "#   f   _0   f _0_ #",
  "#_fffffff***ff f_f #",
  "#0     f**+**  fo  #",
  "#_ffff f*+O+*f ffff#",
  "#      f**+**      #",
  "# fffffff***ffff_f #",
  "#    f f   f    0_ #",
  "# f  f   f   fff_f #",
  "# f    f f f       #",
  "####################"
}
oxyd_default_flavor = "d"
create_world_by_map(level)
oxyd_shuffle()
set_attrib(laser(19,3,FALSE,WEST),"name","laser")
set_stone("st-bolder", 1,1, {name="bolder", direction=NORTH})
----------------------------------------------
--functions to control the "dog"
function gon()
  enigma.SendMessage(enigma.GetNamedObject("bolder"), "direction", NORTH)
end
function goe()
  enigma.SendMessage(enigma.GetNamedObject("bolder"), "direction", EAST)
end
function gow()
  enigma.SendMessage(enigma.GetNamedObject("bolder"), "direction", WEST)
end
function gos()
  enigma.SendMessage(enigma.GetNamedObject("bolder"), "direction", SOUTH)
end
-------------------------------------------
--functions to restart the level
ontr = 0
function new1()
--bugfixing:
  if(ontr == 0) then
    ontr = 1
--end of bugfixing
  else
    set_stone("st-switch", 8,6, {action="callback", target="new2"})
    ontr = 0
  end
end
function new2()
  set_stone(wandinnen, 8,6)
  set_stone("st-bolder", 1,1, {name="bolder", direction=NORTH})
  if difficult then 
   enigma.SendMessage(enigma.GetNamedObject("fart"), "trigger", nil)
  end
end
-------------------------------------------
--some triggers
set_item("it-trigger", 10,7, {action="callback", target="gos"})
set_item("it-trigger", 9,6, {action="callback", target="gow"})
set_item("it-trigger", 11,6, {action="callback", target="goe"})
set_item("it-trigger", 10,5, {action="callback", target="gon"})
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
