<?xml version="1.0" encoding="utf-8"?>

<puzzle>
   <!-- team include(s), max of 2 per puzzle -->
   <includeTeam>humans</includeTeam>
   <includeTeam>darkelves</includeTeam>
   <!-- board spec -->
   <board>
      <Art gridOffsetX="-2.0" gridOffsetY="0.0">GameBoard02.pvr</Art>
      <deployZone>
         <tile x="0" y="1"/>
         <tile x="0" y="3"/>
      </deployZone>
      <preplace name="archer" x="3" y="0" player ="0"/>
      <preplace name="knight" x="3" y="4" player ="0"/>      
      <preplace name="wizard" x="3" y="2" player ="0"/>
      <preplace name="Crystal" x="1" y="2" player ="0" victoryHealthPool="true"/>
	  <preplace name="Crystal" x="7" y="2" player ="1" victoryHealthPool="true"/>
	  <preplace name="priestess" x="5" y="1" player ="1" healthFraction="0.2"/>
	  <preplace name="impaler" x="5" y="3" player ="1" healthFraction="0.55"/>                   
	  <preplace name="voidmonk" x="6" y="0" player ="1" healthFraction="0.2"/>                     
   </board>
   <!-- tile spec -->
   <tileAllocation randomize="false">
   </tileAllocation>   
   <script>
      <onStart>
         <hideUI name="TileChest"/>
         <hideUI name="SettingsButton"/>      
         <showDialog name="welcome" tapToClose="true" closeTag="OK1" showTapIcon="true">Tutorial_8_01</showDialog>
      </onStart>
      <onNamedTag tagName="OK1">
         <hideDialog name="welcome"/>
         <showDialog name="welcome2" tapToClose="true" closeTag="OK2" showTapIcon="true">Tutorial_7_02</showDialog>
      </onNamedTag>
      <onNamedTag tagName="OK2">
         <hideDialog name="welcome2"/>
         <setSection name="GoWinThenMainMenu"/>
         <setSection name="GoWin" requiresPlayedBefore="true"/>
      </onNamedTag>
      <section name="GoWin">
         <onKO count="3">
         	<sendTag tagName="Winning"/>
         	<showDialog name="congrats" tapToClose="true" closeTag="OK3" showTapIcon="true">Tutorial_8_02</showDialog>
            <setSection name="YouWon"/>
         </onKO> 
      </section>
      <section name="GoWinThenMainMenu">
         <onKO count="3">
         	<sendTag tagName="Winning"/>
         	<showDialog name="loginPlease" tapToClose="true" closeTag="OK3" showTapIcon="true">Tutorial_8_03</showDialog>
            <setSection name="NowMainMenu"/>
         </onKO> 
      </section>
      <untilTag tagName="Winning">
         <onAPRemaining count="0">
            <hideAllDialogs/>
            <showDialog name="fail" tapToClose="true" closeTag="reset" showTapIcon="true">Tutorial_Error_NoAP</showDialog>
         </onAPRemaining>
         <onNamedTag tagName="reset">
            <reset/>
         </onNamedTag>
      </untilTag> 
      <section name="YouWon">
          <onNamedTag tagName="OK3">
              <victory/>
          </onNamedTag>
      </section>
      <section name="NowMainMenu">
         <onNamedTag tagName="OK3">
            <victory callToAction="true"/>
         </onNamedTag>
      </section>
   </script>
</puzzle>