<?xml version="0.1" encoding="UTF8" ?>
<Goal id="LEVEL_21_GOAL" />

<Effect before="layer119" screen="1" particles="./ps/21_eagle.ps" />
<Effect before="()" screen="1" particles="./ps/21_light signal.ps" />
<Effect before="()" screen="1" particles="./ps/21_windows.ps" />
<Effect before="maya_object_20">
    <Scrollers>
        <Scroller path="./images/Level_21/sky/sky_cycled" cycle_x="1" speed_x="10" />
    </Scrollers>
</Effect>
<Object name="finisher">
    <OnTimer timer_id="113">
        <Action name="changeflag" set="aaa" clear="111, 112" />
    </OnTimer>
    <OnTimer timer_id="500" action="changeflag" set="finished" />
    <Click>
        <Action name="timer" id="500" time="6" />
        <Action name="StartEffect" effect="move" target_layer="auto_07" dst_y="600" start="0" end="10" func="inc" sound="car_move_left"/>
        <Action name="StartEffect" effect="move" target_layer="auto_03" dst_x="-200" start="5" end="15" func="inc" sound="car_move_right"/>
    </Click>
</Object>
<StartActions>
    <Action name="Timer" id="111" time="6" time_max="10" multi="1" />
    <Action name="Timer" id="112" time="6" time_max="10" multi="1" />
    <Action name="Timer" id="114" time="9" time_max="16" multi="1" />
    <Action name="Timer" id="115" time="9" time_max="16" multi="1" />
    <Action name="Timer" id="117" time="4" time_max="20" multi="1" />
    <Action name="Timer" id="118" time="4" time_max="20" multi="1" />
</StartActions>
<aObject name="object_07" contour="./images/Level_21/object_07_contour">
    <Clicker />
</aObject>
<Object name="auto_08">
    <Highlight type="hand_point_mask" />
    <Click action="Sublocation" location="Traffic_08" show="1" />
</Object>

<SubLocation name="Traffic_08" type="TrafficJam" gate="auto_08">
    <Goal id="SL_GOAL_LEVEL_21" />
    <Fade bkg_color="00000080" time="1" />
    <Parking position="205, 45" size="6" x="203" y="118" w="375" h="375" exit_x="0" exit_y="2" path="./images/tj/parkovka" exit="./images/tj/doroga" exit_dx="11">
        <Car path="./images/tj/car_00" ox="46" oy="43" x="4" y="2" angle="0" length="2" target="1" />
        <Car path="./images/tj/car_01" ox="43" oy="50" x="0" y="1" angle="3" length="3" />
        <Car path="./images/tj/car_04" ox="40" oy="43" x="1" y="3" angle="0" length="3" />
        <Car path="./images/tj/car_05" ox="38" oy="40" x="5" y="5" angle="1" length="3" />
        <Car path="./images/tj/car_02" ox="42" oy="46" x="0" y="0" angle="0" length="2" />
        <Car path="./images/tj/car_03" ox="44" oy="41" x="4" y="0" angle="2" length="2" />
        <Car path="./images/tj/car_02" ox="42" oy="46" x="5" y="1" angle="2" length="2" />
        <Car path="./images/tj/car_03" ox="44" oy="41" x="3" y="2" angle="1" length="2" />
        <Car path="./images/tj/car_02" ox="42" oy="46" x="1" y="4" angle="2" length="2" />
        <Car path="./images/tj/car_03" ox="44" oy="41" x="1" y="5" angle="2" length="2" />
        <Car path="./images/tj/car_02" ox="42" oy="46" x="2" y="4" angle="3" length="2" />
        <Car path="./images/tj/car_03" ox="44" oy="41" x="3" y="5" angle="0" length="2" />
    </Parking>
    <OnComplete>
        <Action name="ZOrder" target="auto_08" order="before" layer="bg_04" />
        <Action name="StartEffect" effect="move" target="auto_08" start="0" end="3" dst_x="800" dst_y="-130" sound="jam_fix"/>
        <Action name="StartEffect" effect="scale" target="auto_08" start="0" end="3" src="1" dst="0.2" />
	<Action name="ChangeFlag" set="s2_unlocked" />
    </OnComplete>
</SubLocation>

<SubLocation name="Traffic_09" type="TrafficJam" gate="auto_09">
    <Goal id="SL_GOAL_LEVEL_21" />
    <Fade bkg_color="00000080" time="1" />
    <Parking position="205, 45" size="6" x="203" y="118" w="375" h="375" exit_x="0" exit_y="2" path="./images/tj/parkovka" exit="./images/tj/doroga" exit_dx="11">
        <Car path="./images/tj/car_00" ox="46" oy="43" x="4" y="2" angle="0" length="2" target="1" />
        <Car path="./images/tj/car_01" ox="43" oy="50" x="0" y="0" angle="3" length="3" />
        <Car path="./images/tj/car_02" ox="42" oy="46" x="1" y="0" angle="3" length="2" />
        <Car path="./images/tj/car_04" ox="40" oy="43" x="2" y="0" angle="0" length="3" />
        <Car path="./images/tj/car_05" ox="38" oy="40" x="2" y="1" angle="0" length="3" />
        <Car path="./images/tj/car_04" ox="40" oy="43" x="1" y="4" angle="1" length="3" />
        <Car path="./images/tj/car_01" ox="43" oy="50" x="3" y="3" angle="3" length="3" />
        <Car path="./images/tj/car_03" ox="44" oy="41" x="1" y="5" angle="0" length="2" />
        <Car path="./images/tj/car_03" ox="44" oy="41" x="5" y="4" angle="1" length="2" />
    </Parking>
    <OnComplete>
        <Action name="StartEffect" effect="move" target="auto_09" start="0" end="4" dst_x="-300" dst_y="90" sound="jam_fix" />
        <Action name="StartEffect" effect="scale" target="auto_09" start="0" end="4" src="1" dst="2" />
        <Action name="ChangeFlag" set="s1_unlocked" />
    </OnComplete>
</SubLocation>
<Object name="auto_09">
    <Highlight type="hand_point_mask" />
    <Click action="Sublocation" location="Traffic_09" show="1" />
</Object>
<Object name="auto_10" dx="-1000" initial_flags="12_rite">
    <OnTimer>
        <Timer timer_id="114">
            <Action condition="!115 * !114 * 12_rite" name="starteffect" effect="scale" src_x="1" src_y="1" dst_x="1" dst_y="1" start="0" end="4" />
            <Action condition="!115 * !114 * 12_rite" name="starteffect" effect="move" src_x="0" dst_x="3000" dst_y="50" start="4" end="10.5" sound="car_move_left"/>
            <Action condition="!115 * !114 * 12_rite" name="starteffect" effect="move" src_x="3000" dst_x="3000" dst_y="0" start="11" end="12" />
            <Action condition="!115 * !114 * 12_rite" name="timer" id="116" time="16" />
            <Action condition="!115 * !114 * 12_rite" name="changeflag" set="114" clear="12_rite" />
        </Timer>
        <Timer timer_id="115">
            <Action condition="!114 * !115 * !12_rite" name="starteffect" effect="scale" src_x="-1" src_y="1" dst_x="-1" dst_y="1" start="0" end="4" />
            <Action condition="!114 * !115 * !12_rite" name="starteffect" effect="move" src_x="0" src_y="0" dst_x="-3000" dst_y="50" start="4" end="10.5" sound="car_move_right"/>
            <Action condition="!114 * !115 * !12_rite" name="starteffect" effect="move" src_x="-3000" dst_x="-3000" dst_y="0" start="11" end="12" />
            <Action condition="!114 * !115 * !12_rite" name="timer" id="116" time="16" />
            <Action condition="!114 * !115 * !12_rite" name="changeflag" set="115, 12_rite" />
        </Timer>
        <Timer timer_id="116">
            <Action name="changeflag" set="aaaa" clear="114, 115" />
        </Timer>
    </OnTimer>
</Object>
<Object name="auto_11" dx="500" initial_flags="11_left">
    <OnTimer>
        <Timer timer_id="111">
            <Action condition="!112 * !111 * 11_left" name="starteffect" effect="scale" src_x="1" src_y="1" dst_x="1" dst_y="1" start="0" end="0.5" />
            <Action condition="!112 * !111 * 11_left" name="starteffect" effect="move" src_x="0" dst_x="-2000" start="0.5" end="10.5" sound="car_move_left"/>
            <Action condition="!112 * !111 * 11_left" name="timer" id="113" time="11" />
            <Action condition="!112 * !111 * 11_left" name="changeflag" set="111" clear="11_left" />
        </Timer>
        <Timer timer_id="112">
            <Action condition="!111 * !112 * !11_left" name="starteffect" effect="scale" src_x="-1" src_y="1" dst_x="-1" dst_y="1" start="0" end="0.5" />
            <Action condition="!111 * !112 * !11_left" name="starteffect" effect="move" src_x="0" src_y="0" dst_x="2000" dst_y="0" start="0.5" end="10.5" sound="car_move_right"/>
            <Action condition="!111 * !112 * !11_left" name="timer" id="113" time="11" />
            <Action condition="!111 * !112 * !11_left" name="changeflag" set="112, 11_left" />
        </Timer>
        <Timer timer_id="113">
            <Action name="changeflag" set="aaa" clear="111, 112" />
        </Timer>
    </OnTimer>
</Object>


<Object name="maya_object_01" contour="./images/Level_21/maya_object_01_contour">
    <Clicker />
    <Hint flags="!pay_phone_moved" msg="MOVE_SOMETHING" />
</Object>
<aObject name="maya_object_02" contour="./images/Level_21/maya_object_02_contour">
    <Clicker />
</aObject>
<Object name="maya_object_03" contour="./images/Level_21/maya_object_03_contour">
    <Clicker />
</Object>
<Object name="maya_object_04" contour="./images/Level_21/maya_object_04_contour">
    <Clicker />
</Object>
<Object name="maya_object_05" contour="./images/Level_21/maya_object_05_contour">
    <Clicker />
</Object>
<Object name="maya_object_06" contour="./images/Level_21/maya_object_06_contour">
    <Clicker />
</Object>
<aObject name="maya_object_08" contour="./images/Level_21/maya_object_08_contour">
    <Clicker />
</aObject>
<aObject name="maya_object_09" contour="./images/Level_21/maya_object_09_contour">
    <Clicker />
</aObject>
<Object name="maya_object_10" contour="./images/Level_21/maya_object_10_contour">
    <Clicker />
</Object>
<Object name="maya_object_11" contour="./images/Level_21/maya_object_11_contour">
    <Clicker />
</Object>
<aObject name="maya_object_12" contour="./images/Level_21/maya_object_12_contour">
    <Clicker />
</aObject>
<Object name="maya_object_13" shadow="maya_object_13_shadow" contour="./images/Level_21/maya_object_13_contour">
    <Clicker />
</Object>
<aObject name="maya_object_14" contour="./images/Level_21/maya_object_14_contour">
    <Clicker />
</aObject>
<Object name="maya_object_15" contour="./images/Level_21/maya_object_15_contour">
    <Clicker />
</Object>
<aObject name="maya_object_16" contour="./images/Level_21/maya_object_16_contour">
    <Clicker />
</aObject>
<Object name="maya_object_17" contour="./images/Level_21/maya_object_17_contour">
    <Clicker />
</Object>
<Object name="maya_object_18" contour="./images/Level_21/maya_object_18_contour">
    <Clicker />
</Object>
<aObject name="maya_object_19" contour="./images/Level_21/maya_object_19_contour">
    <Clicker />
</aObject>
<aObject name="maya_object_19_1" contour="./images/Level_21/maya_object_19_1_contour">
    <Clicker />
</aObject>
<Object name="maya_object_20" contour="./images/Level_21/maya_object_20_contour">
    <Clicker />
</Object>
<Object name="maya_object_20_1" contour="./images/Level_21/maya_object_20_1_contour">
    <Clicker />
    <Hint flags="!s1_unlocked" msg="MOVE_MACHINU" />
</Object>
<Object name="maya_object_21" contour="./images/Level_21/maya_object_21_contour">
    <Clicker />
    <Hint flags="!s2_unlocked" msg="MOVE_MACHINU" />
</Object>


<Object name="auto_04" dx="-100" initial_flags="17_left">
    <OnTimer>
        <Timer timer_id="117">
            <Action condition="!118 * !117 * 17_left" name="starteffect" effect="scale" src_x="1" src_y="1" dst_x="1" dst_y="1" start="0" end="0.5" />
            <Action condition="!118 * !117 * 17_left" name="starteffect" effect="move" src_x="0" dst_x="2000" dst_y="0" start="0.5" end="7" sound="car_move_left"/>
            <Action condition="!118 * !117 * 17_left" name="timer" id="119" time="11" />
            <Action condition="!118 * !117 * 17_left" name="changeflag" set="117" clear="17_left" />
        </Timer>
        <Timer timer_id="118">
            <Action condition="!117 * !118 * !17_left" name="starteffect" effect="scale" src_x="-1" src_y="1" dst_x="-1" dst_y="1" start="0" end="0.5" />
            <Action condition="!117 * !118 * !17_left" name="starteffect" effect="move" src_x="0" src_y="0" dst_x="-2000" dst_y="0" start="0.5" end="7" sound="car_move_right"/>
            <Action condition="!117 * !118 * !17_left" name="timer" id="119" time="11" />
            <Action condition="!117 * !118 * !17_left" name="changeflag" set="118, 17_left" />
        </Timer>
        <Timer timer_id="119">
            <Action name="changeflag" set="aaa" clear="117, 118" />
        </Timer>
    </OnTimer>
</Object>

<Object name="pay_phone" >
    <Highlight type="hand_point_star" />
    <Click>
        <Action name="StopEffects" finish="1" />
        <Action name="StartEffect" condition="!pay_phone_moved" effect="move" dst_x="-40" dst_y="20" end="1" func="smooth" />
        <Action name="StartEffect" condition="pay_phone_moved" effect="move" dst_x="40" dst_y="-20" end="1" func="smooth" />
        <Action name="ChangeFlag">
            <Condition state="!pay_phone_moved" set="pay_phone_moved" />
            <Condition state="pay_phone_moved" clear="pay_phone_moved" />
        </Action>
         <Action name="ObjectState" active="0" />
    </Click>
</Object>
<Object name="tablet" >
<!--
    <Highlight type="hand_mask" />
    <Click>
        <Action name="StopEffects" finish="1" />
        <Action name="StartEffect" condition="!tablet_moved" effect="move" dst_x="0" dst_y="-40" end="1" func="smooth" />
        <Action name="StartEffect" condition="tablet_moved" effect="move" dst_x="0" dst_y="40" end="1" func="smooth" />
        <Action name="ChangeFlag">
            <Condition state="!tablet_moved" set="tablet_moved" />
            <Condition state="tablet_moved" clear="tablet_moved" />
        </Action>
    </Click>
-->
</Object>


<Dependency task="maya_object_01" priority="100" />
<aDependency task="maya_object_02" priority="100" />
<Dependency task="maya_object_03" priority="100" />
<Dependency task="maya_object_04" priority="100" />
<Dependency task="maya_object_05" priority="100" />
<Dependency task="maya_object_06" priority="100" />
<aDependency task="maya_object_08" priority="100" />
<aDependency task="maya_object_09" priority="100" />
<Dependency task="maya_object_10" priority="100" />
<Dependency task="maya_object_11" priority="100" />
<aDependency task="maya_object_12" priority="100" />
<Dependency task="maya_object_13" priority="100" />
<aDependency task="maya_object_14" priority="100" />
<Dependency task="maya_object_15" priority="100" />
<aDependency task="maya_object_16" priority="100" />
<Dependency task="maya_object_17" priority="100" />
<Dependency task="maya_object_18" priority="100" />
<aDependency task="maya_object_19" priority="100" />
<aDependency task="maya_object_19_1" priority="100" />
<Dependency task="maya_object_20_1" priority="10" />
<Dependency task="maya_object_21" priority="10" />
<Dependency task="maya_object_20" priority="100" />

<Interface color="fbe5bdff" />

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

<Sounds>
    <Sound id="car_move_left" path="sounds/car_move_left.ogg" />
    <Sound id="car_move_right" path="sounds/car_move_right.ogg" />
    <Sound id="car_remove" path="sounds/car_remove.ogg" />
    <Sound id="jam_fix" path="sounds/jam_fix.ogg" />
</Sounds>
