<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>sTankCannon</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>-4</depth>
  <persistent>0</persistent>
  <parentName>&lt;undefined&gt;</parentName>
  <maskName>&lt;undefined&gt;</maskName>
  <events>
    <event eventtype="0" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>canbeX = 0;
//myhealth = 100;
myhealth = global.mod_tankHcannon;
image_speed = 0.15;
shaking = 0;
flashing = 0;
offx = 0;
offy = 0;
damaged = 0;
charge_frame = 0;
alarm[1] = 120;
canfire = 1;
cooldown = 0;
shots = 0;
knockback = 0;

//1.4.4
charge = 0;
chargeType = sTankCannonCharge;
beamIndex = 0;
beamType = "PLASMA";
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="2">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (shots &gt; 0 &amp;&amp; damaged == 0) {
    event_user(2);
    shots -= 1;
    knockback = 5;
    alarm[2] = 20;
} else with (oTank) tgt_aangle = 0;
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="1">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>canfire = 1;
charge_frame = 0;
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>gravity_direction = 270;
gravity = 0.12;
vspeed = -1;
with (oTankArm) event_user(2);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="3" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (beamIndex == 1) {
    oTank.iceOff = 1;
} else {
    oTank.iceOff = 0;
}
if (damaged == 0) {
    image_angle = direction;
    if (canfire &amp;&amp; cooldown == 0) {
        if (charge_frame &lt; 22) {
            charge_frame += 0.25;
        } else {
            shots = 3 - beamIndex;
            alarm[2] = 30;
            cooldown = 230;
            with (oTank) tgt_aangle = 20;
        }
    }
    if (cooldown &gt; 0) {
        cooldown -= 1;
        if (charge_frame &gt; 0 &amp;&amp; shots == 0) {
            charge_frame -= 1;
        }
        if (cooldown == 100) {
            //charge_frame = 0;
            if (beamIndex &lt; 2) {
                beamIndex += 1;
            } else {
                beamIndex = 0;
            }
            // determine types/sprites
            switch beamIndex {
                case 0: chargeType = sTankCannonCharge; beamType = "PLASMA"; break;
                case 1: chargeType = sTankCannonCharge2; beamType = "ICE"; break;
                case 2: chargeType = sTankCannonCharge3; beamType = "WAVE"; break;
            }
        }
    }
}
if (shaking &gt; 0) {
    shaking -= 1;
    offx = random_range(-1, 1);
    offy = random_range(-1, 1);
} else {
    offx = 0;
    offy = 0;
}
if (flashing &gt; 0) flashing -= 1;
if (knockback &gt; 0) {
    knockback -= 1;
    with (oTank) aangle -= 5;
}
if (damaged) {
    if (image_angle &gt; 180) image_angle -= 360;
    if (image_angle &gt; 0) image_angle -= 1;
    if (image_angle &lt; 0) image_angle += 1;
}

// 1.4.4
charge = charge_frame/22;
if (!damaged) image_speed = max(0, (charge_frame/22)/1.8);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="4" ename="oBomb2">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>with (other) event_user(0);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="4" ename="oMissile">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (damaged == 0) {
    myhealth -= 10 * (1 + other.smissile * 2);
    event_user(0);
    with (other) event_user(0);
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="4" ename="oBeam">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (damaged == 0 &amp;&amp; flashing &lt; 3) {
    myhealth -= 1;
    event_user(0);
    with (other) {
        event_user(0);
        if (!pbeam) instance_destroy();
    }
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="4" ename="oPBombExpl">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (damaged == 0 &amp;&amp; !flashing) {
    myhealth -= 2;
    event_user(0);
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="4" ename="oBombExpl">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (damaged == 0 &amp;&amp; !flashing) {
    myhealth -= 1;
    event_user(0);
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="4" ename="oSolid">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (gravity != 0) {
    repeat (10) {
        var boom = make_explosion1(x + irandom_range(-19, 64), y + irandom_range(-14, 17));
        boom.depth = depth - 1;
    }
    sprite_index = sTankCannonDest;
}
gravity = 0;
speed = 0;
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="12">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>var projx, projy, proj;
projx = x + lengthdir_x(60, direction);
projy = y + lengthdir_y(60, direction);
proj = instance_create(projx, projy, oTankProjectile);
proj.direction = direction;
proj.image_angle = direction;
proj.speed = 4;
proj.type = beamType;
if (beamType == "ICE") {
    proj.sprite_index = sTankProj2;
} else if (beamType == "WAVE") {
    proj.depth = -200;
    proj.sprite_index = sTankProj3;
}
sfx_play(sndAutrackFire);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="11">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (damaged == 0) {
    damaged = 1;
    with (oTankArm) {
        event_user(1);
    }
    image_speed = 0;
    //alarm[0] = 60;
    alarm[0] = 15;
    sfx_play(sndRobotExpl);
    repeat (3) {
        var boom = make_explosion1(x + irandom_range(10, -10), y + irandom_range(10, -10));
        boom.depth = depth - 1;
    }
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="10">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>if (damaged == 0) {
    shaking = 8;
    flashing = 5;
    if (myhealth &gt; 60) with (oTankArm) sprite_index = sTankShoulder;
    if (myhealth &lt;= 60) with (oTankArm) sprite_index = sTankShoulder1;
    if (myhealth &lt;= 30) with (oTankArm) sprite_index = sTankShoulder2;
    if (myhealth &lt;= 0) event_user(1);
    sfx_stop(sndRobotHit2);
    sfx_play(sndRobotHit2);
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="8" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>draw_sprite_ext(sprite_index, -1, x + offx, y + offy, 1, 1, image_angle, -1, 1);
if (!damaged) draw_sprite_ext(chargeType, image_index, x + offx, y + offy, 1, 1, image_angle, -1, charge);
if (flashing &amp;&amp; damaged == 0) {
    draw_set_blend_mode(bm_add);
    repeat (2) draw_sprite_ext(sprite_index, -1, x + offx, y + offy, 1, 1, image_angle, -1, flashing / 5);
    draw_set_blend_mode(bm_normal);
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
  </events>
  <PhysicsObject>0</PhysicsObject>
  <PhysicsObjectSensor>0</PhysicsObjectSensor>
  <PhysicsObjectShape>0</PhysicsObjectShape>
  <PhysicsObjectDensity>0.5</PhysicsObjectDensity>
  <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
  <PhysicsObjectGroup>0</PhysicsObjectGroup>
  <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
  <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
  <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
  <PhysicsObjectAwake>-1</PhysicsObjectAwake>
  <PhysicsObjectKinematic>-1</PhysicsObjectKinematic>
  <PhysicsShapePoints/>
</object>
