Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_steamworks_factory_elevator_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (act == 1)
4
{
5
    switch scene
6
    {
7
        case 0:
8
            cutscene_instance_create(obj_pl.x, obj_pl.y, obj_player_npc)
9
            break
10
        case 1:
11
            cutscene_npc_walk(1168, 160, 120, 3, "x", "down")
12
            break
13
        case 2:
14
            cutscene_wait(0.5)
15
            break
16
        case 3:
17
            audio_play_sound(snd_ring, 1, 0)
18
            cutscene_advance()
19
            break
20
        case 4:
21
            if (door_closed_amount < 1)
22
                door_closed_amount += 0.05
23
            else
24
                cutscene_sfx_play(snd_elevator_door_shut, 1)
25
            break
26
        case 5:
27
            cutscene_wait(1)
28
            break
29
        case 6:
30
            cutscene_advance()
31
            break
32
        case 7:
33
            cutscene_sfx_play(snd_elevator, 1)
34
            audio_sound_pitch(snd_elevator, 1)
35
            break
36
        case 8:
37
            cutscene_wait(3.7)
38
            break
39
        case 9:
40
            cutscene_advance()
41
            break
42
        case 10:
43
            cutscene_wait(1)
44
            break
45
        case 11:
46
            cutscene_sfx_play(snd_sliding_door_open, 1)
47
            break
48
        case 12:
49
            if (door_closed_amount > 0)
50
                door_closed_amount -= 0.05
51
            else
52
                cutscene_advance()
53
            break
54
        case 13:
55
            cutscene_wait(0.25)
56
            break
57
        case 14:
58
            cutscene_npc_walk(1168, 160, 220, 3, "x", "down")
59
            break
60
        case 15:
61
            audio_stop_all()
62
            instance_destroy(obj_player_npc)
63
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
64
            switch asset_get_index(global.last_room_overworld)
65
            {
66
                case 210:
67
                    cutscene_change_room(207, 170, 140, 0.1)
68
                    break
69
                case 207:
70
                    cutscene_change_room(210, 160, 120, 0.1)
71
                    break
72
            }
73
    }
74
75
    camera_set_view_pos(view_camera[0], 0, 0)
76
    camera_set_view_pos(view_camera[0], random_range((-screenshake_intensity), screenshake_intensity), random_range(screenshake_intensity, screenshake_intensity))
77
    if (scene > 7 && scene < 9)
78
    {
79
        if (screenshake_intensity < 1)
80
            screenshake_intensity += 0.05
81
    }
82
    else if (screenshake_intensity > 0)
83
        screenshake_intensity -= 0.15
84
}
85
else
86
{
87
    var flash = false
88
    switch scene
89
    {
90
        case 0:
91
            cutscene_instance_create(obj_pl.x, obj_pl.y, obj_player_npc)
92
            break
93
        case 1:
94
            cutscene_npc_walk(1168, 160, 120, 2, "x", "down")
95
            break
96
        case 2:
97
            cutscene_wait(2)
98
            break
99
        case 3:
100
        case 5:
101
        case 7:
102
            flash = true
103
            cutscene_advance()
104
            break
105
        case 4:
106
            cutscene_wait(0.9)
107
            break
108
        case 6:
109
            cutscene_wait(0.4)
110
            break
111
        case 8:
112
            cutscene_wait(1.2)
113
            break
114
        case 9:
115
            if (scene != 9)
116
                audio_play_sound(snd_electric_flash, 1, 0)
117
            layer_enable_fx("effect_dark_overlay", false)
118
            scene++
119
            break
120
        case 10:
121
            cutscene_wait(1)
122
            break
123
        case 11:
124
            audio_play_sound(snd_ring, 1, 0)
125
            cutscene_advance()
126
            break
127
        case 12:
128
            if (door_closed_amount < 1)
129
                door_closed_amount += 0.05
130
            else
131
                cutscene_sfx_play(snd_elevator_door_shut, 1)
132
            break
133
        case 13:
134
            cutscene_wait(1)
135
            break
136
        case 14:
137
            cutscene_advance()
138
            break
139
        case 15:
140
            cutscene_sfx_play(snd_elevator_long, 1)
141
            break
142
        case 16:
143
            cutscene_wait(2)
144
            break
145
        case 17:
146
            audio_sound_gain(snd_elevator_long, 0.5, 1000)
147
            obj_radio.bgm = 353
148
            global.radio_restart = true
149
            cutscene_advance()
150
            break
151
        case 18:
152
            if (!audio_is_playing(snd_elevator_long))
153
                cutscene_advance()
154
            break
155
        case 19:
156
            cutscene_sfx_play(snd_sliding_door_open, 1)
157
            break
158
        case 20:
159
            if (door_closed_amount > 0)
160
                door_closed_amount -= 0.05
161
            else
162
                cutscene_advance()
163
            break
164
        case 21:
165
            cutscene_wait(0.55)
166
            break
167
        case 22:
168
            cutscene_npc_walk(1168, 160, 220, 2, "x", "down")
169
            break
170
        case 23:
171
            instance_destroy(obj_player_npc)
172
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
173
            global.hotland_flag[6] = 1
174
            switch asset_get_index(global.last_room_overworld)
175
            {
176
                case 210:
177
                    cutscene_change_room(207, 170, 140, 0.1)
178
                    break
179
                case 207:
180
                    cutscene_change_room(210, 160, 120, 0.1)
181
                    break
182
            }
183
184
            break
185
    }
186
187
    if (scene > 15 && scene < 19)
188
    {
189
        if (screenshake_intensity < 1)
190
            screenshake_intensity += 0.05
191
    }
192
    else if (screenshake_intensity > 0)
193
        screenshake_intensity -= 0.15
194
    if (flash == true)
195
    {
196
        audio_play_sound(snd_electric_flash, 1, 0)
197
        layer_enable_fx("effect_dark_overlay", true)
198
        if (!alarm[0])
199
            alarm[0] = 8
alarm[0]

layer_enable_fx("effect_dark_overlay", false)
200
    }
201
    camera_set_view_pos(view_camera[0], 0, 0)
202
    camera_set_view_pos(view_camera[0], random_range((-screenshake_intensity), screenshake_intensity), random_range(screenshake_intensity, screenshake_intensity))
203
}