_parent = -4; _bullet_sprite = -4; _timer = 0; _modifier = 1; _hover_active = false; _spawner = -4; _sparkle = -4; _end_sequence = false; _index = 0; _fade_alpha = 0; _white_alpha = 0; _enable_afterimage = false; init = function(arg0, arg1, arg2, arg3, arg4, arg5) { _parent = arg0; sprite_index = arg1; x = arg2.x; y = arg2.y; _bullet_sprite = arg3; _modifier = arg5; image_yscale = 2; image_xscale = -2; image_angle = arg4; if (image_angle >= 180) image_yscale = -2; image_alpha = 0; }; set_index = function(arg0) { _index = arg0; }; fade_in = function(arg0) { scr_depth(); start_hover(); scr_script_delayed(function() { scr_lerpvar("image_alpha", 0, 0.4, 20); }, arg0 + 1); scr_script_delayed(function() { start_sparkles(); }, arg0 + 1 + 16); }; start_hover = function() { _hover_active = true; }; start_sparkles = function() { _sparkle = instance_create(x, y, obj_ch5_DW29_power_up_sparkle); _sparkle.start(depth + 10, id); }; start_bullets = function() { _spawner = instance_create(0, 0, obj_ch5_DW29_power_up_bullet_spawner); _spawner.start_spawning(id, new Vector2(x, y - 10), new Vector2(view_wport[0] / 2, (cameray() + 300) - 20), _bullet_sprite); }; stop = function() { with (_spawner) fade_out(); }; trigger_event = function(arg0) { }; end_sequence = function() { _hover_active = false; var delay = 10 + (_index * 8); scr_delay_var("_timer", 30, delay); scr_delay_var("_end_sequence", true, delay); scr_script_delayed(function() { scr_lerp_var_instance(id, "_fade_alpha", 0, 1, 30); }, delay); scr_script_delayed(function() { snd_play_x(snd_japanese_yo_hit2, 0.25, 1); scr_lerp_var_instance(id, "_white_alpha", 0, 1, 12); with (_sparkle) fade_out(); }, delay + 20); scr_script_delayed(function() { _end_sequence = false; with (_sparkle) clean_up(); with (_parent) trigger_event("enemy_finished"); }, delay + 31); }; clean_up = function() { _hover_active = false; _end_sequence = false; with (_bullet_sprite) instance_destroy(); with (_spawner) clean_up(); instance_destroy(); };