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

<puzzle>
   <!-- board spec -->
   <board>
      <Art gridOffsetX="-2.0" gridOffsetY="0.0">DwarfGameBoard.pvr</Art>
      <deployZone>
         <tile x="0" y="2"/>
      </deployZone>
      <premiumTiles/>
      <preplace name="archer" x="3" y="2" player="0" healthFraction="0.25"/>
      <preplace name="knight" x="3" y="3" player="0" healthFraction="0.25"/>
      <preplace name="archer" x="3" y="1" player="0" healthFraction="0.25"/>
      <preplace name="cleric" x="2" y="2" player="0"/>
      <preplace name="impaler" x="5" y="2" player ="1" healthFraction="0.25"/>
      <preplace name="voidmonk" x="7" y="3" player="1"/>
      <preplace name="priestess" x="8" y="1" player="1"/>
   </board>
   <!-- tile spec -->
   <tileAllocation randomize="false">
      <tile name="inferno">2</tile>
   </tileAllocation>
   <!-- script -->
   <script>
      <onStart>
         <showDialog name="welcome" tapToClose="true" closeTag="HealTime" showTapIcon="true">Today, we will learn about heal plz</showDialog>
         <setSection name="HealTime"/>
      </onStart>
      <section name="HealTime">
         <onNamedTag tagName="HealTime">
            <hideAllDialogs/>
            <showDialog name="NowHeal" vAlign="Top" background="TutorialBubble02.png">Task your cleric onto your wounded unit to heal them.</showDialog>
         </onNamedTag>
         <!--<onUnitHealed threshold="1.0" count="1">
            <hideAllDialogs/>
            <showDialog name="KOComplete" tapToClose="true" closeTag="Whatever">You healed a unit to full</showDialog>
         </onUnitHealed>
         <onUnitHealed protoName="knight" count="1">
            <hideAllDialogs/>
            <showDialog name="HealKnight" tapToClose="true" closeTag="Whatever">You healed a knight</showDialog>
         </onUnitHealed>-->
         <onUnitHealed count="3">
            <hideAllDialogs/>
            <showDialog name="HealThree" tapToClose="true" closeTag="Whatever">You healed three times</showDialog>
         </onUnitHealed>
         <onNamedTag tagName="JustKidding">
            <showDialog name="JustKidding" tapToClose="true" closeTag="StompingTime">Just kidding, I hated that guy. He's just unconscious anyway, which means your opponent might be able to revive him.</showDialog>
            <setSection name="StompTime"/>
         </onNamedTag>
         <onSpell>
            <setSection name="none"/>
            <sendTag tagName="prematureSpellFail"/>
         </onSpell>
         <onAPRemaining count="0">
            <setSection name="none"/>
            <sendTag tagName="apFail"/>
         </onAPRemaining>
      </section>
      <section name="StompTime">
         <onNamedTag tagName="StompingTime">
            <hideAllDialogs/>
            <showDialog name="NowStomp" vAlign="Top" background="TutorialBubble02.png">Move your unit over the unconscious unit.</showDialog>
         </onNamedTag>
         <onStomp>
            <hideAllDialogs/>
            <showDialog name="StompComplete" tapToClose="true" closeTag="BurningTime">Now that guy and all his gear have been removed from the game. He won't be bothering you again!</showDialog>
            <setSection name="BurningTime"/>
         </onStomp>
         <onSpell>
            <setSection name="none"/>
            <sendTag tagName="prematureSpellFail"/>
         </onSpell>
         <onAPRemaining count="0">
            <setSection name="none"/>
            <sendTag tagName="apFail"/>
         </onAPRemaining>
      </section>
      <section name="BurningTime">
         <onNamedTag tagName="BurningTime">
            <showDialog name="AboutBurning" tapToClose="true" closeTag="NowBurn" showTapIcon="true">See that enticing fireball on your rack? We can use that to blast a bunch of enemies at once!</showDialog>
         </onNamedTag>
         <onNamedTag tagName="NowBurn">
            <showDialog name="NowBurn1" vAlign="Top" background="TutorialBubble02.png">Deploy the inferno anywhere to create an awesome explosion</showDialog>
         </onNamedTag>
         <onSpell>
            <showDialog name="NowBurn2" vAlign="Top" background="TutorialBubble02.png">Yeah baby! Do it again!</showDialog>
            <setSection name="BurningTime2"/>
         </onSpell>
         <onAPRemaining count="0">
            <setSection name="none"/>
            <sendTag tagName="apFail"/>
         </onAPRemaining>
      </section>
      <section name="BurningTime2">
         <onSpell>
            <showDialog name="YouAreWinner" tapToClose="true" closeTag="Win" showTapIcon="true">Now that's what I call arson! Lesson adjourned</showDialog>
         </onSpell>
         <onNamedTag tagName="Win">
            <victory/>
         </onNamedTag>
         <onAPRemaining count="0">
            <setSection name="none"/>
            <sendTag tagName="apFail"/>
         </onAPRemaining>
      </section>
      <onNamedTag tagName="prematureSpellFail">
         <hideAllDialogs/>
         <showDialog name="SpellFail" tapToClose="true" closeTag="Fail" showTapIcon="true">I was going to get to that. Have some patience and follow directions!</showDialog>
      </onNamedTag>
      <onNamedTag tagName="apFail">
         <hideAllDialogs/>
         <showDialog name="APFail" tapToClose="true" closeTag="Fail" showTapIcon="true">You've run out of actions; stick to the curriculum! Let's start over and try again</showDialog>
      </onNamedTag>
      <onNamedTag tagName="Fail">
         <defeat/>
      </onNamedTag>
   </script>
</puzzle>