<?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="Light Barriers" el:subtitle="" el:id="qq1"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Andrzej Szombierski" el:email="" el:homepage=""/>
      <el:copyright>Copyright © Andrzej Szombierski</el:copyright>
      <el:license el:type="Donated to Enigma under the projects license" el:open="true"/>
      <el:compatibility el:enigma="0.92">
      </el:compatibility>
      <el:modes el:easy="false" 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[
levelw = 20
levelh = 25

create_world(levelw, levelh)
draw_border("st-glass")
draw_stones("st-glass", {0, 12}, {1, 0}, levelw-3)
fill_floor("fl-leaves")

draw_stones("st-grate1", {7, 13}, {0, 1}, levelh-14)
draw_stones("st-brick_magic", {4, 13}, {0, 1}, levelh-14)
draw_stones("st-brick_magic", {5, 23}, {1, 0}, levelw-6)

set_attrib(laser(0, 0, TRUE, EAST), "name", "laser")
draw_stones("st-glass", {5,1}, {2,0}, levelw-1)

for i=6, levelw-4, 2 do
    mirrorp(i, 0, FALSE, TRUE, 2)
    
    -- Added CreatingPreview-section to show lasers in preview: Andreas, Oct 06
    if enigma.CreatingPreview then
        set_stone("st-door-h-open", i, 1, {name="l_door"..i})
    else
        doorh(i, 1, {name="l_door"..i})
        SendMessage("l_door"..i, "open")
    end
    
    if i>8 then
        mirror3(i, levelw-i+11, TRUE, FALSE, 3)
        oxyd(i, levelh-1)
        oxyd(2, levelw-i+11)
    end
    
    set_item("it-trigger", i-1, 11, { action="open", target="l_door"..i })
    --    set_item("it-trigger", i-1, 10, { action="open", target="p_door"..i })
end

set_item("it-trigger", 18, 1, { action="callback", target="close_all" })
draw_stones("st-glass", {17, 2}, {0, 1}, 3)
doorh(18, 2, { name="switchdoor" })
if enigma.CreatingPreview then
    set_stone("st-door-h-open", 18, 4, {name="entrance"})
else
    doorh(18, 4, { name="entrance" })
    SendMessage("entrance", "open")
end

set_item("it-magicwand", 1, 1)
draw_stones("st-glass", {2, 1}, {0, 1}, 4)

for i=2, 4 do
    doorh(1,i, { name="w_door"..i })
    set_item("it-trigger", 1, i+5, { action="openclose", target="w_door"..i})
end

set_item("it-trigger", 18, 11, { action="openclose", target="switchdoor"})
set_stone("st-brownie", 11, 16)

oxyd_shuffle()
set_actor("ac-blackball", 18.5, 3.5)

function close_all()
    for i=6, levelw-4, 2 do
    SendMessage("l_door"..i, "close")
    end
end
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
