<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>spr_fireman_idle</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>-30</depth>
  <persistent>0</persistent>
  <parentName>obj_enemy_par</parentName>
  <maskName>spr_char_mask</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();
life_max = 30;
life = life_max;
armor = 6;
damage = 45;

move_sp = 0.5;
max_sp = 1;

fric = 0.25;
grav = 0.5;
attacked = false;

cooldown = 0;
</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 (global.game_status != GAME_STATUS_PLAY) exit;

switch(state) {
  case STATE_MOVE:
    sc_apply_friction(fric * game_speed);
    
    if (cooldown &gt; 0) {
      cooldown = max(cooldown-game_speed, 0);
    }
    
    image_speed = 0.5 * game_speed;
    
    if (instance_exists(obj_char)) {
      if (!collision_line(x, y, obj_char.x, obj_char.y, obj_wall, false, true) &amp;&amp; cooldown == 0) {
        state = STATE_THROW;
        sprite_index = spr_fireman_throw;
        image_index = 0;
        if (x != obj_char.x)
          image_xscale = sign(obj_char.x-x);
        
        cooldown = irandom_range(30, 50);
      }
    }
    
    if (!place_meeting(x, y+1, obj_wall)) {
      if (vspd &lt; 10)
        vspd += grav * game_speed;
    }
    
    sc_move_obj(obj_wall);
  break;
  case STATE_THROW:
    sc_apply_friction(fric * game_speed);
    
    image_speed = 0.5 * game_speed;
    
    if (!attacked &amp;&amp; image_index &gt;= 5) {
      var _dir = point_direction(x, y, obj_char.x, obj_char.y);
      with(instance_create(x, y, obj_fireball)) {
        hspd = lengthdir_x(5, _dir+irandom_range(-2, 2));
        vspd = lengthdir_y(5, _dir+irandom_range(-2, 2))-2;
      }
      if (x != obj_char.x)
          image_xscale = sign(obj_char.x-x);
      attacked = true;
    }
    
    if (!place_meeting(x, y+1, obj_wall)) {
      if (vspd &lt; 10)
        vspd += grav * game_speed;
    }
    
    sc_move_obj(obj_wall);
  break;
}
</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 (irandom(99) &lt; 30) instance_create(x, y, choose(obj_i_life, obj_i_time));
audio_play_sound_on(global.snd_emitter, snd_explosion3, false, 7);
</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>repeat(5) instance_create(other.x, other.y, obj_lava_effect);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="7">
      <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 (state == STATE_THROW) {
  state = STATE_MOVE;
  sprite_index = spr_fireman_idle;
  attacked = false;
}
</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>
