<?xml version="0.1" encoding="UTF8" ?>

<Interface color="fbe5bdff" />
<Goal id="LEVEL_05_GOAL" />
<Effect name="rays" after="" screen="1" particles="./ps/05_rays.ps" />
<Effect before="bg_01" screen="1" particles="./ps/05_window.ps" />
<Effect after="bg_02" screen="1" particles="./ps/05_arrow_sec.ps" />
<Effect name="signal" after="signalizazia" screen="1" particles="./ps/5_signal.ps" />

<StartActions>
     <Action name="Timer" id="505" time="5" />
</StartActions>

<Object name="ammonite">
    <Clicker />
</Object>
<Object name="bead">
    <Clicker />
</Object>
<Object name="buddha">
    <Clicker />
</Object>
<Object name="burgundy">
    <Clicker />
</Object>
<Object name="casket">
    <Clicker />
    <Hint flags="!door_e02_opened" msg="OPEN_DVER" />
</Object>

<Object name="door_niz_levo" active="0">
    <Layer name="e_06" />
    <Layer name="d_06" active="1" >
          <Highlight type="hand_point_star1" />
    </Layer>
    <Click >
        <Action name="SwitchLayer" cicle="1" sound="door_open"/>
        <Action name="ChangeFlag">
             <Condition state="door_e06_opened" clear="door_e06_opened" />
             <Condition state="!door_e06_opened" set="door_e06_opened" />
        </Action>
    </Click>
</Object>
<Object name="door_niz_pravo" active="0">
    <Layer name="e_05" />
    <Layer name="d_05" active="1" >
          <Highlight type="hand_point_star1" />
    </Layer>
    <Click >
        <Action name="SwitchLayer" cicle="1" sound="door_open"/>
        <Action name="ChangeFlag">
             <Condition state="door_e05_opened" clear="door_e05_opened" />
             <Condition state="!door_e05_opened" set="door_e05_opened" />
        </Action>
    </Click>
</Object>

<Object name="door_verx_levo" active="0">
    <Layer name="e_04" />
    <Layer name="d_04" active="1" >
          <Highlight type="hand_point_star1" />
    </Layer>
    <Click >
        <Action name="SwitchLayer" cicle="1" sound="door_open"/>
        <Action name="ChangeFlag">
             <Condition state="door_e04_opened" clear="door_e04_opened" />
             <Condition state="!door_e04_opened" set="door_e04_opened" />
        </Action>
    </Click>
</Object>
<Object name="door_verx_pravo" active="0">
    <Layer name="e_03" />
    <Layer name="d_03" active="1" >
          <Highlight type="hand_point_star1" />
    </Layer>
    <Click >
        <Action name="SwitchLayer" cicle="1" sound="door_open"/>
        <Action name="ChangeFlag">
             <Condition state="door_e03_opened" clear="door_e03_opened" />
             <Condition state="!door_e03_opened" set="door_e03_opened" />
        </Action>
    </Click>
</Object>
<Object name="door_mini_levo" active="0">
    <Layer name="e_02" />
    <Layer name="d_02" active="1" >
          <Highlight type="hand_point_star1" />
    </Layer>
    <Click >
        <Action name="SwitchLayer" cicle="1" sound="door_open"/>
        <Action name="ChangeFlag">
             <Condition state="door_e02_opened" clear="door_e02_opened" />
             <Condition state="!door_e02_opened" set="door_e02_opened" />
        </Action>
    </Click>
</Object>
<Object name="door_mini_pravo" active="0">
    <Layer name="e_01" />
    <Layer name="d_01" active="1" >
          <Highlight type="hand_point_star1" />
    </Layer>
    <Click >
        <Action name="SwitchLayer" cicle="1" sound="door_open"/>
        <Action name="ChangeFlag">
             <Condition state="door_e01_opened" clear="door_e01_opened" />
             <Condition state="!door_e01_opened" set="door_e01_opened" />
        </Action>
    </Click>
</Object>
<Object name="caterpillar">
    <Clicker />
</Object>
<Group name="lustra1" anchor_x="395" anchor_y="-60">
    <Layer name="chandelier_01" />
    <Layer name="chess-horse" assign="0" />
    <Layer name="cone" assing="0" />
</Group>
<Object name="chandlier_01" />
<Object name="chess-horse">
    <Clicker />
</Object>
<Object name="lustra1">
    <Effects>
        <Hover effect="shake" amp="0.008" speed="0.5" rand="0" max_time="4" acc_time="0.8f" sound="chand_move" />
    </Effects>
</Object>
<Group name="lustra2" anchor_x="168" anchor_y="47">
    <Layer name="chandelier_02" />
    <Layer name="trumpet" assign="0" />
</Group>
<Object name="chandlier_02" />
<Object name="trumpet">
    <Clicker />
</Object>
<Object name="lustra2">
    <Effects>
        <Hover effect="shake" amp="0.008" speed="0.5" rand="0" max_time="4" acc_time="0.8f" />
    </Effects>
</Object>
<Object name="coin">
    <Clicker />
</Object>
<Object name="dog">
    <Clicker />
</Object>
<Object name="key01">
    <Clicker task_name="key" />
    <Inventory single_slot="1">
        <Task name="open_seyf" />
    </Inventory>
</Object>
<Object name="key02">
    <Clicker task_name="key" />
    <Inventory single_slot="1">
        <Task name="open_seyf" />
    </Inventory>
</Object>
<Object name="key00">
    <Clicker task_name="key" />
    <Inventory single_slot="1">
        <Task name="open_seyf" />
    </Inventory>
</Object>
<Object name="key03">
    <Clicker task_name="key" />
    <Inventory single_slot="1">
        <Task name="open_seyf" />
    </Inventory>
</Object>
<Object name="key04">
    <Hint flags="!door_e03_opened" msg="OPEN_DVER" />
    <Clicker task_name="key" />
    <Inventory single_slot="1">
        <Task name="open_seyf" />
    </Inventory>
</Object>
<Object name="key05">
    <Clicker task_name="key" />
    <Inventory single_slot="1">
        <Task name="open_seyf" />
    </Inventory>
</Object>
<Object name="safe_door_open">
    <Highlight type="hand_point_star1" />
    <Layer name="safe_door_open" />
    <Layer name="safe_door_close" active="1" />
    <Hint flags="!safe_door_close" msg="OPEN_DVER" />
    <Clck>
    <Action name="ChangeFlag">
            <Condition state="safe_door_open" set="safe_door_close" clear="safe_door_open" />
            <Condition state="safe_door_close" set="safe_door_open" clear="safe_door_close" />
    </Action>
    </Clck>
    <Apply>
        <Object name="key01">
            <Action name="SwitchLayer" />
            <Action name="ObjectState" active="0" />
            <Action name="CompleteTask" task="open_seyf" />
        </Object>
        <Object name="key02" action="Inventory" target="key02" remove="1"/>
        <Object name="key00" action="Inventory" target="key00" remove="1"/>
        <Object name="key03" action="Inventory" target="key03" remove="1"/>
        <Object name="key04" action="Inventory" target="key04" remove="1"/>
        <Object name="key05" action="Inventory" target="key05" remove="1"/>
    </Apply>
    <Messages>
        <Click object="[none]" message="LEV05_Q_SAFE_NEED_KEY" />
        <Click object="key02" message="LEV05_Q_SAFE_WRONG_KEY" />
        <Click object="key00" message="LEV05_Q_SAFE_WRONG_KEY" />
        <Click object="key03" message="LEV05_Q_SAFE_WRONG_KEY" />
        <Click object="key04" message="LEV05_Q_SAFE_WRONG_KEY" />
        <Click object="key05" message="LEV05_Q_SAFE_WRONG_KEY" />
    </Messages>
</Object>
<Object name="painting">
    <Highlight type="hand_point_star1" />
    <Layer name="painting_2" />
    <Layer name="painting_1" active="1" />
    <Hint flags="!paintind_1" msg="MOVE_SOMETHING" />
    <Click>
        <Action condition="paintin2" name="Timer" id="1105" time="1" />
        <Action name="ChangeFlag">
            <Condition state="paintin2" set="paintin1" clear="paintin2" />
            <Condition state="paintin1" set="paintin2" clear="paintin1" />
        </Action>
        <OnTimer timer_id="1105">
            <Action name="zoom" source="720, 360, 300, 350" dest="400, 150, 600, 700" time="1.4" delay="1" sound="zoom_effect" sound_zoom_out="zoom_effect"/>
            <Action name="ChangeFlag" set="paintin2"/>
        </OnTimer>
        <Action name="SwitchLayer" />
        <Action name="ObjectState" active="0" />
        <Action name="completetask" task="find_seyf" />
    </Click>
</Object>
<Object name="mask">
    <Hint flags="!door_e02_opened" msg="OPEN_DVER" />
    <Clicker />
</Object>
<Object name="ulika">
    <Clicker />
</Object>
<Object name="sun">
    <Clicker />
</Object>
<Object name="tobacco-pipe">
    <Clicker />
</Object>
<Object name="ring">
    <Clicker />
</Object>
<Object name="purse">
    <Clicker />
</Object>
<Object name="board">
    <Click>
    <Action name="timer" id="close_tablet" time="0.1" />
    </Click>
</Object>
<Object name="signalizazia" multitask="1">
    <Highlight type="hand_point_mask" />
     <OnTimer>
              <Timer timer_id="505">
                     <Action name="zoom" source="977, 292, 80, 80" dest="900, 237, 240, 240" time="1.4" delay="1" sound_zoom_out="zoom_effect">
                           <Action name="Sublocation" location="SireneDisabler" show="1" />
                           <Click rect="800, 360, 100, 50" path="./ps/zoom_highlight.ps" />
                     </Action>
              </Timer>
              <Timer timer_id="567">
                     <Action name="sublocation" location="board" show="1" />
              </Timer>
    </OnTimer>
    <Click>
        <Action name ="timer" id="505" stop="1" />
        <Action condition="!sirene_disabled" name="Sublocation" location="SireneDisabler" show="1" />
        <Action condition="sirene_disabled" name="StartEffect" targetlayer="bg_07" effect="particle" path="./ps/05_sirena.ps" align="screen" stop="4" />
    <Action condition="sirene_disabled" name="sound" sound="sirene" />
        <Action condition="sirene_disabled" name="Timer" id="567" time="4" />
    </Click>
</Object>
<Object name="finisher" >
    <OnTimer timer_id="close_tablet" >
            <Action name="sublocation" location="board" show="0" />
            <Action name="completetask" target="signalizazia" task="enable_sirene" />
    </OnTimer>
</Object>
<SubLocation name="SireneDisabler" type="Level5Sirene" gate="signalizazia" config="./minigames/wire/wire.xml" skip_time="150">
    <Goal id="SL_GOAL_LEVEL_05" />
    <OnComplete>
        <Action name="RemoveLayer" layer="rays" />
        <Action name="CompleteTask" target="signalizazia" task="disable_sirene" />
        <Action name="ChangeFlag" set="sirene_disabled" />
        <Action name="ObjectState" target="door_niz_levo" active="1" />
        <Action name="ObjectState" target="door_niz_pravo" active="1" />
        <Action name="ObjectState" target="door_verx_levo" active="1" />
        <Action name="ObjectState" target="door_verx_pravo" active="1" />
        <Action name="ObjectState" target="door_mini_levo" active="1" />
        <Action name="ObjectState" target="door_mini_pravo" active="1" />
    <Action name="RemoveLayer" layer="signal" />
    </OnComplete>
</SubLocation>
<SubLocation name="board" type="embedded_ispy" modal="1">
    <Highlight type="mask_point" />
    <Fade bkg_color="00000080" time="0.6" />
    <Object name="board" />
    <Object name="finisher"/>
    <Layer name="board" />
    <OpenActions>
	<Action name="timer" id="close_tablet" time="2" />
    </OpenActions>
</SubLocation>
<Task name="disable_sirene" object="signalizazia" blocker="1" />
<Task name="find_seyf" object="painting" />
<Task name="open_seyf" object="safe_door_open" />
<Task name="enable_sirene" object="signalizazia" />
<Dependency task="open_seyf" tasks="find_seyf, key" />
<Dependency task="key" tasks="find_seyf" />
<Dependency task="ulika" tasks="open_seyf" />
<Dependency task="sun" tasks="open_seyf" />
<Dependency task="enable_sirene" tasks="[last]" />
<Spotlight path="images/level_05/light/spotlight" />
<aSubLocation name="board" type="embedded_ispy">
    <Layer name="board" />
</aSubLocation>

<Sounds>
    <Sound id="zoom_effect" path="sounds/zoom_effect.ogg" />
    <Sound id="door_open" path="sounds/door_open.ogg" />
    <Sound id="wire_turn" path="sounds/wire_turn.ogg" />
    <Sound id="wire_complete" path="sounds/wire_complete.ogg" />
    <Sound id="alarm_on" path="sounds/alarm_on.ogg" />
    <Sound id="chand_move" path="sounds/chand_move.ogg" />
</Sounds>

<FinishActions>
    <Action name="Journal" level="19.1" />
</FinishActions>