<?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="Wildfire" el:subtitle="" el:id="duffy63"/>
      <el:version el:score="1" el:release="1" el:revision="1" el:status="released"/>
      <el:author  el:name="Jacob Scott" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2003 Jacob Scott</el:copyright>
      <el:license el:type="GPL v2.0 or above" 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[
rooms_wide=2
rooms_high=1

levelw=1+(19*rooms_wide) +1
levelh=1+(12*rooms_high)

create_world( levelw, levelh)
enigma.ConserveLevel = 0

fill_floor("fl-wood", 0,0,levelw,levelh)

function renderLine( line, pattern)
    for i=1, strlen(pattern) do
        local c = strsub( pattern, i, i)
        if c =="#" then
            set_stone( "st-greenbrown", i-1, line)
        elseif c =="%" then
            set_stone( "st-greenbrown", i-1, line)
            set_floor("fl-normal",i-1,line)
        elseif c == "o" then
            oxyd( i-1, line)
        elseif c == "*" then
            set_stone( "st-brownie", i-1, line)
        elseif c == "!" then
            abyss(i-1,line)
            set_item("it-burnable_fireproof",i-1,line)
        elseif c=="z" then
            set_actor("ac-blackball", i-.5,line+.5)
            set_item("it-burnable",i-1,line)
        elseif c == "g" then
            draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
        elseif c=="+" then
            set_stone( "st-wood", i-1, line)
            set_item("it-burnable",i-1,line)
        elseif c=="=" then
            set_floor("fl-space",i-1,line)
        elseif c == "d" then --1-d
            set_floor("fl-gradient",  i-1,  line, {type=1})
        elseif c == "u" then --2-u
            set_floor("fl-gradient",  i-1,  line, {type=2})
        elseif c == "r" then --3-r
            set_floor("fl-gradient",  i-1,  line, {type=3})
        elseif c == "l" then --4-l
            set_floor("fl-gradient",  i-1,  line, {type=4})
        elseif c == "1" then --ur
            set_floor("fl-gradient",  i-1,  line, {type=11})
        elseif c == "3" then --dl
            set_floor("fl-gradient",  i-1,  line, {type=9})
        elseif c == "7" then --dr
            set_floor("fl-gradient",  i-1,  line, {type=12})
        elseif c == "9" then --ul
            set_floor("fl-gradient",  i-1,  line, {type=10})
        elseif c=="X" then
            set_item("it-extinguisher", i-1,line, {load=2})
        elseif c==" " then
            set_item("it-burnable",i-1,line)
        elseif c=="F" then
            set_item("it-burnable_ignited",i-1,line)
        elseif c=="a" then
            set_item("it-trigger",i-1,line,{action="callback",target="funcc1"})
        elseif c=="A" then
            set_stone("st-door_b",i-1,line,{name="door1"})
            set_item("it-burnable",i-1,line)
        elseif c=="B" then
            set_stone("st-door_b",i-1,line,{name="door2"})
            set_item("it-burnable",i-1,line)
        elseif c=="C" then
            set_stone("st-door_b",i-1,line,{name="door3"})
            set_item("it-burnable",i-1,line)
        end
    end
end

-- Floor:  " "
-- Border: "#"
-- Oxyd:   "o"

renderLine(00,"################################a####o#")
renderLine(01,"#XXXXXXXXXX                    ###  #!#")
renderLine(02,"#                               #   #!#")
renderLine(03,"#                               #     #")
renderLine(04,"#                               #     #")
renderLine(05,"#                               A ++  #")
renderLine(06,"#  #d#####                      B ++  #")
renderLine(07,"#  #3rrr3#                      C ++  #")
renderLine(08,"#  #%%%%d#                      #     #")
renderLine(09,"#  #1l7%d#                      #     #")
renderLine(10,"#  #d%u%d#                      #   #!#")
renderLine(11,"#FF#z%7l1#                      #   #!#")
renderLine(12,"#####################################o#")

oxyd_shuffle()

f1=0
tt=0

function funcc1()
    SendMessage("door1","openclose")
    SendMessage("door2","openclose")
    SendMessage("door3","openclose")
    f1=1
end

function timer_callback2()
    if f1==1 then
        tt=tt+1
        if tt==11 then
            enigma.KillStone(32,5)
            enigma.KillStone(32,6)
            enigma.KillStone(32,7)
            f1=0
        end
    end
end

ferry_x = 1
ferry_y = 0
ferry_width = 1
ferry_height = 1
ferry_end = 34

function move_ferry()
    set_stone("st-blue-sand",ferry_x+ferry_width-2,ferry_y)
    ferry_x = ferry_x + 1
end

function timer_callback()
    if ferry_x < ferry_end then
        move_ferry()
    end
end

set_stone( "st-timer", 39, 0, {target="timer_callback", action="callback", name="timer", interval=2.3} )
set_stone( "st-timer", 39, 1, {target="timer_callback2", action="callback", name="timer", interval=0.1} )
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
