Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_martlet_wing_gust_final_object_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (state == 0)
4
{
5
    if (image_alpha < 1)
6
    {
7
        image_alpha += 0.1
8
        if (image_alpha > 1)
9
            image_alpha = 1
10
    }
11
    if (image_alpha == 1 && floor(obj_martlet_final_base.image_index) >= 3 && floor(obj_martlet_final_base.image_index) <= 4 && no_loop_alarm_fading_in == false)
12
    {
13
        switch sprite_index
14
        {
15
            case spr_battle_enemy_attack_martlet_wing_gust_junk_ball:
16
            case 2301:
17
                alarm[0] = 8
alarm[0]

if live_call() return global.live_result; state = 1
18
                break
19
            case 2294:
20
            case 2300:
21
                alarm[0] = 15
alarm[0]

if live_call() return global.live_result; state = 1
22
                break
23
            default:
24
                alarm[0] = 2
alarm[0]

if live_call() return global.live_result; state = 1
25
        }
26
27
        no_loop_alarm_fading_in = true
28
    }
29
}
30
if (state == 1)
31
{
32
    if (fall_speed < fall_speed_max)
33
        fall_speed += 1
34
    var fs_temp = fall_speed
35
    if ((bbox_bottom + fs_temp) >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
36
    {
37
        while ((bbox_bottom + sign(fs_temp)) < (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
38
            y += sign(fs_temp)
39
        fs_temp = 0
40
        state = 2
41
        switch sound_type
42
        {
43
            case 1:
44
                audio_play_sound(snd_mart_impact_1, 20, 0)
45
                break
46
            case 2:
47
                audio_play_sound(snd_mart_impact_2, 20, 0)
48
                break
49
            case 3:
50
                audio_play_sound(snd_mart_impact_3, 20, 0)
51
                break
52
            default:
53
                audio_play_sound(snd_mart_impact_2, 20, 0)
54
        }
55
56
    }
57
    y += fs_temp
58
}
59
if (state == 2)
60
{
61
    if (sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_can)
62
    {
63
        if (landing_init == false)
64
        {
65
            jump_speed = -12
66
            grav = 2
67
            angle_speed_sign = irandom_range(0, 1)
68
            if (angle_speed_sign == 0)
69
                angle_speed_sign = -1
70
            move_speed = 4 * angle_speed_sign
71
            angle_speed = 4 * (90 / (sprite_height / 2)) * (-angle_speed_sign)
72
            landing_init = true
73
        }
74
        y += jump_speed
75
        jump_speed += grav
76
        x += move_speed
77
        image_angle += angle_speed
78
        if ((y + sprite_width / 2) > __view_get((3 << 0), 0))
79
            instance_destroy()
80
    }
81
    else if (sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_ball)
82
    {
83
        if (landing_init == false)
84
        {
85
            if (landing_count == 0)
86
            {
87
                jump_speed = -8
88
                grav = 2
89
                rolling_speed_sign = irandom_range(0, 1)
90
                if (rolling_speed_sign == 0)
91
                    rolling_speed_sign = -1
92
                rolling_speed = 4 * rolling_speed_sign
93
                rolling_speed_angle = 90 / (sprite_width / 2) * (-rolling_speed)
94
            }
95
            else if (landing_count == 1)
96
                jump_speed = -4
97
            landing_count += 1
98
            landing_init = true
99
        }
100
        if (sign(jump_speed) == 1 && (y + sprite_height / 2 + jump_speed) >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4) && x >= obj_dialogue_box_battle_transformation_any.bbox_left && x <= obj_dialogue_box_battle_transformation_any.bbox_right)
101
        {
102
            while ((y + sprite_height / 2 + sign(jump_speed)) < (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
103
                y += sign(jump_speed)
104
            jump_speed = 0
105
            if (landing_count < 2)
106
                landing_init = false
107
        }
108
        y += jump_speed
109
        jump_speed += grav
110
        x += rolling_speed
111
        image_angle += rolling_speed_angle
112
        if ((y + sprite_height / 2) > __view_get((3 << 0), 0))
113
            instance_destroy()
114
    }
115
    else if (sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_radio)
116
    {
117
        if (landing_init == false)
118
        {
119
            jump_speed = -10
120
            grav = 2
121
            x_default = x
122
            y_default = y
123
            shake_x = 1
124
            shake_y = 1
125
            angle_speed_sign = irandom_range(0, 1)
126
            if (angle_speed_sign == 0)
127
                angle_speed_sign = -1
128
            move_speed = 4 * angle_speed_sign
129
            angle_speed = 2 * (-angle_speed_sign)
130
            landing_init = true
131
        }
132
        y_default += jump_speed
133
        jump_speed += grav
134
        x_default += move_speed
135
        image_angle += angle_speed
136
        x = x_default + 2 * (irandom_range((-shake_x), shake_x))
137
        y = y_default + 2 * (irandom_range((-shake_y), shake_y))
138
        if ((y + sprite_width / 2) > __view_get((3 << 0), 0))
139
            instance_destroy()
140
    }
141
    else if (sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_globe)
142
    {
143
        if (landing_init == false)
144
        {
145
            jump_speed = -8
146
            grav = 2
147
            angle_speed_sign = irandom_range(0, 1)
148
            if (angle_speed_sign == 0)
149
                angle_speed_sign = -1
150
            move_speed = 4 * angle_speed_sign
151
            angle_speed = 2 * (-angle_speed_sign)
152
            landing_init = true
153
        }
154
        y += jump_speed
155
        jump_speed += grav
156
        x += move_speed
157
        image_angle += angle_speed
158
        if ((y + sprite_width / 2) > __view_get((3 << 0), 0))
159
            instance_destroy()
160
    }
161
    else if (sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_shoe || sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_mug || sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_thingy || sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_glass || sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_saw || sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_idk || sprite_index == spr_battle_enemy_attack_martlet_wing_gust_junk_plank)
162
    {
163
        if (landing_init == false)
164
        {
165
            jump_speed = -10
166
            grav = 2
167
            angle_speed_sign = irandom_range(0, 1)
168
            if (angle_speed_sign == 0)
169
                angle_speed_sign = -1
170
            move_speed = 4 * angle_speed_sign
171
            angle_speed = 2 * (-angle_speed_sign)
172
            landing_init = true
173
        }
174
        y += jump_speed
175
        jump_speed += grav
176
        x += move_speed
177
        image_angle += angle_speed
178
        if ((y + sprite_width / 2) > __view_get((3 << 0), 0))
179
            instance_destroy()
180
    }
181
    else
182
        can_fade_out = true
183
    if (image_alpha > 0 && can_fade_out == true)
184
    {
185
        image_alpha -= 0.1
186
        if (image_alpha < 0)
187
            image_alpha = 0
188
        if (image_alpha == 0)
189
            instance_destroy()
190
    }
191
}