Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_martlet_wing_gust_junk_Step_0

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

state = 1
16
                break
17
            case 2294:
18
            case 2300:
19
                alarm[0] = 15
alarm[0]

state = 1
20
                break
21
            default:
22
                alarm[0] = 2
alarm[0]

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