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
    exit;
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
        {
34
            sign_modifier_fall = sign_modifier;
35
        }
36
        game_maker_cannot_do_math = power((time_elapsed_fall / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
37
        animation_disjoint_fall = sign_modifier_fall * (max_rise - game_maker_cannot_do_math);
38
        x_point_fall = starting_position_x + animation_disjoint_fall;
39
        x_point = starting_position_x + animation_disjoint_x;
40
        animation_disjoint_y += (fall_speed * (1 - abs((x_point_fall - starting_position_x) / max_rise)));
41
        y_point = round(starting_position_y + animation_disjoint_y);
42
    }
43
    position_factor = (x_point - starting_position_x) / max_rise;
44
    angle_pos = angle_pos_default + (angle_pos_max * position_factor);
45
    x = x_point + (angle_radius * cos(angle_pos * 0.008726646259971648));
46
    y = y_point - (angle_radius * sin(angle_pos * 0.008726646259971648));
47
    image_angle = angle_pos + 90;
48
}
49
else if (state == 1)
50
{
51
    if (image_angle != angle_destination)
52
        image_angle += (spin_speed * spin_direction);
53
    var angle_diff = angle_difference(image_angle, angle_destination);
54
    if ((angle_diff * spin_direction) < 0)
55
        image_angle = angle_destination;
56
    if (image_angle == angle_destination && no_loop_spin == false)
57
    {
58
        image_speed = 0.5;
59
        alarm[1] = 15;
gml_Object_obj_martlet_attack_splitting_feather_Alarm_1.gml

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