<?xml version="0.1" encoding="UTF8" ?>
<Layer name="statusbar_bg" x="0" y="0" path="./images/statusbar/statusbar_bg" />
<Layer name="statusbar_line" x="-330" y="3" path="./images/statusbar/statusbar_line" />
<Layer name="statusbar_forground" x="0" y="0" path="./images/statusbar/statusbar_forground" />
<Object name="status_bar">
    <Functions>
        <Function name="sb_move_40">
            <Action name="StartEffect" target_layer="statusbar_line" effect="move" dst_x="40" end="0.5" />
        </Function>
    </Functions>
</Object>
<Object name="anti_evil">
    <Inventory image="./images/inventory/magic" present="1" cursor="magic" />
</Object>
<Object name="curtain01">
    <Effects>
        <Idle>
            <Effect name="shake" amp="0.005" rand="1" speed="0.6" />
        </Idle>
    </Effects>
</Object>
<Object name="curtain02">
    <Effects>
        <Idle>
            <Effect name="shake" amp="0.005" rand="1" speed="0.6" />
        </Idle>
    </Effects>
</Object>

<Object name="level_control">
    <FlagChanged>
        <Flags state="[global]solitaire1_completed" once="1">
            <Action name="function" target="status_bar" function="sb_move_40" />
			<Action name="Timer" id="timer_s2" time="0" />
        </Flags>
        <Flags state="[global]solitaire2_completed" once="1">
            <Action name="function" target="status_bar" function="sb_move_40" />
			<Action name="Timer" id="timer_s3" time="0" />
        </Flags>
        <Flags state="[global]solitaire3_completed" once="1">
            <Action name="function" target="status_bar" function="sb_move_40" />
			<Action name="Timer" id="timer_badman_anim" time="0.5" />
			<Action name="Timer" id="timer_end" time="4" />
        </Flags>
    </FlagChanged>
    <OnTimer>
        <Timer timer_id="timer_s1">
            <Action name="Sublocation" location="solitaire1" />
        </Timer>
        <Timer timer_id="timer_s2">
            <Action name="Sublocation" location="solitaire2" />
        </Timer>
        <Timer timer_id="timer_s3">
            <Action name="Sublocation" location="solitaire3" />
        </Timer>
        <Timer timer_id="timer_badman_anim">
			<Action name="Journal" level="9.1" />
			<Action name="LayerState" layer="badman" visible="1" />
            <Action name="StartEffect" target_layer="badman" effect="alpha" src="255" dst="0" start="0.5" end="2.5" />
            <Action name="StartEffect" target_layer="badman" effect="scale" src="1" dst="0.5" start="0.5" end="2.5" />
            <Action name="StartEffect" target_layer="badman" effect="move" dst_y="100" start="0.5" end="2.5" />
            <Action name="StartEffect" target_layer="badman" effect="particle" align="layer" path="./ps/badman_dies.ps" stop="1.5" />
        </Timer>
        <Timer timer_id="timer_end">
			<Action name="CompleteTask" task="idle_task" />
        </Timer>
    </OnTimer>
</Object>

<Layer name="badman" x="-20" y="145" path="./characters/badman" visible="0" />

<Layer name="placeholders1" x="748" y="39" path="./images/cards/restart_button" />
<Layer class="solitaire" name="solitaire_layer1" onFinish="finish_solitaire1">
    <Cards path="./kasko2/cards_img.xml" after="" />
    <Game type="fairway" hint_time="5" lock_hint="1" hl_delay="1" result="fairway" win_condition="AllCards">
        <Deck position="430, 465" offset="0.1,-0.1" threshold="2,2" finish="600, 900" holder="placeholders1" h_offset="-30,-30" opened="555, 465" />
        <Final position="350, 310" offset="101.5, 0" holder="placeholders1" h_offset="-91,-32" final="350,800" hidden="350,310" />

        <Group position="300, 140" offset="0, 17" count="4" />
        <Group position="400, 125" offset="0, 17" count="6" />
        <Group position="500, 110" offset="0, 17" count="8" />
        <Group position="600, 125" offset="0, 17" count="6" />
        <Group position="700, 140" offset="0, 17" count="4" />
        <Effects move="./ps/divination_move.ps">
            <Highlight particles="./ps/divination_select.ps" scale_loop="1, 1.1, 0.5" />
        </Effects>
        <WrongClick font="./fonts/icambria28.txt" color="FFFFFFFF" />
        <State group="0" pos="2" state="evil" image="./images/cards/loc_evil"/>
        <State group="1" pos="4" state="evil" image="./images/cards/loc_evil"/>
        <State group="2" pos="7" state="evil" image="./images/cards/loc_evil"/>
        <State group="3" pos="4" state="evil" image="./images/cards/loc_evil"/>
        <State group="4" pos="2" state="evil" image="./images/cards/loc_evil"/>
        <Solver state="evil" object="anti_evil" effect="composite_file" path="./images/cards/magic_eff.xml" begin="1" end="1.5" />
    </Game>
</Layer>
<Layer name="placeholders2" x="748" y="39" path="./images/cards/restart_button" />
<Layer class="solitaire" name="solitaire_layer2" onFinish="finish_solitaire2">
    <Cards path="./kasko2/cards_img.xml" after="" />
    <Game type="fairway" hint_time="5" lock_hint="1" hl_delay="1" result="fairway" win_condition="AllCards">
        <Deck position="430, 465" offset="0.1,-0.1" threshold="2,2" finish="600, 900" holder="placeholders2" h_offset="-30,-30" opened="555, 465" />
        <Final position="350, 310" offset="101.5, 0" holder="placeholders2" h_offset="-91,-32" final="350,800" hidden="350,310" />

        <Group position="245, 180" offset="0, 17" count="5" />
        <Group position="345, 160" offset="0, 17" count="4" />
        <Group position="445, 180" offset="0, 17" count="5" />
        <Group position="545, 160" offset="0, 17" count="4" />
        <Group position="645, 180" offset="0, 17" count="5" />
        <Group position="745, 160" offset="0, 17" count="4" />
        <aGroup position="795, 180" offset="0, 17" count="5" />
        <Effects move="./ps/divination_move.ps">
            <Highlight particles="./ps/divination_select.ps" scale_loop="1, 1.1, 0.5" />
        </Effects>
        <WrongClick font="./fonts/icambria28.txt" color="FFFFFFFF" />
        <State group="1" pos="2" state="evil" image="./images/cards/loc_evil"/>
        <State group="2" pos="4" state="evil" image="./images/cards/loc_evil"/>
        <State group="3" pos="3" state="evil" image="./images/cards/loc_evil"/>
        <State group="4" pos="2" state="evil" image="./images/cards/loc_evil"/>
        <Solver state="evil" object="anti_evil" effect="composite_file" path="./images/cards/magic_eff.xml" begin="1" end="1.5" />
    </Game>
</Layer>
<Layer name="placeholders3" x="748" y="39" path="./images/cards/restart_button" />
<Layer class="solitaire" name="solitaire_layer3" onFinish="finish_solitaire3">
    <Cards path="./kasko2/cards_img.xml" after="" />
	<Game type="mahjong" dispose="924, 100" after="svecha" offset="250, -70" result="mahjong" win_condition="AllCards">
		<Deck position="380, 500" offset="0.1,-0.1" threshold="1, 1" finish="600, 900" holder="placeholders3" h_offset="-30,-30" />
		<Final position="350, 530" offset="101, 0" holder="placeholders3c" h_offset="-91,-32" final = "350, 225" hidden="-700, 900" />
		<Opened position="530, 500" offset="0.25, -0.25" threshold="1, 1" holder="placeholderscopy2" h_offset="-77, -57" />
		<Opened position="650, 500" offset="0.25, -0.25" threshold="1, 1" holder="placeholderscopy3" h_offset="-77, -57" />
		<Group name="1" position="66, 170" offset="0, 40" threshold="" count="4" goal="1"/>
		<Group name="2" position="570, 290" offset="0, -40" threshold="" count="4" goal="1" />
		<Group name="3" position="190, 150" offset="40, -10" threshold="" count="3" goal="1" lock="5" />
		<Group name="4" position="445, 150" offset="-40, -10" threshold="" count="3" goal="1" lock="5" />
		<Group name="5" position="317, 110" offset="0, 0" threshold="" count="1" goal="0" />
		<Group name="6" position="190, 310" offset="40, 10" threshold="" count="3" goal="1" lock="8"/>
		<Group name="7" position="445, 310" offset="-40, 10" threshold="" count="3" goal="1" lock="8" />
		<Group name="8" position="317, 350" offset="0, 0" threshold="" count="1" goal="0"/>
		<Effects move="./ps/divination_move.ps">
		  <Highlight particles="./ps/divination_select.ps" scale_loop="1,1.1,0.5" />
		  <Remove path="./ps/divination_chpok.ps" stop="0.1" />
		</Effects>
		<WrongClick font="./fonts/icambria28.txt" color="FFFFFFFF" />
        <State group="2" pos="2" state="evil" image="./images/cards/loc_evil" />
        <State group="3" pos="1" state="evil" image="./images/cards/loc_evil" />
        <State group="4" pos="2" state="evil" image="./images/cards/loc_evil" />
        <State group="6" pos="1" state="evil" image="./images/cards/loc_evil" />
        <Solver state="evil" object="anti_evil" effect="composite_file" path="./images/cards/magic_eff.xml" begin="1" end="1.5" />
    </Game>
</Layer>

<SubLocation name="solitaire1" type="embedded_ispy" close_outside="0">
    <Fade bkg_color="000000c0" time="0.1" />
    <Layer name="placeholders1" />
    <Layer name="solitaire_layer1" />
<ActionList name="finish_solitaire1">
	<Action name="ChangeFlag" set="[global]solitaire1_completed" />
    <Action name="Sublocation" location="solitaire1" show="0" />
</ActionList>
</SubLocation>
<SubLocation name="solitaire2" type="embedded_ispy" close_outside="0">
    <Fade bkg_color="000000c0" time="0.1" />
    <Layer name="placeholders2" />
    <Layer name="solitaire_layer2" />
<ActionList name="finish_solitaire2">
	<Action name="ChangeFlag" set="[global]solitaire2_completed" />
    <Action name="Sublocation" location="solitaire2" show="0" />
</ActionList>
</SubLocation>
<SubLocation name="solitaire3" type="embedded_ispy" close_outside="0">
    <Fade bkg_color="000000c0" time="0.1" />
    <Layer name="placeholders3" />
    <Layer name="solitaire_layer3" />
<ActionList name="finish_solitaire3">
	<Action name="ChangeFlag" set="[global]solitaire3_completed" />
    <Action name="Sublocation" location="solitaire3" show="0" />
</ActionList>
</SubLocation>

<Task name="idle_task" object="" hidden="1" />

<StartActions>
	<Action name="Call" function="SwitchTab" params="inv" /> 
	<Action name="Timer" id="timer_s1" time="0.5" />
</StartActions>

<Sounds>
    <Sound id="cards_deal" path="sounds/cards_deal.ogg" />
    <Sound id="card_activate" path="sounds/card_activate.ogg" />
    <Sound id="cards_disappear" path="sounds/cards_disappear.ogg" />
    <Sound id="div_card_wrong" path="sounds/div_card_wrong.ogg" />
    <Sound id="div_card_sel" path="sounds/div_card_sel.ogg" />
</Sounds>


