<tower maxlevel="5" 
       unittype="tower"
       name="roketgun"
       radius="290"
       effect_on_shoot="bullet"
       allowtargets="sky,sea"
       >
  <effects>
    <positive damage="7"/>
  </effects>

  <machine_unit>
    <transitions>
      <sleep seetarget="readyfire"/>
      <readyfire notarget="waittarget"/>
      <readyfire charge="charging"/>
      <charging ready="readyfire"/>
      <waittarget seetarget="readyfire"/>
      <waittarget relax="waittarget"/>
    </transitions>
    <params>
      <state_readyfire charge_volume="5" delay="0.1"/>
      <state_waittarget duration="3"/>
      <state_charging duration="1"/>
    </params>
  </machine_unit>

  <machine_move>
    <transitions>
      <move stop="stop"/>
      <stop move="move"/>
    </transitions>
  </machine_move>

  <mover>
    <params>
      <allowangles value="45,135,225,315"/>
      <thresold value="45"/>
    </params>
  </mover>
  

  <children>
    <node type="sprite" name="skin" image="roketgun.3.1::turret2_3_1stage0001.png" center="0.5x0.3"/>
  </children>

  <actions>
    <action name="animate135" value="Animate[0.5,[folder:roketgun.3.1::,frames:
         turret2_3_1stage0001.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0004.png,
        turret2_3_1stage0005.png,
        turret2_3_1stage0001.png
       ]]"/>
    <action name="animate315" value="Animate[0.5,[folder:roketgun.3.1::,frames:
         turret2_3_1stage0001.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0004.png,
        turret2_3_1stage0005.png,
        turret2_3_1stage0001.png
       ]]"/>
    
    <action name="animate45"  value="Animate[0.5,[folder:roketgun.3.1::,frames:
         turret2_3_1stage0001.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0004.png,
        turret2_3_1stage0005.png,
        turret2_3_1stage0001.png
       ]]"/>
    
    <action name="animate225" value="Animate[0.5,[folder:roketgun.3.1::,frames:
         turret2_3_1stage0001.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0002.png,
        turret2_3_1stage0003.png,
        turret2_3_1stage0004.png,
        turret2_3_1stage0005.png,
        turret2_3_1stage0001.png
       ]]"/>
  </actions>

  <events>
    <eventlist name="on_waittarget_45">
      <setproperty property="image" value="roketgun.3.1::turret2_3_1stage0001.png" target="skin"/>
    </eventlist>
    <eventlist name="on_waittarget_135">
      <setproperty property="image" value="roketgun.3.1::turret2_3_1stage0001.png" target="skin"/>
    </eventlist>
    <eventlist name="on_waittarget_225">
      <setproperty property="image" value="roketgun.3.1::turret2_3_1stage0001.png" target="skin"/>
    </eventlist>
    <eventlist name="on_waittarget_315">
      <setproperty property="image" value="roketgun.3.1::turret2_3_1stage0001.png" target="skin"/>
    </eventlist>

    <eventlist name="on_cocking">
    </eventlist>
    <eventlist name="on_relaxation">
    </eventlist>

    <eventlist name="on_shoot_byangle45">
      <runaction action="animate45" target="skin"/>
    </eventlist>
    <eventlist name="on_shoot_byangle135">
      <runaction action="animate135" target="skin"/>
    </eventlist>
    <eventlist name="on_shoot_byangle225">
      <runaction action="animate225" target="skin"/>
    </eventlist>
    <eventlist name="on_shoot_byangle315">
      <runaction action="animate315" target="skin"/>
    </eventlist>

    <eventlist name="on_shoot">
      <playsound sound="##sound_rocket##"/>
    </eventlist>
    <eventlist name="on_shoot1">
    </eventlist>
    <eventlist name="on_shoot2">
    </eventlist>

    <eventlist name="on_charging">

    </eventlist>

    <eventlist name="on_waittarget">
    </eventlist>

    <eventlist name="on_rotate180">
    </eventlist>

    <eventlist name="on_rotate0">
    </eventlist>

    <eventlist name="on_rotate90">
    </eventlist>

    <eventlist name="on_rotate270">
    </eventlist>

  </events>

</tower>
