<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>sSkorpBody</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>0</depth>
  <persistent>0</persistent>
  <parentName>oEnemy</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>event_inherited();
myhealth = 50;
freezehp = 20;
damage = 8;
hitsound = sndEHit1;
deathsound = sndEDeath1;
canfreeze = 1;
frozenspr = sSkorpBodyFrozen;
freezefall = 0;
offset = 0;
attack = 0;
startx = x;
starty = y;
state = 0;

// 1.4.4 behavior change
image_speed = 0;
len = 11;
dir = 24;
//

disc1 = instance_create(x + lengthdir_x(len, image_angle + dir), y + lengthdir_y(len, image_angle + dir), oSkorpDisc);
disc2 = instance_create(x + lengthdir_x(len, image_angle - dir), y + lengthdir_y(len, image_angle - dir), oSkorpDisc);
lure = "OPTIMIZE *THIS*";

disc2.image_xscale = -1;
spin = 0;
alarm[0] = 10;
alarm[2] = 1;
alarm[4] = 2; //lure

/*if (real(string_char_at(room_get_name(room), 5)) == 6) {
    var newself = instance_create(x, y, oSkorpA6);
    newself.image_angle = image_angle;
    
    instance_destroy();
}



</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="1" 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 (instance_exists(disc1) &amp;&amp; instance_exists(disc2)) {
    with (disc1) instance_destroy();
    with (disc2) instance_destroy();
}
if (instance_exists(lure)) {
    lure.state = 100;
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="4">
      <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>lure = instance_create(x, y, oSkorpLure);

// Lure
lure.x = x + lengthdir_x(10, image_angle);
lure.y = y + lengthdir_y(10, image_angle);

lure.image_angle = image_angle;
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="3">
      <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>    disc1.spin = 1;
    disc2.spin = 1;
    attack = 1;
    alarm[1] = 120;
</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>offset = 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>disc1.spin = 0;
disc2.spin = 0;
attack = 0;
alarm[0] = 100; //og 120

if (instance_exists(lure)) {
    lure.alarm[1] = 20;
}
</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>if (distance_to_object(oCharacter) &lt; 80) {
    alarm[3] = 20;
    if (instance_exists(lure)) {
        lure.image_index = 0;
        switch (image_angle) {
            case 270:
            case 90: {
                lure.sprite_index = skorp_get_lure(sSkorpLureUpV);
                break;
            }
            default: {
                lure.sprite_index = skorp_get_lure(sSkorpLureV);
                break;
            }
        }
    }
} else alarm[0] = 10;
</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 (attack) {
    if (offset &lt; 24) offset += 2;
} else if (offset &gt; 0) offset -= 1;

image_index = floor(offset/4.8);

// Generate disc offsets
switch (floor(image_index)) {
    case 0: {
        len = 11; // 13?
        dir = 24;
        break;
    }
    case 1: {
        len = 13;
        dir = 10;
        break;
    }
    case 2: {
        len = 16;
        dir = 24;
        break;
    }
    case 3: 
    case 4: {
        len = 18;
        dir = 36;
        break;
    }
}
// Discs
disc1.x = x + lengthdir_x(len, image_angle + dir);
disc1.y = y + lengthdir_y(len, image_angle + dir);
disc2.x = x + lengthdir_x(len, image_angle - dir);
disc2.y = y + lengthdir_y(len, image_angle - dir);

// Lure
//lure.x = lure.startx + lengthdir_x(offset, image_angle);
//lure.y = lure.starty + lengthdir_y(offset, image_angle);

x = startx + lengthdir_x(offset, image_angle);
y = starty + lengthdir_y(offset, image_angle);
if (state == 100) {
    with (disc1) instance_destroy();
    with (disc2) instance_destroy();
    with (lure) {
        state = 100;
    }
    enemy_death();
}
event_inherited();
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="4" ename="oCharacter">
      <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></string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="25">
      <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>event_inherited();
if (attack) {
    frz.spr1 = sSkorpDiscFrozen;
    frz.spr2 = sSkorpDiscFrozen;
} else {
    frz.spr1 = sSkorpDiscLungeFrozen;
    frz.spr2 = sSkorpDiscLungeFrozen;
}
frz.spr1xoff = lengthdir_x(len, dir);
frz.spr1yoff = lengthdir_y(len, dir);
frz.spr2xoff = lengthdir_x(len, -dir);
frz.spr2yoff = lengthdir_y(len, -dir);
frz.spr2xs = -1;
</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>0</PhysicsObjectKinematic>
  <PhysicsShapePoints/>
</object>
