<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Quest SName="rings" RName="rings" LName="rings">

  <ScaleEffect X="678" Y="480" Effect="1" StartScale="0" />


  <MoveX>
    <PosBegin Value="-100" />
    <Type Value="SIN" />
    <Delay Value="0" />
    <IsRandom Value="0" />
    <IsResetCycle Value="0" />
    <Params A="100" B="360" F="90"/>
    <TimeFunction Timer="0" Loop="1" MaxCount="0" K="1" B="0" />
  </MoveX>
  <MoveY>
    <PosBegin Value="0" />
    <Type Value="SIN" />
    <Delay Value="0" />
    <IsRandom Value="0" />
    <IsResetCycle Value="0" />
    <Params A="100" B="360" F="0"/>
    <TimeFunction Timer="0" Loop="1" MaxCount="0" K="1" B="0" />
  </MoveY>
  <MoveS>
    <PosBegin Value="1" />
    <Type Value="LINEAR" />
    <Delay Value="0" />
    <IsRandom Value="0" />
    <IsResetCycle Value="0" />
    <Params A="0" V="0.5" B="0"/>
    <TimeFunction Timer="0" Loop="1" MaxCount="0" K="1" B="0" />
  </MoveS>
  <Tasks>
    <Task Type="REQUEST_TASKS" NameOfRequest="MiniQuestEnter" />
    <Task Type="ADD_MARK" Key="Global" Name="LastMiniQuest" Value="rings" Mode="String"/>
  </Tasks>

  <Decorations>
    <Decoration>
      <Id Name="background" Order="1" SubId="1" />
      <Visible Value="1" />
      <Type Value="ANIM_MACHINE" />
      <MoveX>
        <Type Value="STATIC" />
        <PosBegin Value="207" />
      </MoveX>
      <MoveY>
        <Type Value="STATIC" />
        <PosBegin Value="4" />
      </MoveY>
      <AnimMachine BeginStep="background" EndStep="background">
        <Steps>
          <Step Key="default" Name="background" Delay="0" NameStep="background" />
        </Steps>
      </AnimMachine>
    </Decoration>
    
    <Decoration>
      <Id Name="indicator" Order="1" SubId="7" />
      <Visible Value="0" />
      <Type Value="ANIM_MACHINE" />
      <MoveX>
        <Type Value="STATIC" />
        <PosBegin Value="490" />
      </MoveX>
      <MoveY>
        <Type Value="STATIC" />
        <PosBegin Value="57" />
      </MoveY>
      <AnimMachine BeginStep="indicator" EndStep="indicator">
        <Steps>
          <Step Key="default" Name="indicator" Delay="0" NameStep="indicator" />
        </Steps>
      </AnimMachine>
    </Decoration>

    <Decoration>
      <Id Name="ring_with_eyes" Order="1" SubId="5" />
      <Visible Value="0" />
      <Type Value="ANIM_MACHINE" />
      <MoveX>
        <Type Value="STATIC" />
        <PosBegin Value="301" />
      </MoveX>
      <MoveY>
        <Type Value="STATIC" />
        <PosBegin Value="93" />
      </MoveY>
      <AnimMachine BeginStep="ring_with_eyes" EndStep="ring_with_eyes">
        <Steps>
          <Step Key="default" Name="ring_with_eyes" Delay="100" NameStep="ring_with_eyes" />
        </Steps>
      </AnimMachine>
    </Decoration>

    <Decoration>
      <Id Name="indicator" Order="1" SubId="7" />
      <Visible Value="1" />
      <Type Value="ANIM_MACHINE" />
      <MoveX>
        <Type Value="STATIC" />
        <PosBegin Value="490" />
      </MoveX>
      <MoveY>
        <Type Value="STATIC" />
        <PosBegin Value="57" />
      </MoveY>
      <AnimMachine BeginStep="indicator" EndStep="indicator">
        <Steps>
          <Step Key="default" Name="indicator" Delay="0" NameStep="indicator" />
        </Steps>
      </AnimMachine>
    </Decoration>

  </Decorations>

  <Functionals>

    <Functional>
      <Type Value="ITEM" />
      <Id Name="ring_with_eyes_f" Order="2" SubId="61" />
      <Mask Key="mask" Name="ring_with_eyes_m" />
      <Description Key="hint" Name="1" />
      <Enable Value="0" />
      <Visible Value="1" />
      <IsOnceAction Value="0" />
      <MoveX>
        <Type Value="STATIC" />
        <PosBegin Value="424" />
      </MoveX>
      <MoveY>
        <Type Value="STATIC" />
        <PosBegin Value="226" />
      </MoveY>
      <Puzzles>
        <Puzzle Name="for_eyes" X="0" Y="0" W="1" H="1" />
      </Puzzles>
      <TasksOnDeny>
          <Task Type="SET_SOUND" Mode="DelayPlay" Name="search_denied2.ogg" Delay="100"/>
      </TasksOnDeny>
      <Cursor Key="default" Name="mechanic" />
      <Tasks>
        <Task Type="ENABLE" Param1="ring_with_eyes_f" Param2="0" Param3="0" />
        <Task Type="VISIBLE" Param1="ring_with_eyes" Param2="1" Param3="0" Param4="500" />
        <Task Type="SET_SCENE" Mode="Set" Name="excavations"/>
        <Task Type="REQUEST_TASKS" Param1="piramid_conver_start" />
        <Task Type="SET_SCENE" Mode="Reset"/>
        <Task Type="QUEUE" Mode="begin" Name="eyes_q" />
        <Task Type="DELAY" Delay="2000" />
        <Task Type="ADD_MARK" Param1="rings" Param2="State" Param3="4" />
        <Task Type="QUEUE" Mode="end" />
      </Tasks>
    </Functional>

    <Functional>
      <Type Value="ITEM" />
      <Id Name="psevdo1" Order="2" SubId="61" />
      <Mask Key="mask" Name="psevdo_m" />
<!--      <Description Key="hint" Name="1" />-->
      <Enable Value="1" />
      <Visible Value="1" />
      <IsOnceAction Value="0" />
      <MoveX>
        <Type Value="STATIC" />
        <PosBegin Value="301" />
      </MoveX>
      <MoveY>
        <Type Value="STATIC" />
        <PosBegin Value="93" />
      </MoveY>
      <Puzzles>
        <Puzzle Name="psevdo1" X="0" Y="0" W="1" H="1">
        <Tasks>
          <Task Type="SET_SCENE" Mode="Set" Name="excavations"/>
          <Task Type="VISIBLE" Param1="dig_pyramid_rings" Param2="1" Param3="0" />
            <Task Type="ENABLE" Param1="psevdo1" Param2="0" Param3="0" />
            <Task Type="ENABLE" Param1="rings_mini_game" Param2="1" Param3="0" />
          <Task Type="SET_SCENE" Mode="Reset"/>
          <Task Type="ADD_MARK" Param1="rings" Param2="State" Param3="2" />
        </Tasks>
        </Puzzle>
      </Puzzles>
      <TasksOnDeny>
          <Task Type="SET_SOUND" Mode="DelayPlay" Name="search_denied2.ogg" Delay="100"/>
          <Task Type="SET_SCENE" Mode="Set" Name="excavations"/>
          <Task Type="TOPDESCRIPTION" SKey="hint" SName="pyr_closed" />
          <Task Type="SET_SCENE" Mode="Reset"/>
      </TasksOnDeny>
      <Cursor Key="default" Name="mechanic" />
      <Tasks>
      </Tasks>
    </Functional>
    
  </Functionals>

  <RequestTasks>
    <!--Эта задача выполянется если запущен квест запущен первый раз-->

    <RequestTask Name="QuestOnBegin">
      <Condition>
        <Var Key="rings" Name="State" Value="0" />
      </Condition>
      <Tasks>
        <Task Type="ADD_MARK" Param1="rings" Param2="State" Param3="1" />
        <Task Type="ENABLE" Param1="psevdo1" Param2="1" Param3="0" />
          <Task Type="SET_SCENE" Mode="Set" Name="excavations"/>
          <Task Type="TOPDESCRIPTION" SKey="hint" SName="pyr_closed" />
          <Task Type="SET_SCENE" Mode="Reset"/>
        <Task Type="EMULATE_HINT" Action="UsrEvt" Name="ring_enter"/>
      </Tasks>
    </RequestTask>

    <!--Эта задача выполняется непосредственно перед началом игры-->
    <RequestTask Name="GameOnBegin">
      <Condition>
        <Var Key="rings" Name="State" Value="2" />
      </Condition>
      <Tasks>
        <Task Type="SET_HINT" Param1="goal" Param2="1" Param3="0" />
        <Task Type="ENABLE" Param1="psevdo1" Param2="0" Param3="0" />
      </Tasks>
    </RequestTask>

    <!--Эта задача выполняется непосредственно если происходит выйгрышь или пропуск-->
    <RequestTask Name="GameOnWinOrPass">
      <Condition>
        <Var Key="rings" Name="State" Value="3" />
      </Condition>
      <Tasks>
        <Task Type="REQUEST_TASKS" NameOfRequest="manual_hide" />
        <Task Type="SET_SOUND" Mode="Replay" Name="gong.ogg" />
        <Task Type="REQUEST_TASKS" Param1="Win" />
      </Tasks>
    </RequestTask>

    <RequestTask Name="GameOnLose">
      <Condition>
        <Var Key="no" Name="no" Value="0" />
      </Condition>
      <Tasks>
        <Task Type="REQUEST_TASKS" NameOfRequest="close" />
      </Tasks>
    </RequestTask>

    <RequestTask Name="GameOnCancel">
      <Condition>
        <Var Key="no" Name="no" Value="0" />
      </Condition>
      <Tasks>
        <Task Type="REQUEST_TASKS" NameOfRequest="close" />
      </Tasks>
    </RequestTask>

    <!--Эта задача выполняется непосредственно когда происходит завершение уровня-->
    <RequestTask Name="QuestOnEnd">
      <Condition>
        <Var Key="rings" Name="State" Value="4" />
      </Condition>
      <Tasks>
        <Task Type="REQUEST_TASKS" NameOfRequest="close" />
      </Tasks>
    </RequestTask>

    <RequestTask Name="Win">
      <Condition>
        <Var Key="rings" Name="win_mark" Value="0" />
      </Condition>
      <Tasks>
        <Task Type="ADD_MARK" Key="excavations" Name="need_eyes_find" Value="1" />
        <Task Type="ENABLE" Param1="ring_with_eyes_f" Param2="1" Param3="0" />
        <Task Type="MOVE" Name="indicator" X="0" Y="34" IsShift="1" Mode="5" Loop="1000" />
          <Task Type="SET_SOUND" Mode="DelayPlay" Name="rock_move.ogg" Delay="0"/>
        <Task Type="ADD_MARK" Key="rings" Name="win_mark" Value="1" />
          <Task Type="SET_SOUND" Mode="DelayPlay" Name="search_denied2.ogg" Delay="1500"/>
            <Task Type="QUEUE" Mode="begin" Name="no_eyes" />
            <Task Type="DELAY" Delay="1500" />
        <Task Type="TOPDESCRIPTION" SKey="dialog" SName="1" />
        <Task Type="ADD_ITEM" Param1="GROUP" Param2="eyes_group" Param3="0" />
<!--        <Task Type="CONVERSATION" Param1="no_eyes" Param2="0" Param3="0" />-->
            <Task Type="QUEUE" Mode="end" />
        <Task Type="EMULATE_HINT" Action="UsrEvt" Name="rings_mini_game_win"/>

      </Tasks>
    </RequestTask>

    <RequestTask Name="manual_show">
      <Condition>
        <Var Key="no" Name="no" Value="0" />
      </Condition>
      <Tasks>
        <Task Type="SET_ANIMATIONTOOL" ResName="rings" AKey="default" AName="manual" CtrlName="manual" RX="512" RY="315" SX="207" SY="10" SW="610" SH="610" RequestName="manual_hide" Angle="0" IsFlickr="0"/>
      </Tasks>
    </RequestTask>
  </RequestTasks>

<!--  <Conversations>
    <Conversation Name="no_eyes" CountOfStartSentese="1">
      <Dialogs>
        <Sentense>
          <Character>
            <Body Key="mia" Name="default"/>
            <Align Value="left"/>
          </Character>
          <Dialog>
            <Description Key="dialog" Name="1"/>
            <Align Value="left"/>
          </Dialog>
        </Sentense>
      </Dialogs>
      <Tasks>
        <Task Type="ADD_ITEM" Param1="GROUP" Param2="eyes_group" Param3="0" />
      </Tasks>
    </Conversation>
  </Conversations>-->

</Quest>
