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

<puzzle>
   <!-- team include(s), max of 2 per puzzle -->
   <includeTeam>humans</includeTeam>
   <includeTeam>orcs</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>
      <premiumTiles>
   	     <premiumTile type="Power" x="4" y="2"/>
   	  </premiumTiles>
      <preplace name="wizard" x="2" y="0" player ="0"/>
      <preplace name="wizard" x="2" y="1" player ="0"/>
      <preplace name="wizard" x="2" y="2" player ="0"/>
      <preplace name="wizard" x="2" y="3" player ="0"/>
      <preplace name="wizard" x="2" y="4" player ="0"/>
      <preplace name="warrior" x="4" y="0" player ="1"/>      
      <preplace name="warrior" x="4" y="2" player ="1" healthFraction="0.4"/>      
      <preplace name="warrior" x="4" y="4" player ="1" healthFraction="0.75"/>      
      <preplace name="warrior" x="5" y="1" player ="1"/>     
      <preplace name="axethrower" x="5" y="3" player ="1" healthFraction="0.5"/>            
      <preplace name="axethrower" x="6" y="0" player ="1" healthFraction="0.75"/>          
      <preplace name="axethrower" x="6" y="2" player ="1" healthFraction="0.5"/>            
      <preplace name="Crystal" x="1" y="2" player ="0" victoryHealthPool="true"/>
	  <preplace name="Crystal" x="7" y="2" player ="1" victoryHealthPool="true"/>
   </board>
   
   <!-- tile spec -->
   <tileAllocation randomize="false">
      <tile name="scroll">1</tile>
      <tile name="scroll">1</tile>   
      <tile name="inferno">1</tile>   
   </tileAllocation>   
   <script>
      <onStart>
         <hideUI name="SubmitButton"/>      
         <hideUI name="SettingsButton"/>         
         <showDialog name="welcome" tapToClose="true" closeTag="OK1" showTapIcon="true">Challenge_Goal_TeamKill</showDialog>
      </onStart>
      <onNamedTag tagName="OK1">
      	 <hideAllDialogs/>
      	 <setSection name="GoWin"/>
      </onNamedTag>
      <section name="GoWin">
         <onKO count="7">
         	<sendTag tagName="Winning"/>
            <victory/>
         </onKO> 
         <untilTag tagName="Winning">
            <onAPRemaining count="0">
                <hideAllDialogs/>
                <showDialog name="fail" vAlign="Top" background="TutorialBubble02.png">Challenge_Defeat_NoAP</showDialog>
                <showArrow uiElement="ResetButton" orientation="Down"/>
            </onAPRemaining>
            <onUndo>
               <hideAllDialogs/>
               <hideArrow/>
            </onUndo>
          </untilTag> 
      </section>  
   </script>
</puzzle>