-- Siegfried Fennig

levelw = 20
levelh = 13

create_world(levelw, levelh)
draw_border("st-fakeoxyd")
fill_floor("fl-dunes", 0,0, level_width,level_height)

oxyd (2,3)
oxyd (4,5)
oxyd (6,9)
oxyd (15,5)
oxyd (13,7)
oxyd (17,7)
oxyd_shuffle()

set_stones("st-death", {{4,3},{6,3},{8,3},{2,5},{6,5},{8,5},{2,7}})
set_stones("st-death", {{4,7},{6,7},{8,7},{2,9},{4,9},{8,9}})
set_stones("st-death", {{11,3},{13,3},{15,3},{17,3},{11,5},{13,5},{17,5}})
set_stones("st-death", {{11,7},{15,7},{11,9},{13,9},{15,9},{17,9}})

set_item("it-hollow", 3,3)
set_item("it-hollow", 5,3)
set_item("it-hollow", 7,3)
set_item("it-hollow", 3,4)
set_item("it-hollow", 5,4)
set_item("it-hollow", 7,4)
set_item("it-hollow", 3,5)
set_item("it-hollow", 5,5)
set_item("it-hollow", 7,5)
set_item("it-hollow", 3,6)
set_item("it-hollow", 5,6)
set_item("it-hollow", 7,6)
set_item("it-hollow", 3,7)
set_item("it-hollow", 5,7)
set_item("it-hollow", 7,7)
set_item("it-hollow", 3,8)
set_item("it-hollow", 5,8)
set_item("it-hollow", 7,8)
set_item("it-hollow", 3,9)
set_item("it-hollow", 5,9)
set_item("it-hollow", 7,9)
set_item("it-hollow", 11,4)
set_item("it-hollow", 12,4)
set_item("it-hollow", 13,4)
set_item("it-hollow", 14,4)
set_item("it-hollow", 15,4)
set_item("it-hollow", 16,4)
set_item("it-hollow", 17,4)
set_item("it-hollow", 11,6)
set_item("it-hollow", 12,6)
set_item("it-hollow", 13,6)
set_item("it-hollow", 14,6)
set_item("it-hollow", 15,6)
set_item("it-hollow", 16,6)
set_item("it-hollow", 17,6)
set_item("it-hollow", 11,8)
set_item("it-hollow", 12,8)
set_item("it-hollow", 13,8)
set_item("it-hollow", 14,8)
set_item("it-hollow", 15,8)
set_item("it-hollow", 16,8)
set_item("it-hollow", 17,8)

set_item( "it-hollow", 2,4, {name="h1"})
set_item( "it-hollow", 4,4, {name="h2"})
set_item( "it-hollow",6,4, {name="h3"})
set_item( "it-hollow",8,4, {name="h4"})
set_item( "it-hollow", 2,6, {name="h5"})
set_item( "it-hollow", 4,6, {name="h6"})
set_item( "it-hollow",6,6, {name="h7"})
set_item( "it-hollow",8,6, {name="h8"})
set_item( "it-hollow", 2,8, {name="h9"})
set_item( "it-hollow", 4,8, {name="h10"})
set_item( "it-hollow",6,8, {name="h11"})
set_item( "it-hollow",8,8, {name="h12"})
set_item( "it-hollow", 12,3, {name="h13"})
set_item( "it-hollow", 14,3, {name="h14"})
set_item( "it-hollow",16,3, {name="h15"})
set_item( "it-hollow",12,5, {name="h16"})
set_item( "it-hollow", 14,5, {name="h17"})
set_item( "it-hollow", 16,5, {name="h18"})
set_item( "it-hollow",12,7, {name="h19"})
set_item( "it-hollow",14,7, {name="h20"})
set_item( "it-hollow", 16,7, {name="h21"})
set_item( "it-hollow", 12,9, {name="h22"})
set_item( "it-hollow",14,9, {name="h23"})
set_item( "it-hollow",16,9, {name="h24"})

set_stone( "st-timer", 4, 12, {action="callback", target="th1"})
set_stone( "st-timer", 5, 12, {action="callback", target="th2"})
set_stone( "st-timer", 9, 12, {action="callback", target="th3"})
set_stone( "st-timer", 10, 12, {action="callback", target="th4"})
set_stone( "st-timer", 14, 12, {action="callback", target="th5"})
set_stone( "st-timer", 15, 12, {action="callback", target="th6"})

timer = 0

function th1()
    if timer == 0 then
    enigma.SendMessage( enigma.GetNamedObject("h1"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h5"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h9"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h13"), "trigger", nil)
    end
    if timer == 1 then
    enigma.SendMessage( enigma.GetNamedObject("h1"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h5"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h9"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h13"), "trigger", nil)
    end
end

function th2()
    if timer == 1 then
    enigma.SendMessage( enigma.GetNamedObject("h2"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h6"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h10"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h16"), "trigger", nil)
    end
    if timer == 2 then
    enigma.SendMessage( enigma.GetNamedObject("h2"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h6"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h10"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h16"), "trigger", nil)
    end
end

function th3()
    if timer == 2 then
    enigma.SendMessage( enigma.GetNamedObject("h3"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h7"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h11"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h19"), "trigger", nil)
    end
    if timer == 3 then
    enigma.SendMessage( enigma.GetNamedObject("h3"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h7"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h11"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h19"), "trigger", nil)
    end
end

function th4()
    if timer == 3 then
    enigma.SendMessage( enigma.GetNamedObject("h4"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h8"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h12"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h22"), "trigger", nil)
    end
    if timer == 4 then
    enigma.SendMessage( enigma.GetNamedObject("h4"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h8"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h12"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h22"), "trigger", nil)
    end
end

function th5()
    if timer == 0 then
    enigma.SendMessage( enigma.GetNamedObject("h14"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h15"), "trigger", nil)
    end
    if timer == 1 then
    enigma.SendMessage( enigma.GetNamedObject("h14"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h15"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h17"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h18"), "trigger", nil)
    end
    if timer == 2 then
    enigma.SendMessage( enigma.GetNamedObject("h17"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h18"), "trigger", nil)
    end
end

function th6()
    if timer == 2 then
    enigma.SendMessage( enigma.GetNamedObject("h20"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h21"), "trigger", nil)
    end
    if timer == 3 then
    enigma.SendMessage( enigma.GetNamedObject("h20"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h21"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h23"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h24"), "trigger", nil)
    end
    if timer == 4 then
    enigma.SendMessage( enigma.GetNamedObject("h23"), "trigger", nil)
    enigma.SendMessage( enigma.GetNamedObject("h24"), "trigger", nil)
    end
    timer = timer + 1
    if timer == 5 then
        timer = 0
    end
end

set_actor("ac-blackball", 10,6.5 ,{player=0})

