<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>&lt;undefined&gt;</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>0</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>backfire = 0
failed = 0
type = 0
dmg = 0
alarm[0] = 1
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="11">
      <action>
        <libid>1</libid>
        <id>203</id>
        <kind>0</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>1</exetype>
        <functionname>action_kill_object</functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
      </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 instance_exists(objBattleMsg) or instance_exists(objCustomDamage) or instance_exists(objEnCustomDamage) {
    alarm[2] = 1
} else {
    if !failed {
        if backfire {
            if random(100)&lt;25 and !global.enemy[enmy].solids {
                //solidify
                global.enemy[enmy].solids = 1
                with instance_create(global.enemy[enmy].x,global.enemy[enmy].y,objEnemyAilmentFade) { 
                    sprite_index = global.enemy[enmy].sprite_index  
                    image_index = global.enemy[enmy].image_index
                    color = make_color_rgb(115,0,223)
                }
                var a = instance_create(0,0,objBattleMsg);
                a.strno = 0;
                a.str[0] = upper(global.enemy[enmy].e_art) + global.enemy[enmy].e_name + "'s body solidified!";
            }
        } else {
            if random(100)&lt;25 and !global.s_solid[tgt] {
                global.s_solid[tgt] = 1
                with instance_create(global.healthbar[tgt].x,global.healthbar[tgt].y,objHealthBarRed) { 
                    color = make_color_rgb(115,0,223);
                } 
                audio_play_sound(sndailment,0,0)
                var a = instance_create(0,0,objBattleMsg);
                a.strno = 0;
                a.str[0] = global.s_name[tgt] + "'s body solidified!";
            }
        }
    }
    alarm[11] = 1
}
</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>var countered = 0;

if backfire { 
    random_choser_extra();
    resist = global.enemy[enmy].freeze_resistance; 
} else { 
    en_random_choser();
    resist = global.freeze_resistance[tgt]; 
}

dmg = ceil(dmg*(100-30*resist)/100)

if !backfire {
    if resist != 4 {
        with global.healthbar[tgt] {
            x = xstart
            y = ystart
            path_start(p_shake,6,0,0)
        }
        
        if global.has_psishield[tgt] or global.has_psipshield[tgt] {
            dmg = ceil(dmg/2)
            countered = global.has_psipshield[tgt];
            global.s_shieldlife[tgt]--;
        }
        
        global.custom_dmg = dmg;
        
        var a = instance_create(0,0,objBattleMsg);
        if global.s_shieldlife[tgt] = 0 and (global.has_psishield[tgt] or global.has_psipshield[tgt]) {
            a.strno = 1+countered
            if global.has_psishield[tgt] {
                a.str[1] = global.s_name[tgt] + "'s psychic shield#   disappeared!";
            } else if global.has_psipshield[tgt] {
                a.str[1] = global.s_name[tgt] + "'s psychic power shield#   disappeared!";
            }
            if countered {
                a.str[2] = "...but not before deflecting the attack!"
            }
            global.has_psishield[tgt] = 0
            global.has_psipshield[tgt] = 0
        } else {
            a.strno = countered
            if countered {
                a.str[1] = "The psychic power shield#   deflected the attack!"
            }
        }
        
        if dmg &gt;= global.s_hp[tgt] {
            instance_create(0,0,objMortalDamage)
            msg = string(dmg)+" HP of mortal damage#   to "+global.s_name[tgt] + "!";
        } else {
            audio_play_sound(sndbump,0,0)
            msg = string(dmg)+" HP of damage#   to "+global.s_name[tgt] + "!";
        }
        
        global.s_hp[tgt] -= dmg
        a.str[0] = msg;
        
        if countered { instance_create(x,y,objEnCustomDamage) }
    } else {
        failed = 1
        var a = instance_create(0,0,objBattleMsg);
        a.strno = 0
        a.str[0] = "It had no effect on "+global.s_name[tgt] + "!";
    }
} else {
    if resist !=4 {
        if global.enemy[enmy].has_psishield or global.enemy[enmy].has_psipshield {
            dmg = ceil(dmg/2)
            countered = global.enemy[enmy].has_psipshield;
            global.enemy[enmy].shieldlife--;
        }
        
        global.custom_dmg = dmg
        
        var a = instance_create(0,0,objBattleMsg);
        if global.enemy[enmy].shieldlife = 0 and (global.enemy[enmy].has_psishield or global.enemy[enmy].has_psipshield) {
            a.strno = 1+countered
            if global.enemy[enmy].has_psishield {
                a.str[1] = upper(global.enemy[enmy].e_art) + global.enemy[enmy].e_name + "'s psychic shield#   disappeared!";
            } else if global.enemy[enmy].has_psipshield {
                a.str[1] = upper(global.enemy[enmy].e_art) + global.enemy[enmy].e_name + "'s psychic power shield#   disappeared!";
            }
            if countered {
                a.str[2] = "...but not before deflecting the attack!"
            }
            global.enemy[enmy].has_psishield = 0
            global.enemy[enmy].has_psipshield = 0
        } else {
            a.strno = countered
            if countered {
                a.str[1] = "The psychic power shield#   deflected the attack!"
            }
        }
        
        with global.enemy[enmy] { alarm[1] = 2 }
        
        global.enemy[enmy].e_hp -= dmg;
        a.str[0] = string(dmg)+" HP of damage#   to "+global.enemy[enmy].e_art + global.enemy[enmy].e_name + "!";
        
        if countered { en_random_choser_extra(); instance_create(x,y,objCustomDamage) }
        
        instance_create(0,0,objHitEffect)
    } else {
        failed = 1
        var a = instance_create(0,0,objBattleMsg);
        a.strno = 0
        a.str[0] = "It had no effect on "+global.enemy[enmy].e_art + global.enemy[enmy].e_name + "!";
    }
}
alarm[2] = 1
</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>///Damage goes here
freeze_damage()
alarm[1] = 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>
