Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_martlet_attack_splitting_feather_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
{
10
    image_alpha += 0.2
11
    if (image_alpha > 1)
12
        image_alpha = 1
13
}
14
if (state == 0)
15
{
16
    if (can_move == true)
17
    {
18
        game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
19
        animation_disjoint_x = sign_modifier * (max_rise - round(game_maker_cannot_do_math))
20
        time_elapsed += time_increase
21
        if (time_elapsed >= time_max)
22
        {
23
            time_elapsed = 0
24
            sign_modifier = (-sign_modifier)
25
        }
26
        var time_elapsed_fall = time_elapsed + time_elapsed_increase_fall
27
        if (time_elapsed_fall > time_max)
28
        {
29
            time_elapsed_fall -= time_max
30
            sign_modifier_fall = (-sign_modifier)
31
        }
32
        else
33
            sign_modifier_fall = sign_modifier
34
        game_maker_cannot_do_math = power((time_elapsed_fall / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
35
        animation_disjoint_fall = sign_modifier_fall * (max_rise - game_maker_cannot_do_math)
36
        x_point_fall = starting_position_x + animation_disjoint_fall
37
        x_point = starting_position_x + animation_disjoint_x
38
        animation_disjoint_y += (fall_speed * (1 - (abs((x_point_fall - starting_position_x) / max_rise))))
39
        y_point = round(starting_position_y + animation_disjoint_y)
40
    }
41
    position_factor = (x_point - starting_position_x) / max_rise
42
    angle_pos = angle_pos_default + angle_pos_max * position_factor
43
    x = x_point + angle_radius * (cos(angle_pos * 0.008726646259971648))
44
    y = y_point - angle_radius * (sin(angle_pos * 0.008726646259971648))
45
    image_angle = angle_pos + 90
46
}
47
else if (state == 1)
48
{
49
    if (image_angle != angle_destination)
50
        image_angle += (spin_speed * spin_direction)
51
    var angle_diff = angle_difference(image_angle, angle_destination)
52
    if ((angle_diff * spin_direction) < 0)
53
        image_angle = angle_destination
54
    if (image_angle == angle_destination && no_loop_spin == false)
55
    {
56
        image_speed = 0.5
57
        alarm[1] = 15
alarm[1]

if live_call() return global.live_result; image_speed = 0 image_index = 0 state = 2
58
        no_loop_spin = true
59
    }
60
}
61
else if (state == 2)
62
{
63
    var can_trail = false
64
    trail_cc_current += 1
65
    if (trail_cc_current >= trail_cc_max)
66
    {
67
        can_trail = true
68
        trail_cc_current = 0
69
    }
70
    if (can_trail == true)
71
    {
72
        ds_list_add(x_list, x)
73
        ds_list_add(y_list, y)
74
        ds_list_add(angle_list, image_angle)
75
        while (ds_list_size(x_list) > max_points_trail)
76
        {
77
            ds_list_delete(x_list, 0)
78
            ds_list_delete(y_list, 0)
79
            ds_list_delete(angle_list, 0)
80
        }
81
    }
82
    x += lengthdir_x(attack_speed, image_angle)
83
    y += lengthdir_y(attack_speed, image_angle)
84
    if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == false)
85
        in_box = true
86
    if ((!(place_meeting(x, y, obj_dialogue_box_battle_transformation_any))) && in_box == true)
87
    {
88
        if (image_alpha > 0)
89
        {
90
            image_alpha -= 0.1
91
            if (image_alpha < 0)
92
                image_alpha = 0
93
            if (image_alpha == 0)
94
                instance_destroy()
95
        }
96
    }
97
    if (!instance_exists(obj_martlet_body))
98
    {
99
        if (distance_to_point(id_target.x, id_target.y) <= (attack_speed / 2 + 1))
100
        {
101
            id_feather_explosion = instance_create(id_target.x, id_target.y, obj_martlet_attack_splitting_feather_ext_checker)
102
            id_feather_explosion.fcreate_angle_diff = explosion_angle
103
            id_feather_explosion.feather_targetted = feather_targetted
104
            id_feather_explosion.fcreate_count = feather_create_count
105
            instance_destroy()
106
        }
107
    }
108
}