<?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="Sanssouci" el:subtitle="A Baroque Game" el:id="mecke05"/>
      <el:version el:score="1" el:release="1" el:revision="$Revision:40$" el:status="released"/>
      <el:author  el:name="mecke" el:email=""/>
      <el:copyright>Copyright © 2008 Thomas Bernhardt</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="1.10"/>
      <el:modes el:easy="true" el:single="true" el:network="false" el:control="force" el:scoreunit="duration" el:scoretarget="time"/>
      <el:comments>
        <el:credits el:showinfo="true" el:showstart="false">Thanks to Ronald Lamprecht and Raoul Bourquin for some important patterns</el:credits>
      </el:comments>
      <el:score el:easy="12:20" el:difficult="13:56"/>
    </el:info>
    <el:luamain><![CDATA[
wo["ConserveLevel"] = true

if wo ["IsDifficult"] then
    ti["  "] = {"fl_gravel",burnable=true}
    ti["H "] = {"fl_gravel",burnable=true,"hotspot"}
    ti["n1"] = {"fl_gravel","knight1"}
    ti["n2"] = {"fl_gravel","knight2"}
    ti["n3"] = {"fl_gravel","break2"}
    ti["m5"] = {"fl_gravel","swordm"}
    ti["n5"] = {"fl_gravel","swordn"}
    ti["o5"] = {"fl_gravel","swordo"}
    ti["s5"] = {"fl_gravel","swords"}
    ti["y "] = {"fl_swamp"}
else
    ti["  "] = {"fl_rough",burnable=true}
    ti["H "] = {"fl_rough",burnable=true,"hotspot"}
    ti["n1"] = {"fl_rough","knight1"}
    ti["n2"] = {"fl_rough","knight2"}
    ti["n3"] = {"fl_rough","break2"}
    ti["m5"] = {"fl_rough","swordm"}
    ti["n5"] = {"fl_rough","swordn"}
    ti["o5"] = {"fl_rough","swordo"}
    ti["s5"] = {"fl_rough","swords"}
    ti["y "] = {"fl_swamp",{friction=0.6}}
end

ti["9 "] = {"fl_aquamarine"}
ti[" -"] = {"fl_ice"}
ti["1 "] = {"fl_lawn_d1"}
ti["15"] = {"fl_lawn_d1","sword1"}
ti["2 "] = {"fl_lawn_d2"}
ti["25"] = {"fl_lawn_d2","sword2"}
ti["3 "] = {"fl_lawn_d3"}
ti["35"] = {"fl_lawn_d3","sword3"}
ti["3/"] = ti["3 "] ..{"st_box_wood","woody1"}
ti["1/"] = ti["1 "] ..{"st_box_wood","woody2"}
ti["4 "] = {"fl_lawn_d4"}
ti["45"] = {"fl_lawn_d4","sword4"}
ti["z "] = {"it_cherry"}
ti["Z "] = {"fl_abyss"}
ti["- "] = {"fl_space"}
ti["-d"] = ti["- "] ..{"it_death"}
ti["~ "] = {"fl_water"}
ti["/ "] = {"st_box_wood"}
ti["j "] = {"st_disco_light"}
ti["~1"] = ti["~ "] ..{"st_disco_light"}
ti["J "] = {"st-stoneimpulse-hollow"}
ti["UU"] = {"st_break_black"}
ti["4U"] = ti["4 "] ..{"st_break_black"}
ti["T "] = {"st_passage_black_frame"}
ti["; "] = ti["T "] ..{"it_flag_black"}
ti["h "] = {"st_oneway_e"}
ti["i "] = {"st_oneway_w"}
ti["? "] = {"st_rawglass_movable"}
ti["* "] = ti["~ "] .. {"it_cherry"}
ti["F1"] = ti["* "] .. {"st_rawglass_movable","dd1"}
ti["F2"] = ti["* "] .. {"st_rawglass_movable","dd2"}
ti["! "] = ti["4 "] ..{"it_death"}
ti["B "] = {"st_rawglass"}
ti["C "] = ti["  "] .. {"st_magic_brick"}
ti["D "] = ti["~ "] .. {"st_rawglass"}
ti["E "] = ti["? "] .. {"it_extralife"}
ti["ee"] = ti["  "] .. {"it_extralife"}
ti["F "] = ti["B "] .. {"it_cherry"}
ti["+ "] = ti["~ "] .. {"st_actorimpulse"}
ti[": "] = ti["~ "] .. {"it_cherry","Tollkirsche#"}
ti["# "] = {"st_granite"}
ti["##"] = {"st_death"}
ti["f "] = {"it_magicwand"}
ti["g "] = {"it_wrench"}
ti["7 "] = {"st_window_s",secure=true}
ti["0 "] = ti["4 "] .. {"#ac_marble_black",0.5,0.5}
ti["$ "] = ti["9 "] .. {"#ac_top", range=2, strength=2}
ti["% "] = ti["9 "] .. {"#ac_top", range=7, strength=6}
ti["X "] = {"st_oxyd", flavor="d"}
ti["( "] = ti["1 "] .. {"it_puller_e"}
ti[") "] = ti["3 "] .. {"it_puller_w"}
ti["^ "] = ti["  "] .. {"it_puller_n"}
ti[". "] = ti["y "] .. {"it_strip"}
ti["m "] = ti["y "] .. {"it_strip_sw"}
ti["p "] = ti["  "] .. {"it_strip_ew"}
ti["< "] = ti["y "] .. {"it_strip_es"}
ti["r "] = ti["y "] .. {"it_strip_nw"}
ti["' "] = ti["~ "] .. {"it_strip_ns"}
ti["ZY"] = ti["' "] .. {"st_window_e",secure=true}
ti["ZZ"] = ti["' "] .. {"st_window_w",secure=true}
ti["> "] = ti["y "] .. {"it_strip_ne"}
ti["& "] = ti["~ "] ..{"st_chess_white"}
ti["q "] = {"it_trigger",action="toggle", target="laser1"}
ti["t "] = {"it_trigger",action="toggle", target="laser2"}
ti["8 "] = {"st_laser_w", name="laser1", state=ON}
ti["= "] = {"st_laser_e", name="laser2", state=ON}
ti["81"] = {"st_laser_w", name="laser3", }
ti["=1"] = {"st_laser_e", name="laser4", }
ti["k "] = {"st_panel", cluster=1}
ti["k3"] = {"st_panel", cluster=1,"repanel2"}
ti["l "] = {"st_panel", cluster=2}
ti["P "] = {"st_panel"}
ti["Q "] = {"st_panel_s"}
ti["Q3"] = {"st_panel_s","repanel1"}
ti["G "] = {"st_swap"}
ti["W "] = ti["^ "] .. {"st_swap"}
ti["a "] = {"st_switch", target="fire"}
ti["b "] = {"st_switch", target="knight"}
ti["c "] = {"st_switch", target="jux"}
ti["d "] = {"st_switch", target="recluster"}
ti["s "] = {"st_fourswitch",state=1, target="hans", action="inner_pull"}
ti["w "] = ti["$ "] ..{"st_window_es",secure=true, "hans"}
ti["n "] = {"st_fourswitch",state=0, target="franz", action="inner_pull"}
ti["e "] = ti["$ "] ..{"st_window_sw",secure=true, "franz"}
ti["*,"] = ti["Z "] .. ti({"it_cherry"}) .. {"st_window_sw",secure=true}
ti["*_"] = ti["Z "] .. ti({"it_cherry"}) .. {"st_window_es",secure=true}
ti["V "] = {"it_sensor",target="topblock1"}
ti["v "] = {"it_sensor",target="topblock2"}
ti["O "] = {"it_sensor",target="topblock3"}
ti["o "] = {"it_sensor",target="topblock4"}
ti["t1"] = {"it_trigger", target="boulderCircle", action_1="turn"}
ti["t2"] = {"it_trigger", action="off", target={"laser5"}}
ti["t3"] = {"it_trigger", action="off", target={"laser6"}}
ti["t4"] = {"it_trigger", action="on", target={"laser5"}}
ti["t5"] = {"it_trigger", action="on", target={"laser6"}}
ti["82"] = {"st_laser_n", name="laser5", state=ON}
ti["=2"] = {"st_laser_n", name="laser6", state=ON}
ti["bo"] = ti["~ "] ..{"st_boulder_e", "boulderCircle"}
ti["a1"] = {"it_key", code=1}
ti["a2"] = {"it_key", code=2}
ti["A1"] = {"st_key", code=1, target={"door1"}}
ti["A2"] = {"st_key", code=2, target={"door2"}}
ti["T1"] = {"st_door", name="door1", flavor="d", faces="ns"}
ti["T2"] = {"st_door", name="door2", flavor="d", faces="ns"}
ti["B1"] = {"it_vortex_open", name="vortex1", destination="vortex2"}
ti["B2"] = ti["  "] ..{"it_vortex_open", name="vortex2", destination="vortex1"}
ti["B3"] = {"it_vortex_open", name="vortex3", destination="vortex4"}
ti["B4"] = ti["  "] ..{"it_vortex_open", name="vortex4", destination="vortex3"}
ti["t8"] = {"it_trigger", action="toggle", target="door9"}
ti["t9"] = {"it_trigger", action="toggle", target="door8"}
ti["E1"] = {"it_sensor", target="door3", action="toggle"}
ti["E2"] = {"it_sensor", target="door4", action="toggle"}
ti["A3"] = {"st_door", "door3", flavor="d", faces="ew"}
ti["A4"] = {"st_door", "door4", flavor="d", faces="ew"}
ti["d8"] = {"st_door", "door8", flavor="d", faces="ns"}
ti["d9"] = {"st_door", "door9", flavor="d", faces="ns"}
ti["S4"] = ti["~ "] .. {"it_strip_ew"}
ti["S2"] = ti["~ "] .. {"it_strip_ns"}
ti["S1"] = ti["~ "] .. {"it_strip_ne"}
ti["S3"] = ti["~ "] .. {"it_strip_nw"}
ti["Z7"] = ti["Z "] .. {"it_strip_es"}
ti["Z9"] = ti["Z "] .. {"it_strip_sw"}
ti["S7"] = ti["~ "] .. {"it_strip_es"}
ti["S9"] = ti["~ "] .. {"it_strip_sw"}
ti["T7"] = ti["~ "] .. {"it_strip_nes"}
ti["T9"] = ti["~ "] .. {"it_strip_nsw"}
ti["J2"] = ti["  "] .. {"it_strip_ns"}
ti["I7"] = ti["S7"] .. {"st_window_w",secure=true}
ti["I9"] = ti["S9"] .. {"st_window_e",secure=true}
ti["I1"] = ti["S2"] .. {"st_window_w",secure=true}
ti["I3"] = ti["S2"] .. {"st_window_e",secure=true}
ti["NE"] = ti["E2"] .. {"st_puzzle_yellow_ne"}
ti["NW"] = ti["E1"] .. {"st_puzzle_yellow_nw"}
ti["SE"] = ti["S2"] .. {"st_puzzle_yellow_es"}
ti["SW"] = ti["S2"] .. {"st_puzzle_yellow_sw"}
ti["GE"] = ti["~ "] .. {"st_puzzle_yellow_e"}
ti["GW"] = ti["~ "] .. {"st_puzzle_yellow_w"}
ti["QE"] = ti["~ "] .. {"st_puzzle_yellow_ne"}
ti["QW"] = ti["~ "] .. {"st_puzzle_yellow_nw"}
ti["OE"] = ti["~ "] .. {"st_puzzle_yellow_es"}
ti["OW"] = ti["~ "] .. {"st_puzzle_yellow_sw"}
ti["TT"] = ti["y "] .. {"it_strip_new"}
ti["EE"] = ti["  "] .. {"it_cherry"}
ti["Ee"] = ti["? "] .. {"it_cherry"}
ti["/="] = {"st_window_s"}
ti["!!"] = ti({"st_window_new", secure=true}) .. {"it_extralife"}

local resolver = res.composer(ti)

w, h = wo(resolver, "  ", {
"l l P P P P P P P P P P P P P P P P l l ",
"l             C   X X   C             l ",
"P 7 7 7 * * Z P Z * * Z P Z * * 7 7 7 P ",
"P       * *       P P       * *       P ",
"P 7 7 C 4 2 *,P   * *   P *_4 2 C 7 7 P ",
"P       3 1       * *       3 1       P ",
"= 7 D D D D C D D ~ ~ D D C D D D D 7 8 ",
"P y < p p p p m y * * y < p p p p m y P ",
"P y ' y * y y ' y * * y ' y y * y ' y P ",
"P o ' * q & y ' 7 ; ; 7 ' y & t * ' O P ",
"P y ' y * y y ' y * * y ' y y * y ' y P ",
"l y > p p p p r y * * y > p p p p r y l ",
"l l P P P v P P P P P P P P V P P P l l ",
"~                 + +                 ~ ",
"k   l l l $ l l   + +   l l $ l l l   k ",
"k   y   1 - 3   P !!!!P   1 - 3   y   k ",
"k + !   - % - + f T9T7g + - % -   ! + k ",
"k   y   2 - 4   P QWQEP   2 - 4   y   k ",
"k EEl l l   l l /=OWOE/=l l   l l l EEk ",
"k 7 7     k   B2?   UU? B4  k     7 7 k ",
"k       + k   /   4U2   /   k +       k ",
"k   l l l   l l P 3/1/P l l   l l l   k ",
"~         y     j UUUUj     y         ~ ",
"P ~ ~ ~ ~ ~ ~ ~ - ~ ~ -d~ ~ ~ ~ ~ ~ ~ P ",
"P * * * * * * * F * * Ee* * * * * * * P ",
"P   y n1          Q Q           n2y   P ",
"P T T l l l l l l l l l l l l l l T T P ",
"P T1A1k P   : :   l l   : :   k k A2T2P ",
"P T T k b   : :   4525  : :   k k T T P ",
"P T T k a     o5m53515s5n5    k k T T P ",
"P T T k T G G 4 2 + + 4 2 W G Q3T T T P ",
"P T T k T T T ) 1 + + 3 ( T T k3T T T P ",
"P T T k d         0 2 H       k k T T P ",
"P T T k c   : :   3 1   : :   k k T T P ",
"P T T k P   : :   Q Q   : :   k k T T P ",
"P T i l l l l l l l l l l l l l l h T P ",
"P T i     !       l l       !     h T n ",
"P T h   w   /   / * * /   /   e   i T s ",
"P T P P ~ P P l l l l l l P P ~ P P T P ",
"P - ~ ~ T ~ ~ ~ l * * l ~ ~ ~ T ~ ~ - P ",
"P y < p p p m Z Z * * Z Z < p p p m y P ",
"P y J2F1~ * ' Z t1bo~ t1Z ' * ~ F2J2y P ",
"##  ' ~ t8~ ' ##t2~1~1t4##' ~ t9~ '   ##",
"P y J2* ~ * ' Z t5~1~1t3Z ' * ~ * J2y P ",
"P * > p p p TTZ9t1~ ~ t1Z7TTp p p r * P ",
"l l ##l l d8l S1S9* * S7S3l d9l l ##l l ",
"l l ~ l l   l l I3NWNEI1l l   l l ~ l l ",
"P a1    A3  B3l S2SWSES2l B1  A4    a2P ",
"P P =2P P P l l S1S3S1S3l l P P P 82P P ",
})

function fire ()
    no["hotspot"]:setfire()
    wo[no["Tollkirsche#*"]] = {"it_death"}
end

function knight ()
    wo[no["knight1"]] = {"st_knight"}
end

function jux ()
    wo[no["swords"]] = {"it_sword"}
    wo[no["sword4"]] = {"st_puzzle_yellow_es"}
    wo[no["sword2"]] = {"st_puzzle_yellow_sw"}
    wo[no["swordo"]] = {"st_puzzle_yellow_w"}
    wo[no["swordm"]] = {"st_puzzle_yellow_e"}
    wo[no["swordn"]] = {"st_puzzle_yellow_ew"}
    wo[no["sword1"]] = {"st_puzzle_yellow_new"}
    wo[no["swords"]] = {"st_puzzle_yellow_new"}
    wo[no["sword3"]] = {"st_puzzle_yellow_ew"}
end

j = 0
function recluster(value, sender)
    j = j+1
    if (j <= 1) then
      wo[no["repanel1"]] = {"st_panel"}
      wo[no["repanel2"]] = {"st_panel"}
      wo[no["knight2"]] =  {"st_knight"}
    end
end

function topblock1 ()
    wo[{14,12}] = {"st_passage_black_frame"}
end

function topblock2 ()
    wo[{5,12}] = {"st_passage_black_frame"}
end

function topblock3 ()
    wo[{5,11}] = {"st_passage_black_frame"}
end

function topblock4 ()
    wo[{14,11}] = {"st_passage_black_frame"}
end

wo:add({"ot_wire", anchor1="boulderCircle", anchor2="dd1"})
wo:add({"ot_wire", anchor1="boulderCircle", anchor2="dd2"})
wo:add({"ot_wire", anchor1="woody1", anchor2="woody2"})

wo:shuffleOxyd()
  ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
      <el:string el:key="subtitle">
        <el:english el:translate="true"/>
        <el:translation el:lang="de">Ein Barockes Spiel</el:translation>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
