<tower  template="ini/units/creepTemplate.xml"
  unittype="creep"
  name="creepBerserkBoss"
  velocity="35"
  health="199"
  radius="150"
  unitlayer="earth"
  lifecost="10"
  sound_onmove="##tambourine##"
      >
  <effects>
    <positive armor="75" electroResist="1" fireResist="100" iceResist="2" moveResist="100"/>
  </effects>

  <machine_unit start_state="stop">
    <transitions>
      <move stop="stop"/>
      <move die="death"/>
      <stop move="move"/>
      <stop die="death"/>
      <death stop="stop"/>
    </transitions>
    <params>
      <state_death duration="3"/>
      <state_readyfire charge_volume="99999" delay="1"/>
	  <state_move alwaysmove="no"/>
    </params>
  </machine_unit>

  <mover>
    <params>
      <allowangles value="0,45,90,135,180,225,270,315"/>
      <thresold value="22.5"/>
    </params>
  </mover>

  <children>
    <node type="sprite" name="skin" visible="yes" center="0.5x0.25" scale="1x1"/>
    <node type="sprite" name="skin1" visible="no" center="0.5x0.25" scale="1x1"/>
    <!-- <node type="sprite" name="skin2" visible="yes" center="0.5x0.25" scale="0.7x0.7" image="images::druidGlow.png" z="1" color="00FF00" opacity="128"/> -->
    <node name="health_indicator" pos="-18x55" z="1"/>
  </children>

  <actions>
    <action name="animate_r" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_r.,indexes:.png,001:012]]]"/>
    <action name="animate_l" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_l.,indexes:.png,001:012]]]"/>
    <action name="animate_u" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_u.,indexes:.png,001:012]]]"/>
    <action name="animate_d" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_d.,indexes:.png,001:012]]]"/>
    <action name="animate_dr" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_dr.,indexes:.png,001:012]]]"/>
    <action name="animate_dl" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_dl.,indexes:.png,001:012]]]"/>
    <action name="animate_ur" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_ur.,indexes:.png,001:012]]]"/>
    <action name="animate_ul" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_ul.,indexes:.png,001:012]]]"/>

    <action name="animate1_r" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_r.,indexes:.png,013:023]]]"/>
    <action name="animate1_l" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_l.,indexes:.png,013:023]]]"/>
    <action name="animate1_u" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_u.,indexes:.png,013:023]]]"/>
    <action name="animate1_d" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_d.,indexes:.png,013:023]]]"/>
    <action name="animate1_dr" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_dr.,indexes:.png,013:023]]]"/>
    <action name="animate1_dl" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_dl.,indexes:.png,013:023]]]"/>
    <action name="animate1_ur" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_ur.,indexes:.png,013:023]]]"/>
    <action name="animate1_ul" value="RepeatForever[Animate[1.0,[folder:creepHammerman4::creepHammerman4_ul.,indexes:.png,013:023]]]"/>

    <action name="animate_die" value="Sequence[DelayTime[0.0..0.3],Animate[0.5,[folder:creepHammerman4::creepHammerman4_death.,indexes:.png,001:007]],DelayTime[1..2],FadeOut[0.5]]"/>
  </actions>

  <events>
    <eventlist name="on_die">
      <stopallaction target="skin"/>
      <action action="animate_die" target="skin" state="run"/>
      <setproperty target="." property="z" value="-1000"/>
      <setproperty target="skin2" property="visible" value="no"/>
    </eventlist>

    <eventlist name="on_stop">
      <stopallaction target="skin"/>
	   <playsound sound="##tambourine##"/>
    </eventlist>


    <eventlist name="on_shoot">
      <!--<playsound sound="##sound_soldier_shoot##"/>
      <stopallaction target="skin"/>
      <action action="animate_fire" target="skin" state="run"/>-->
    </eventlist>

    <eventlist name="on_rotate0">
      <stopallaction target="skin"/>
      <action action="animate_r" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop0">
		<stopallaction target="skin1"/>
		<action action="animate1_r" target="skin1" state="run"/>
    </eventlist>

    <eventlist name="on_rotate45">
      <stopallaction target="skin"/>
      <action action="animate_dr" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop45">
		<stopallaction target="skin1"/>
		<action action="animate1_dr" target="skin1" state="run"/>
    </eventlist>

    <eventlist name="on_rotate90">
      <stopallaction target="skin"/>
      <action action="animate_d" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop90">
		<stopallaction target="skin1"/>
		<action action="animate1_d" target="skin1" state="run"/>
    </eventlist>

    <eventlist name="on_rotate135">
		<stopallaction target="skin"/>
		<action action="animate_dl" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop135">
		<stopallaction target="skin1"/>
		<action action="animate1_dl" target="skin1" state="run"/>
    </eventlist>

    <eventlist name="on_rotate135">
      <stopallaction target="skin"/>
      <action action="animate_dl" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop135">
      	<stopallaction target="skin1"/>
		<action action="animate1_dl" target="skin1" state="run"/>
    </eventlist>

    <eventlist name="on_rotate180">
      <stopallaction target="skin"/>
      <action action="animate_l" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop180">
		<stopallaction target="skin1"/>
		<action action="animate1_l" target="skin1" state="run"/>
    </eventlist>

    <eventlist name="on_rotate225">
      <stopallaction target="skin"/>
      <action action="animate_ul" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop225">
		<stopallaction target="skin1"/>
		<action action="animate1_ul" target="skin1" state="run"/>
    </eventlist>


    <eventlist name="on_rotate270">
      <stopallaction target="skin"/>
      <action action="animate_u" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop270">
		<stopallaction target="skin1"/>
		<action action="animate1_u" target="skin1" state="run"/>
    </eventlist>

    <eventlist name="on_rotate315">
      <stopallaction target="skin"/>
      <action action="animate_ur" target="skin" state="run"/>
    </eventlist>
    <eventlist name="on_stop315">
		<stopallaction target="skin1"/>
		<action action="animate1_ur" target="skin1" state="run"/>
    </eventlist>


  </events>

</tower>
