Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_fmartlet_feather_straight_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (!instance_exists(obj_heart_battle_fighting_parent))
4
{
5
    instance_destroy()
6
    return;
7
}
8
if (image_alpha < 1)
9
    image_alpha += 0.15
10
if (state == 0)
11
{
12
    if (target_angle < 360)
13
        target_angle += 20
14
    else
15
        state++
16
    var direction_real = direction + target_angle
17
    image_angle = direction_real
18
}
19
else if (state == 1)
20
{
21
    if (!alarm[1])
22
        alarm[1] = 6
alarm[1]

if live_call() return global.live_result; if can_play_sound audio_play_sound(snd_bullet_warning, 1, 0) if (image_blend != c_red) image_blend = c_red else image_blend = c_white if (warning_line_color == 255) warning_line_color = 65535 else warning_line_color = 255
23
    speed -= 0.15
24
    if (warning_line_alpha < 0.3)
25
        warning_line_alpha += 0.1
26
    if (speed < (-speed_charge_max))
27
    {
28
        if can_play_sound
29
        {
30
            var shoot_sound = audio_play_sound(snd_mart_feather_atk3, 20, 0)
31
            audio_sound_set_track_position(shoot_sound, 0.65)
32
        }
33
        state = 2
34
    }
35
}
36
else if (state == 2)
37
{
38
    var can_trail = false
39
    trail_cc_current += 1
40
    if (trail_cc_current >= trail_cc_max)
41
    {
42
        can_trail = true
43
        trail_cc_current = 0
44
    }
45
    if (can_trail == true)
46
    {
47
        ds_list_add(x_list, x)
48
        ds_list_add(y_list, y)
49
        ds_list_add(angle_list, image_angle)
50
        while (ds_list_size(x_list) > max_points_trail)
51
        {
52
            ds_list_delete(x_list, 0)
53
            ds_list_delete(y_list, 0)
54
            ds_list_delete(angle_list, 0)
55
        }
56
    }
57
    x += lengthdir_x(attack_speed, image_angle)
58
    y += lengthdir_y(attack_speed, image_angle)
59
    if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == false)
60
        in_box = true
61
    if ((!(place_meeting(x, y, obj_dialogue_box_battle_transformation_any))) && in_box == true)
62
    {
63
        if (image_alpha > 0)
64
        {
65
            image_alpha -= 0.3
66
            if (image_alpha < 0)
67
                image_alpha = 0
68
            if (image_alpha == 0)
69
                instance_destroy()
70
        }
71
    }
72
}