var argument_arr = array_create(argument_count);
for (var i = 0; i < argument_count; i++) {
argument_arr[i] = argument[i];
}
if (live_call_ext(argument_arr)) return live_result;
//Spc Triggers and System
/*
scr_addon_brth(
"df_lt", //0
global.k_lt, //1
global.mg_en_flm_req, //2
spr_g60_spc_brth_ini, //3
0.3, //image_speed(ini) //4
global.snd_shn_brth_ini, //arg5
global.snd_shn_lsr_loop, //6
spr_g60_spc_brth_aim, //7
global.mg_en_flm_use, //arg8
spr_g60_spc_brth_end, //9
0.02, //image_speed(end) //10
23, //tic countdown for sound reset (about this much bench'ed to shn's brth sound) //arg11
"use_en", //use type //12
0, //can_shoot rate //13
10, //cancel_allow //14 (def=10, fr=-1)
-1, //brth duration //15 (def=-1, fr=30)
)
*/
//Trigger
with(myid.char)
{
if active==1
{
if (spc_start_chk)
{
if pos=="stand" or pos=="duck"
{
if sprite_index==spr_walk
or sprite_index==spr_stand
or sprite_index==spr_land
or sprite_index==spr_duck
{
if spc_type==argument[0]// and myid.en_curr>=argument[2)
{
myid.addon.use_type=argument[12]
if (myid.addon.use_type=="use_en" and myid.en_curr>=argument[2])
or (myid.addon.use_type=="use_am" and myid.ammo_curr>=argument[2])
or (myid.addon.use_type=="use_am_a" and myid.ammo_a_curr>=argument[2])
or (myid.addon.use_type=="use_am_b" and myid.ammo_b_curr>=argument[2])
or (myid.addon.use_type=="use_am_c" and myid.ammo_c_curr>=argument[2])
or (myid.addon.use_type=="use_am_fr" and myid.ammo_fr_curr>=1
and fr_mode==2 and can_fr==1)
{
if myid.addon.use_type=="use_am_fr"
{
myid.addon_share_alarm.alarm[10]=argument[14];
scr_addon_fury_usage(myid.addon.ammo_fr_rld);
}
else
{myid.addon_share_alarm.alarm[10]=argument[14];}
can_atk_stand=0
can_jump=0
can_duck=0
atk_state="atk"
myid.addon.brth_spr=argument[7] //Set the "breath sprite state" to the aim sprite
myid.addon_share_alarm.alarm[11]=999//argument[15] //set to proper value in ini to aim transition
sprite_index=argument[3]
image_speed=argument[4]
image_index=0
wspeed=0
move_prev=1
oop=instance_create(x,y,osnd_char_hit);
oop.myid=myid;
oop.t="c";
oop.snd = FMODSoundPlay(argument[5],0);
}
else if (myid.addon.use_type=="use_en" and myid.en_curr<argument[2])
or (myid.addon.use_type=="use_am" and myid.ammo_curr<argument[2])
or (myid.addon.use_type=="use_am_a" and myid.ammo_a_curr<argument[2])
or (myid.addon.use_type=="use_am_b" and myid.ammo_b_curr<argument[2])
or (myid.addon.use_type=="use_am_c" and myid.ammo_c_curr<argument[2])
or (myid.addon.use_type=="use_am_fr" and myid.ammo_fr_curr<1 and fr_mode!=2 and can_fr!=1)
{
if (myid.addon.use_type=="use_en")
{scr_ingame_en_lack();}
else if ( (myid.addon.use_type=="use_am") or (myid.addon.use_type=="use_am_a") or
(myid.addon.use_type=="use_am_b") or (myid.addon.use_type=="use_am_c") or
(myid.addon.use_type=="use_am_fr")
)
{scr_ingame_ammo_lack();}
}
}
}
}
}
}//active
//Streaming
myid.addon.alarm_snd_max=argument[11];
if sprite_index==argument[7]
{//spr
//myid.en_curr-=argument[8]
scr_addon_usage(argument[8])
image_index=myid.addon.index_pos
wspeed=0
//Sound loop system
with(myid.addon)
{
if addon_snd_sys=="alarm"
{
if can_snd==1
{
alarm_snd=myid.addon.alarm_snd_max
can_snd=0
oop=instance_create(x,y,osnd_obj)
oop.myid=myid;
oop.snd = FMODSoundPlay(argument[6],0)
}
}
else if addon_snd_sys=="loop"
{
if can_snd_loop==1
{
can_snd_loop=0
oop=instance_create(x,y,osnd_char_loop)
oop.myid=myid;
oop.snd = FMODSoundLoop(argument[6],0)
oop.spr_condit=argument[7]
}
}
}
//Can_shoot rate
myid.addon.alarm_can_shoot_curr-=1
if myid.addon.alarm_can_shoot_curr<0
{
myid.addon.alarm_can_shoot_curr=argument[13]
myid.addon.can_shoot=1
}
}//spr
//Sound rate
myid.addon.alarm_snd-=1
if myid.addon.alarm_snd<0
{
myid.addon.alarm_snd=myid.addon.alarm_snd_max
myid.addon.can_snd=1
}
}
//Cross-hair
if myid.control=="player"
{
if myid.char.sprite_index==argument[3]{
if (flag <= 0) {
show_debug_message(random(300))
flag += cross_rt;
} else {
flag -= 1;
}
} else {
flag = cross_rt;
}
}
//Cancel (releasing (ini and aim/energy gone/hit)
with(myid.char)
{
if sprite_index==argument[3]
or sprite_index==argument[7]
{
if (myid.addon.use_type=="use_en" and
(
myid.addon.cancel_allow==1 and
(
myid.en_curr<=argument[8] or
( (myid.control=="player" and spc_type==argument[0] and !(keyboard_check(argument[1])) ) or
(myid.control=="ai" and spc_type=="n")
)
)
)
)
or (myid.addon.use_type=="use_am_fr" and myid.addon_share_alarm.alarm[11]<0)
or active==0
or hit_state==1
or pos=="ko"
{
myid.addon.fire=0
//spc_type="n"
//atk_state="n"
atk_prevs="atk"
myid.sub_key.key_lock=0
can_shoot=1
sprite_index=argument[9]//spr_g90_spc_brth_end
image_speed=argument[10]
image_index=0
//with(myid.ai)
// {scr_ctl_reset();}
}
}
}
//Firing !*note: firing must ALWAYS go BELOW cancel part in these scripts, otherwise you'll get stray shots since one final projectile instances is created
//with a different dir just before breath is cancelled, and where the alarm is super low, or even -1.
if myid.char.sprite_index==argument[7]//"Aim" sprite index is assumed here
{
fire=1
if fire==1 and can_shoot=1
{//
can_shoot=0
scr_proj_brth_cre_inst(brth_proj,brth_amt,brth_spr,dir)
alarm_can_shoot_curr=argument[13] //
}//
}
//anima
with(myid.char)
{
//Initial phase to aim
if spc_type==argument[0]
{
if sprite_index==argument[3] //the brth ini anima
{
if (image_index>=image_number-image_speed) //the final image index before ini animation ends
{
myid.addon.can_aim=1
myid.addon.fire=1
//if facer==1
// {myid.addon.dir=argument[12];} //starting direction. Right facing
//else if facer==-1
// {myid.addon.dir=180-(argument[12]);} //starting direction. Left facing
image_speed=0;
//image_index=argument[13];
image_index=myid.addon.index_pos
sprite_index=argument[7]; //the sprite_index of the aim part of brth animation, e.g. spr_shn_spc_brth_mid
myid.addon_share_alarm.alarm[11]=argument[15]
//show_message("hyy2")
}
}
}
//End phase to stand/neutral
if sprite_index==argument[9] //the brth end anima
{
if (image_index>=image_number-image_speed)
//Recovery determined by IMAGE_SPEED
//in scr_addon_brth > argument[ 9
{
scr_addon_reset_full();
#region original reset vars
/*
myid.addon.can_shoot=1
sprite_index=spr_stand
image_index=0
image_speed=img_speed
can_atk_stand=1
atk_state="n"
atk_nomov=0
move_prev=0
can_jump=1
can_duck=1
*/
#endregion
}
}
}