<?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="The Flagstone Reaper" el:subtitle="" el:id="andreas09"/>
      <el:version el:score="1" el:release="1" el:revision="1" el:status="released"/>
      <el:author  el:name="Andreas Lochmann" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2005 Andreas Lochmann</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:code>Lua 5.1 and XML converted by Leveladministrators</el:code>
      </el:comments>
      <el:score el:easy="01:08" el:difficult="01:06"/>
    </el:info>
    <el:luamain><![CDATA[
-- Created with the help of BBE 1.05

function file_oxyd(x,y,f)
    oxyd_default_flavor=f
    oxyd(x,y)
end
levelh=13
levelw=20
enigma.FlatForce=30
enigma.SlopeForce=30
enigma.ElectricForce=30
--display.DefineAlias("st-fourswitch", "st-likeoxydc")
cells={}
items={}
actors={}
stones={}
actors[" "]=cell{}
stones[" "]=cell{}
cells[" "]=cell{}
items[" "]=cell{}
cells["!"]=cell{floor="fl-brick"}
stones["!"]=cell{stone="st-rock6"}
cells["#"]=cell{floor="fl-normal"}
stones["#"]=cell{stone="st-switch"}
stones["$"]=cell{stone="st-fourswitch"}
function ac_blackball(x,y)
n=""
p=0
f=0
 if (x==4) and (y==9) then
  n="ac4x9"
  p=0
  mf=1
 end
set_actor("ac-blackball",x+0.5,y+0.5,{player=p,name=n,mouseforce=mf})
end
actors["!"]=cell{parent={{ac_blackball}}}
stones["%"]=cell{stone="st-black4"}
stones["&"]=cell{stone="st-laser-s"}
stones["k"]=cell{stone="st-knight"}
stones["b"]=cell{stone="st-break_acblack"}
stones["m"]=cell{stone="st-brick_magic"}
stones["*"]=cell{parent={{file_oxyd,"a"}}}
cells["$"]=cell{floor="fl-abyss"}
level={"!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!$!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!",
       "!!!!!!!!!!!!!!!!!!!!"}
   acmap={"                    ",
          "                    ",
          "                    ",
          "                    ",
          "                    ",
          "                    ",
          "                    ",
          "                    ",
          "                    ",
          "    !               ",
          "                    ",
          "                    ",
          "                    "}
  itmap={"                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    ",
         "                    "}
 stmap={"!!!!!!!!!!!!!!!!!&&!",
        "!               %  #",
        "!               !bm!",
        "!               !kb!",
        "!               !bm!",
        "!               !kb!",
        "!               !bm!",
        "!               !kb!",
        "!               !bm!",
        "!               !kb!",
        "!               !bm!",
        "!               !**!",
        "!!!!!!!!!!!!!!!!!!!!"}
create_world_by_map(level)
draw_map(0,0,stmap,stones)
draw_map(0,0,itmap,items)
draw_map(0,0,acmap,actors)

colour = {}
uhrlaeuft = 1.0
richtung = 1.0
posx = 1.0
posy = 1.0
zerstoert = 0.0
--if difficult then
  TIMERINT = 0.8
--else
--  TIMERINT = 1.2
--end
function timercallback()
  if (uhrlaeuft == 1.0) and (zerstoert == 0.0) then
    kill_stone(posx, posy)
    teilchen = enigma.GetItem(posx, posy)
    if not(teilchen == nil) then
      if colour[posx*20 + posy] == 2 then
        set_item("it-magicwand", posx, posy)
      end
      if colour[posx*20 + posy] == 3 then
        set_item("it-umbrella", posx, posy)
      end
      if colour[posx*20 + posy] == 4 then
        set_item("it-sword", posx, posy)
      end
      if colour[posx*20 + posy] == 5 then
        set_item("it-hammer", posx, posy)
      end
      if colour[posx*20 + posy] == 6 then
        set_item("it-pin", posx, posy)
      end
    end
    if colour[posx*20 + posy] == 1.0 then
      abyss(posx,posy)
      colour[posx*20 + posy] = 0.0
    else
      if colour[posx*20 + posy] > 0.0 then
        set_floor("fl-floor_001",posx,posy)
        colour[posx*20 + posy] = 1.0
      end
    end
    if difficult and (random(1,4) == 1) then      
      richtung = richtung + 2*random(1,2) - 3
      if richtung == 0 then richtung = 4.0 end
    end
    if richtung == 1.0 then  posy = posy - 1  end
    if richtung == 2.0 then  posx = posx + 1  end
    if richtung == 3.0 then  posy = posy + 1  end
    if richtung == 4.0 then  posx = posx - 1  end
    if posx > 15 then posx = 15  end
    if posx < 1 then posx = 1  end
    if posy > 11 then posy = 11  end
    if posy < 1 then posy = 1  end
    set_stone("st-fourswitch",posx,posy, {action="callback", target="hitclock"})
    mir = enigma.GetStone(posx,posy)
    richtung2=richtung
    richtung=1
    for j=1,richtung2+3 do
      SendMessage(mir, "trigger")
    end
  end
end
function hitclock()
  richtung = richtung + 1.0
  if richtung == 5.0 then
    richtung = 1.0
  end
end
for j=0,12 do
  for i=0,19 do
    random_number = random(1,5)
    if random_number == 1 then  set_floor("fl-sahara",   i, j)  end
    if random_number == 2 then  set_floor("fl-red",      i, j)  end
    if random_number == 3 then  set_floor("fl-bluegray", i, j)  end
    if random_number == 4 then  set_floor("fl-tigris",   i, j)  end    
    if random_number == 5 then  set_floor("fl-gray",     i, j)  end    
    colour[i*20 + j] = random_number + 1
  end
  abyss(18,j)
end
set_item("it-document", 17, 1, {text="text1"})
set_stone("st-timer", 0, 0, {action="callback", target="timercallback", interval=TIMERINT} )
set_stone("st-fourswitch",posx,posy, {action="callback", target="hitclock"})
SetAttrib(enigma.GetStone(17,0),"init",FALSE)
SetAttrib(enigma.GetStone(18,0),"init",FALSE)
Signal ("st(19 1)","st(18 0)")
Signal ("st(19 1)","st(17 0)")
oxyd_shuffle()
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="true"/>
        <el:translation el:lang="de">Der Fliesen-Mäher</el:translation>
      </el:string>
      <el:string el:key="text1">
        <el:english el:translate="true" el:comment="Difficult to translate. If you have no idea, just say: Why on this side does this message sit? The Reaper has a use for it">No hint today ...    Those flagstones pass away ...    The docu stands alone ...    Why is it so alone?    --    This hint today ...    Why is it on this side ...    The reaper passing by ...    Could know the reason why!     (orig. by Herman's Hermits)   </el:english>
        <el:translation el:lang="de">Warum ist der Hinweis auf dieser Seite?        Sollte der Mäher das vielleicht wissen?</el:translation>
      </el:string> 
    </el:i18n>
  </el:protected>
</el:level>
