<!--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>///A very customizable attack

//Attack attributes
bashlike    = 1;    //Whether to consider offense and defense
customdmg   = 0;    //Damage to inflict if not bashlike
level       = 2;    //1: Low level; 2: Like a normal bash; 3: High level; 4: Like a smash attack
attacks     = 1;    //Number of consecutive attacks
nosmash     = 0;    //Disables smash
element     = 0;    //0: Non-elemental; 1: Fire; 2: Freeze; 3: Thunder
breakshield = 0;    //Whether to break physical shields.
dodgeable   = 1;    //Self-explanatory
ailment     = 0;    //0: None; 1: Crying; 2: Poison; 3: Infection; 4: Sleep; 5: Numbness; 6: Solidification; 7: Strangeness; 8: Shock; 9: Can't concentrate; 10: Turn around
ailmentrate = 0;    //The chance (out of 100) the attack has to inflict the aforementioned status ailment
laser       = 0;    //Whether to show "...narrowly missed hitting the target!" when the attack misses. Also makes a laser sound if it's on.
nodamage    = 0;    //Whether to disable damage for this attack (used to, for example, only cause a status ailment or break a shield)
removeitem  = 0;    //Whether the item used is gone after one use
nomiss      = 0;    //Disables missing
nohiteffect = 0;    //Disables the blinking hit effect

rounds      = 0;
smash       = 0;
backfire    = 0;
failed      = 1;
tgt         = 0;
event_perform(ev_other,ev_user0)
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" 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 instance_exists(objBattleMsg) or instance_exists(objCustomDamage){
    alarm[11] = 1
} else {
    if removeitem {
        del_item_inv(global.itemtouse[global._pl],global._pl-1)
    }
    with objTurnMaster { event_perform(ev_other,ev_user0) }
    instance_destroy()
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" 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>///Ailments
if instance_exists(objBattleMsg) or instance_exists(objCustomDamage) or instance_exists(objEnCustomDamage) {
    alarm[10] = 1
} else {
    var msg;
    msg = "";
    failed = 1;
    
    if !backfire {
        if random(100) &lt; ailmentrate {
            switch ailment {
                case 1:
                    if !global.target[global._pl].crying {
                        global.target[global._pl].crying = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " couldn't stop crying!";
                        failed = 0
                    }
                    break;
                case 2:
                    if !global.target[global._pl].poison {
                        global.target[global._pl].poison = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " was poisoned!";
                        failed = 0
                    }
                    break;
                case 3:
                    if !global.target[global._pl].infected {
                        global.target[global._pl].infected = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " was infected!";
                        failed = 0
                    }
                    break;
                case 4:
                    if !global.target[global._pl].asleep {
                        global.target[global._pl].asleep = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " fell asleep!";
                        global.target[global._pl].sleep_timer = 1
                        failed = 0
                    }
                    break;
                case 5:
                    if !global.target[global._pl].numb {
                        global.target[global._pl].numb = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + "'s body became numb!";
                        global.target[global._pl].numb_timer = 5
                        failed = 0
                    }
                    break;
                case 6:
                    if !global.target[global._pl].solids {
                        global.target[global._pl].solids = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + "'s body solidified!";
                        failed = 0
                    }
                    break;
                case 7:
                    if !global.target[global._pl].strange {
                        global.target[global._pl].strange = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " felt a little strange...";
                        failed = 0
                    }
                    break;
                case 8:
                    if !global.target[global._pl].shocked {
                        global.target[global._pl].shocked = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " was shocked!";
                        failed = 0
                    }
                    break;
                case 9:
                    if !global.target[global._pl].cantconcentrate {
                        global.target[global._pl].cantconcentrate = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " forgot how to use skills!";
                        global.target[global._pl].conc_timer = 3
                        failed = 0
                    }
                    break;
                case 10: 
                    if !global.target[global._pl].turned_around and global.target[global._pl].can_turn_around {
                        global.target[global._pl].turned_around = 1
                        msg = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + " turned the other way!";
                        failed = 0
                    }
                    break;
            }
        } else {
            failed = 1
        }
        
        if failed {
            msg = "It had no effect on " + global.target[global._pl].e_art + global.target[global._pl].e_name + "!";
        } else {
            if ailment != 10 {
                with instance_create(global.target[global._pl].x,global.target[global._pl].y,objEnemyAilmentFade) { 
                    sprite_index = global.target[global._pl].sprite_index  
                    color = make_color_rgb(115,0,223)
                } 
            }
        }
        
        var a = instance_create(0,0,objBattleMsg);
        a.strno = 0;
        a.str[0] = msg;
        
        alarm[2] = 1
    } else {
        if random(100) &lt; ailmentrate {
            switch ailment {
                case 1:
                    if !global.s_crying[tgt] {
                        global.s_crying[tgt] = 1
                        msg = global.s_name[tgt] + " couldn't stop crying!";
                        failed = 0
                    }
                    break;
                case 2:
                    if !global.s_poison[tgt] {
                        global.s_poison[tgt] = 1
                        msg = global.s_name[tgt] + " was poisoned!";
                        failed = 0
                    }
                    break;
                case 3:
                    if !global.s_infected[tgt] {
                        global.s_infected[tgt] = 1
                        msg = global.s_name[tgt] + " was infected!";
                        failed = 0
                    }
                    break;
                case 4:
                    if !global.s_asleep[tgt] {
                        global.s_asleep[tgt] = 1
                        msg = global.s_name[tgt] + " fell asleep!"
                        global.sleep_timer[tgt] = 1
                        failed = 0
                    }
                    break;
                case 5:
                    if !global.s_numb[tgt] {
                        global.s_numb[tgt] = 1
                        msg = global.s_name[tgt] + "'s body became numb!";
                        global.numb_timer[tgt] = 5
                        failed = 0
                    }
                    break;
                case 6:
                    if !global.s_solid[tgt] {
                        global.s_solid[tgt] = 1
                        msg = global.s_name[tgt] + "'s body solidified!";
                        failed = 0
                    }
                    break;
                case 7:
                    if !global.s_strange[tgt] {
                        global.s_strange[tgt] = 1
                        msg = global.s_name[tgt] + " felt a little strange...";
                        failed = 0
                    }
                    break;
                case 8:
                    if !global.s_shocked[tgt] {
                        global.s_shocked[tgt] = 1
                        msg = global.s_name[tgt] + " was shocked!";
                        failed = 0
                    }
                    break;
                case 9:
                    if !global.s_cantconcentrate[tgt] {
                        global.s_cantconcentrate[tgt] = 1
                        global.conc_timer[tgt] = 3
                        msg = global.s_name[tgt] + " forgot how to use skills!";
                        failed = 0
                    }
                    break;
                case 10:
                    failed = 1
                    break;
            }
        } else {
            failed = 1
        }
        
        if failed {
            msg = "It had no effect on " + global.s_name[tgt] + "!";
        } else {
            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] = msg;
        
        alarm[1] = 1
    }
}
</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>///Basic bash damage - Backfire

if instance_exists(objBattleMsg) or instance_exists(objEnCustomDamage) {
    alarm[2] = 1
} else {
    if rounds &gt;= attacks {
        alarm[11] = 1
        exit
    }
    
    if (global.s_crying[global._pl] and random(160)&lt;90) or random(160)&lt;10 {
        if !nomiss {
            var a = instance_create(0,0,objBattleMsg);
            a.strno = 0;
            if !laser {
                a.str[0] = "Just missed!"
            } else {
                a.str[0] = "...narrowly missed hitting the target!"
            }
            audio_play_sound(sndmiss,0,0)
            rounds++
            alarm[2] = 1
            exit
        }
    }
    
    en_random_choser();
    
    if (random(1000) &lt; global.s_guts[global._pl]) and !nosmash and bashlike {
        with instance_create(global.healthbar[tgt].x+30,global.healthbar[tgt].y-24,objSMAAAASH) {
            sprite_index = sprSmash2
        }
        smash = 1
        dmg = 4*global.s_off[global._pl] - global.s_def[tgt]
    } else {
        if dodgeable {
            if random(500)&lt;=(2*global.s_speed[tgt] - global.enemy[enmy].e_speed) 
            and !global.s_asleep[tgt] and !global.s_solid[tgt] and !global.s_numb[tgt] {
                audio_play_sound(snddodge,0,0)
                var a = instance_create(0,0,objBattleMsg);
                a.strno = 0;
                a.str[0] = global.s_name[tgt] + " dodged swiftly!"
                rounds++
                alarm[2] = 1
                exit
            }
        }
    }
    
    with global.healthbar[tgt] {
        x = xstart
        y = ystart
        path_start(p_shake,6,0,0)
    }
    
    audio_play_sound(sndbump,0,0)
    
    if !nodamage {
        var countered, resist, msg;
        countered = 0
        resist = 0
        
        switch element {
            case 1:
                resist = global.fire_resistance[tgt]; 
                break;
            case 2:
                resist = global.freeze_resistance[tgt]; 
                break;
            case 3:
                resist = global.thunder_resistance[tgt]; 
                break;
        }
        
        if !smash { 
            if bashlike {
                dmg = level*global.s_off[global._pl] - global.s_def[tgt] 
            } else {
                dmg = customdmg
            }
        }
        dmg += choose(1,-1)*ceil(random(dmg*0.25))
        dmg = ceil(dmg*(100-30*resist)/100)
        dmg = max(1,dmg)
        dmg = ceil(dmg/global.s_guard[tgt]);
        
        if global.has_shield[tgt] or global.has_pshield[tgt] {
            if smash or breakshield {
                global.s_shieldlife[tgt] = 0;
                countered = global.has_pshield[tgt];
            } else {
                dmg = ceil(dmg/2)
                countered = global.has_pshield[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_shield[tgt] or global.has_pshield[tgt]) {
            a.strno = 1+countered
            if global.has_shield[tgt] {
                a.str[1] = global.s_name[tgt] + "'s shield#   disappeared!"
            } else if global.has_pshield[tgt] {
                a.str[1] = global.s_name[tgt] + "'s power shield#   disappeared!"
            }
            if countered {
                a.str[2] = "...but not before deflecting the attack!"
            }
            global.has_shield[tgt] = 0
            global.has_pshield[tgt] = 0
        } else {
            a.strno = countered
            if countered {
                a.str[1] = "The 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 {
            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) }
    }
    
    rounds++
    if ailment = 0 { alarm[2] = 1 } else { alarm[10] = 1 }
    exit
}
</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>///Basic bash damage

if instance_exists(objBattleMsg) or instance_exists(objCustomDamage) {
    alarm[1] = 1
} else {
    if rounds &gt;= attacks {
        alarm[11] = 1
        exit
    }
    
    if (global.target[global._pl].crying and random(160)&lt;90) or random(160)&lt;10 {
        if !nomiss {
            var a = instance_create(0,0,objBattleMsg);
            a.strno = 0;
            if !laser {
                a.str[0] = "Just missed!"
            } else {
                a.str[0] = "...narrowly missed hitting the target!"
            }
            audio_play_sound(sndmiss,0,0)
            rounds++
            alarm[1] = 1
            exit
        }
    }
    
    if (random(1000) &lt; global.s_guts[global._pl]) and !nosmash and bashlike {
        instance_create(global.target[global._pl].x,global.target[global._pl].y-48,objSMAAAASH)
        dmg = 4*global.s_off[global._pl] - global.target[global._pl].e_def
        smash = 1;
    } else {
        if dodgeable {
            if random(500)&lt;=(2*global.target[global._pl].e_speed - global.s_speed[global._pl]) 
            and !global.target[global._pl].asleep and !global.target[global._pl].solids 
            and !global.target[global._pl].numb {
                audio_play_sound(snddodge,0,0)
                var a = instance_create(0,0,objBattleMsg);
                a.strno = 0;
                a.str[0] = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name+ " dodged swiftly!"
                rounds++
                alarm[1] = 1
                exit
            }
        }
    }
    
    if !nohiteffect { 
        with global.target[global._pl] { alarm[1] = 2 }
        with instance_create(random_range(global.target[global._pl].x-16,global.target[global._pl].x+16),
		random_range(global.target[global._pl].y-16,global.target[global._pl].y+16),objHitEffect) { visible = 1 }
    }
    
    if !nodamage {
        var countered, resist;
        countered = 0;
        resist = 0;
        
        switch element {
            case 1:
                resist = global.target[global._pl].fire_resistance; 
                break;
            case 2:
                resist = global.target[global._pl].freeze_resistance; 
                break;
            case 3:
                resist = global.target[global._pl].thunder_resistance; 
                break;
        }
        
        if !smash { 
            if bashlike {
                dmg = level*global.s_off[global._pl] - global.target[global._pl].e_def 
            } else {
                dmg = customdmg
            }
        }
        dmg += choose(1,-1)*ceil(random(dmg*0.25))
        dmg = ceil(dmg*(100-30*resist)/100)
        dmg = max(1,dmg)
        dmg = ceil(dmg/global.target[global._pl].e_grd);
        
        if global.target[global._pl].has_shield or global.target[global._pl].has_pshield {
            if smash or breakshield {
                global.target[global._pl].shieldlife = 0;
                countered = global.target[global._pl].has_pshield;
            } else {
                dmg = ceil(dmg/2)
                countered = global.target[global._pl].has_pshield;
                global.target[global._pl].shieldlife--;
            }
        }
        
        global.custom_dmg = dmg
        
        var a = instance_create(0,0,objBattleMsg);
        if global.target[global._pl].shieldlife = 0 and (global.target[global._pl].has_shield or global.target[global._pl].has_pshield) {
            a.strno = 1+countered
            if global.target[global._pl].has_shield {
                a.str[1] = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + "'s shield#   disappeared!"
            } else if global.target[global._pl].has_pshield {
                a.str[1] = upper(global.target[global._pl].e_art) + global.target[global._pl].e_name + "'s power shield#   disappeared!"
            }
            if countered {
                a.str[2] = "...but not before deflecting the attack!"
            }
            global.target[global._pl].has_shield = 0
            global.target[global._pl].has_pshield = 0
        } else {
            a.strno = countered
            if countered {
                a.str[1] = "The power shield deflected the attack!"
            }
        }
        
        global.target[global._pl].e_hp -= dmg;
        a.str[0] = string(dmg)+" HP of damage#   to "+global.target[global._pl].e_art + global.target[global._pl].e_name + "!"
        
        if countered { en_random_choser_extra(); instance_create(x,y,objCustomDamage) }
    }
    
    rounds++
    if ailment = 0 { alarm[1] = 1 } else { alarm[10] = 1 }
    exit
}
</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 instance_exists(objBattleMsg) {
    alarm[0] = 1
} else {
    if global.s_strange[global._pl] and random(100)&lt;50 {
        alarm[2] = 1
        backfire = 1
    } else {
        alarm[1] = 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>audio_play_sound(sndpattack,0,0)

var a;
a = instance_create(0,0,objBattleMsg) 

if !global.s_strange[global._pl] {
    a.strno = 0;
    a.str[0] = global.custom_msg[0];
} else {
    strno = 1;
    a.str[0] = global.s_name[global._pl] + " is feeling a little strange...";
    a.str[1] = global.custom_msg[0];
}

alarm[0] = 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>
