Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_steamworks_05d_lever_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (global.sworks_flag[1] >= 4)
4
{
5
    if (global.route != 3 || global.sworks_flag[1] != 4)
6
    {
7
        if (scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_scr_normal_state) { var pl_dir = obj_pl.direction var pl_x = 0 var pl_y = 0 var check_distance_x = 0 var check_distance_y = 0 switch pl_dir { case 0: pl_x = obj_pl.bbox_right pl_y = obj_pl.bbox_top + 1 check_distance_x = 20 break case 180: pl_x = obj_pl.bbox_left pl_y = obj_pl.bbox_top + 1 check_distance_x = -20 break case 90: pl_x = obj_pl.x pl_y = obj_pl.bbox_top check_distance_y = -20 break case 270: pl_x = obj_pl.x pl_y = obj_pl.bbox_bottom check_distance_y = 20 break } if collision_line_first(pl_x, pl_y, (pl_x + check_distance_x), (pl_y + check_distance_y), id, false, false) return true; } }
() && keyboard_multicheck_pressed(0))
8
        {
9
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
10
            with (msg)
11
                message[0] = "* The generator is already#  running."
12
        }
13
        return;
14
    }
15
}
16
if (global.route != 3)
17
{
18
    switch scene
19
    {
20
        case 0:
21
            if (scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_scr_normal_state) { var pl_dir = obj_pl.direction var pl_x = 0 var pl_y = 0 var check_distance_x = 0 var check_distance_y = 0 switch pl_dir { case 0: pl_x = obj_pl.bbox_right pl_y = obj_pl.bbox_top + 1 check_distance_x = 20 break case 180: pl_x = obj_pl.bbox_left pl_y = obj_pl.bbox_top + 1 check_distance_x = -20 break case 90: pl_x = obj_pl.x pl_y = obj_pl.bbox_top check_distance_y = -20 break case 270: pl_x = obj_pl.x pl_y = obj_pl.bbox_bottom check_distance_y = 20 break } if collision_line_first(pl_x, pl_y, (pl_x + check_distance_x), (pl_y + check_distance_y), id, false, false) return true; } }
() && keyboard_multicheck_pressed(0))
22
            {
23
                audio_play_sound(snd_switch, 1, 0)
24
                image_speed = (1/3)
25
                scr_radio_fade
scr_radio_fade

function scr_radio_fade(argument0, argument1) //gml_Script_scr_radio_fade { var fade_vol = argument0 var fade_len = argument1 with (obj_radio) audio_sound_gain(current_song, fade_vol, fade_len) }
(0, 500)
26
                scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_scr_frozen_state obj_pl.image_index = 0 obj_pl.image_speed = 0 }
()
27
                cutscene_advance()
28
            }
29
            break
30
        case 1:
31
            if ((image_index + image_speed) > 5)
32
            {
33
                image_index = 5
34
                image_speed = 0
35
                cutscene_advance()
36
            }
37
            break
38
        case 2:
39
            cutscene_sfx_play(snd_undertale_thud, 1)
40
            break
41
        case 3:
42
            cutscene_screenshake(1, 2)
43
            break
44
        case 4:
45
            cutscene_wait(1)
46
            break
47
        case 5:
48
            image_speed = 0.25
49
            cutscene_advance()
50
            break
51
        case 6:
52
            if ((image_index + image_speed) > (image_number - 1))
53
            {
54
                image_index = image_number - 1
55
                image_speed = 0
56
                cutscene_advance()
57
            }
58
            break
59
        case 7:
60
            global.sworks_flag[1] = 3
61
            instance_destroy(obj_steamworks_metal_sounds)
62
            obj_radio.bgm = 215
63
            scr_radio_restart
scr_radio_restart

function scr_radio_restart() //gml_Script_scr_radio_restart { with (obj_radio) event_user(0) }
()
64
            cutscene_advance()
65
            break
66
        case 8:
67
            cutscene_wait(2)
68
            break
69
        case 9:
70
            var tile = tile_get_ids_at_depth(1000006)
71
            for (var i = 0; i < array_length_1d(tile); i++)
72
                tile_set_alpha(tile[i], tile_alpha)
73
            audio_play_sound(snd_undertale_appear, 1, 0)
74
            if (tile_alpha >= 1)
75
                cutscene_advance(12)
76
            else
77
            {
78
                cutscene_advance()
79
                tile_alpha += 0.25
80
            }
81
            break
82
        case 10:
83
            cutscene_wait(0.25)
84
            break
85
        case 11:
86
            cutscene_advance(9)
87
            break
88
        case 12:
89
            cutscene_wait(0.25)
90
            break
91
        case 13:
92
            if (cutscene_camera_move(400, obj_pl.y, 1, true) && obj_steamworks_05d_background.image_alpha >= 1)
93
                cutscene_advance()
94
            if (obj_camera.x <= 520 && (!alarm[0]))
95
                alarm[0] = 3
alarm[0]

obj_steamworks_05d_background.image_alpha += 0.02
96
            break
97
        case 14:
98
            cutscene_wait(2.5)
99
            break
100
        case 15:
101
            cutscene_change_room(144, 220, 280, 0.025)
102
            break
103
    }
104
105
}
106
else
107
{
108
    switch scene
109
    {
110
        case 0:
111
            if (scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_scr_normal_state) { var pl_dir = obj_pl.direction var pl_x = 0 var pl_y = 0 var check_distance_x = 0 var check_distance_y = 0 switch pl_dir { case 0: pl_x = obj_pl.bbox_right pl_y = obj_pl.bbox_top + 1 check_distance_x = 20 break case 180: pl_x = obj_pl.bbox_left pl_y = obj_pl.bbox_top + 1 check_distance_x = -20 break case 90: pl_x = obj_pl.x pl_y = obj_pl.bbox_top check_distance_y = -20 break case 270: pl_x = obj_pl.x pl_y = obj_pl.bbox_bottom check_distance_y = 20 break } if collision_line_first(pl_x, pl_y, (pl_x + check_distance_x), (pl_y + check_distance_y), id, false, false) return true; } }
() && keyboard_multicheck_pressed(0))
112
            {
113
                scr_radio_fade
scr_radio_fade

function scr_radio_fade(argument0, argument1) //gml_Script_scr_radio_fade { var fade_vol = argument0 var fade_len = argument1 with (obj_radio) audio_sound_gain(current_song, fade_vol, fade_len) }
(0, 500)
114
                scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_scr_frozen_state obj_pl.image_index = 0 obj_pl.image_speed = 0 }
()
115
                cutscene_advance()
116
            }
117
            break
118
        case 1:
119
            cutscene_wait(0.5)
120
            break
121
        case 2:
122
            audio_play_sound(snd_lever_strain, 1, 0)
123
            cutscene_advance()
124
            break
125
        case 3:
126
            if (!audio_is_playing(snd_lever_strain))
127
            {
128
                cutscene_advance()
129
                image_index = 5
130
            }
131
            break
132
        case 4:
133
            cutscene_sfx_play(snd_lever_break, 1)
134
            break
135
        case 5:
136
            cutscene_screenshake(1, 3)
137
            break
138
        case 6:
139
            cutscene_wait(1)
140
            break
141
        case 7:
142
            image_speed = 0.25
143
            cutscene_advance()
144
            break
145
        case 8:
146
            if ((image_index + image_speed) > (image_number - 1))
147
            {
148
                image_index = image_number - 1
149
                image_speed = 0
150
                cutscene_advance()
151
            }
152
            break
153
        case 9:
154
            global.sworks_flag[1] = 3
155
            instance_destroy(obj_steamworks_metal_sounds)
156
            scr_radio_restart
scr_radio_restart

function scr_radio_restart() //gml_Script_scr_radio_restart { with (obj_radio) event_user(0) }
()
157
            cutscene_advance()
158
            break
159
        case 10:
160
            cutscene_wait(2)
161
            flicker_count = 7
162
            break
163
        case 11:
164
            tile = tile_get_ids_at_depth(1000006)
165
            if (flicker_count <= 0)
166
            {
167
                cutscene_advance(14)
168
                audio_play_sound(snd_geno_power_on, 1, 0)
169
                scr_screenshake
scr_screenshake

function scr_screenshake(argument0, argument1) //gml_Script_scr_screenshake { if instance_exists(obj_screenshake_player) return; with (instance_create(__view_get((9 << 0), 0).x, __view_get((9 << 0), 0).y, obj_screenshake_player)) { alarm[0]
alarm[0]

obj_steamworks_05d_background.image_alpha += 0.02
intensity = argument1 } }
(1, 2)
170
                obj_steamworks_05d_background.image_alpha = 1
171
                tile_alpha = 1
172
            }
173
            else
174
            {
175
                cutscene_advance()
176
                tile_alpha = random_range(0.25, 0.75)
177
                flicker_count -= 1
178
            }
179
            for (i = 0; i < array_length_1d(tile); i++)
180
                tile_set_alpha(tile[i], tile_alpha)
181
            var snd = audio_play_sound(snd_undertale_appear, 1, 0)
182
            audio_sound_pitch(snd, random_range(0.9, 1.35))
183
            break
184
        case 12:
185
            cutscene_wait(0.13)
186
            break
187
        case 13:
188
            cutscene_advance(11)
189
            break
190
        case 14:
191
            cutscene_wait(0.25)
192
            break
193
        case 15:
194
            cutscene_wait(2.5)
195
            break
196
        case 16:
197
            cutscene_change_room(144, 220, 280, 0.025)
198
            break
199
        case 17:
200
            cutscene_wait(1)
201
            break
202
        case 18:
203
            cutscene_dialogue()
204
            with (msg)
205
            {
206
                color = true
207
                col_modif[0] = 16711935
208
                message[0] = "* ERROR: COOLANT PRESSURE LOW"
209
                message[1] = "* GENERATOR STATUS: UNSTABLE"
210
                message_col[0][0] = "* ERROR: COOLANT PRESSURE LOW"
211
                message_col[1][0] = "* GENERATOR STATUS: UNSTABLE"
212
            }
213
            break
214
        case 19:
215
            cutscene_wait(1)
216
            break
217
        case 20:
218
            cutscene_instance_create(630, 173, obj_flowey_npc)
219
            obj_flowey_npc.npc_direction = "right"
220
            obj_flowey_npc.image_alpha = 0
221
            obj_pl.direction = 180
222
            break
223
        case 21:
224
            obj_flowey_npc.image_alpha = 1
225
            cutscene_npc_action_sprite(3194, 242, 0.2, false)
226
            break
227
        case 22:
228
            cutscene_wait(0.25)
229
            break
230
        case 23:
231
            cutscene_dialogue()
232
            with (msg)
233
            {
234
                talker[0] = 3194
235
                message[0] = "* Gee, wonder how that#  came to be?"
236
                message[1] = "* I think I'm gonna start#  praying for our safety."
237
                message[2] = "* Ya know, in case the#  facility explodes while#  we're knee deep in it."
238
                prt[0] = 353
239
                prt[1] = 352
240
                prt[2] = 351
241
            }
242
            break
243
        case 24:
244
            if cutscene_npc_action_sprite(3194, 245, 0.2, false)
245
                instance_destroy(obj_flowey_npc)
246
            break
247
        case 25:
248
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
249
            global.sworks_flag[1] = 5
250
            scene++
251
            break
252
    }
253
254
}