Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_factory_03_numpad_Step_0

(view raw script w/o annotations or w/e)
1
switch scene
2
{
3
    case 0:
4
        if (keyboard_multicheck_pressed(0) && 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; } }
())
5
        {
6
            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 }
()
7
            cutscene_advance()
8
        }
9
        break
10
    case 1:
11
        cutscene_dialogue()
12
        with (msg)
13
        {
14
            sndfnt = 108
15
            message[0] = "* (You figured out a#  code?)"
16
            message[1] = "* (Hurry and give it a#  try!)"
17
            prt[0] = 370
18
            prt[1] = 370
19
        }
20
        break
21
    case 2:
22
        if (!instance_exists(obj_factory_numpad_overlay))
23
            instance_create(0, 0, obj_factory_numpad_overlay)
24
        scene++
25
        break
26
    case 3:
27
        if (obj_factory_numpad_overlay.entry_correct == 1)
28
            scene = 7
29
        else if (obj_factory_numpad_overlay.entry_correct == 0)
30
            scene = 5
31
        break
32
    case 5:
33
        if instance_exists(obj_factory_numpad_overlay)
34
            return;
35
        cutscene_dialogue()
36
        with (msg)
37
        {
38
            sndfnt = 108
39
            message[0] = "* (Try something else!#  Come on!)"
40
            prt[0] = 370
41
        }
42
        break
43
    case 6:
44
        scene = 0
45
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
46
        break
47
    case 7:
48
        if instance_exists(obj_factory_numpad_overlay)
49
            return;
50
        cutscene_wait(1)
51
        break
52
    case 7.5:
53
        instance_destroy(obj_factory_03_minigame)
54
        if (obj_axis_npc.x > 400)
55
        {
56
            if cutscene_npc_walk(1166, 400, obj_axis_npc.y, 4, "x", "left")
57
                cutscene_advance(8)
58
        }
59
        else
60
            cutscene_advance(8)
61
        break
62
    case 8:
63
        instance_create(obj_pl.x, obj_pl.y, obj_player_npc)
64
        cutscene_follower_into_actor()
65
        audio_play_sound(snd_electric_flash, 1, 0)
66
        obj_factory_03_axis_flashlight.active = -1
67
        break
68
    case 9:
69
        cutscene_wait(0.25)
70
        break
71
    case 10:
72
        audio_play_sound(snd_electric_flash, 1, 0)
73
        if (obj_factory_03_axis_flashlight.active == -1)
74
            obj_factory_03_axis_flashlight.active = 0
75
        else
76
            obj_factory_03_axis_flashlight.active = -1
77
        flash_count--
78
        if (flash_count <= 0 && obj_factory_03_axis_flashlight.active == -1)
79
        {
80
            scene = 11
81
            instance_destroy(obj_factory_03_axis_flashlight)
82
        }
83
        else
84
            scene = 9
85
        break
86
    case 11:
87
        if cutscene_wait(1)
88
        {
89
            layer_set_visible("door_visible", true)
90
            audio_play_sound(snd_sliding_door_open, 1, 0)
91
            scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len) if instance_exists(obj_audio_fade_helper) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd }
(obj_radio.current_song, 500)
92
        }
93
        break
94
    case 12:
95
        cutscene_wait(0.5)
96
        break
97
    case 13:
98
        cutscene_npc_walk(1161, (obj_pl.x - 30), obj_pl.y, 3, "x", "right")
99
        if (obj_ceroba_npc.x < obj_player_npc.x)
100
            obj_player_npc.npc_direction = "left"
101
        break
102
    case 14:
103
        cutscene_dialogue()
104
        with (msg)
105
        {
106
            skippable = false
107
            talker[0] = 1161
108
            message[0] = "* Okay! Let's head#  upstairs before Axis- "
109
            prt[0] = 377
110
            if (cutoff >= string_length(message[message_current]))
111
            {
112
                other.scene++
113
                global.dialogue_open = false
114
                instance_destroy()
115
            }
116
        }
117
        break
118
    case 15:
119
        with (obj_factory_03_minigame)
120
            instance_destroy()
121
        with (obj_axis_npc)
122
        {
123
            can_walk = false
124
            y = 760
125
            x = 480
126
            npc_direction = "right"
127
        }
128
        cutscene_camera_move(620, obj_pl.y, 5)
129
        break
130
    case 16:
131
        cutscene_wait(0.7)
132
        break
133
    case 17:
134
        cutscene_dialogue()
135
        with (msg)
136
        {
137
            talker[0] = 1166
138
            talker[1] = 1161
139
            talker[4] = 1166
140
            talker[7] = 1161
141
            talker[9] = 1166
142
            talker[13] = 1161
143
            talker[14] = 1166
144
            talker[15] = 1161
145
            talker[16] = 1166
146
            talker[17] = 1161
147
            talker[19] = 1166
148
            talker[20] = 1161
149
            message[0] = "* HELLO."
150
            message[1] = "* Axis!"
151
            message[2] = "* ...Juuust the bot I was#  looking for!"
152
            message[3] = "* How are you doing these#  days?"
153
            message[4] = "* NOT SO GOOD."
154
            message[5] = "* I COULD ONLY SPEAK IN 15#  CHARACTERS (max) BACK#  THERE."
155
            message[6] = "* IT KIND OF BUMMED ME#  OUT."
156
            message[7] = "* I'm sorry to hear that."
157
            message[8] = "* Glad you got your full#  speech ability back."
158
            message[9] = "* THANK YOU. I DO LIKE#  TALKING."
159
            message[10] = "* WAIT."
160
            message[11] = "* WAIT????"
161
            message[12] = "* ARE YOU TRYING TO#  DISTRACT ME FROM MY#  MISSION."
162
            message[13] = "* No."
163
            message[14] = "* OH OKAY."
164
            message[15] = "* Can I ask you a question#  involving the security#  of the Steamworks?"
165
            message[16] = "* YES I AM A SECURITY#  EXPERT."
166
            message[17] = "* Why is it that some#  doors require a passcode#  to unlock..."
167
            message[18] = "* And others require a#  Steamworks ID?"
168
            message[19] = "* TWO-FACTOR#  AUTHENTICATION."
169
            message[20] = "* Huh..."
170
            prt[0] = 473
171
            prt[1] = 381
172
            prt[2] = 3754
173
            prt[3] = 3754
174
            prt[4] = 473
175
            prt[5] = 473
176
            prt[6] = 473
177
            prt[7] = 377
178
            prt[8] = 370
179
            prt[9] = 473
180
            prt[10] = 473
181
            prt[11] = 473
182
            prt[12] = 473
183
            prt[13] = 370
184
            prt[14] = 473
185
            prt[15] = 370
186
            prt[16] = 473
187
            prt[17] = 377
188
            prt[18] = 370
189
            prt[19] = 473
190
            prt[20] = 370
191
            if (message_current == 1)
192
            {
193
                obj_ceroba_npc.npc_direction = "left"
194
                if (!audio_is_playing(mus_enter_axis))
195
                    other.cutscene_music = audio_play_sound(mus_enter_axis, 1, 1)
196
            }
197
            if (message_current == 19)
198
                audio_stop_sound(other.cutscene_music)
199
        }
200
        break
201
    case 18:
202
        cutscene_wait(1.5)
203
        break
204
    case 19:
205
        cutscene_dialogue()
206
        with (msg)
207
        {
208
            talker[0] = 1166
209
            talker[1] = 1161
210
            message[0] = "* . . ."
211
            message[1] = "* . . ."
212
            prt[0] = 473
213
            prt[1] = 371
214
        }
215
        break
216
    case 20:
217
        cutscene_wait(1)
218
        break
219
    case 21:
220
        cutscene_npc_set_sprites(obj_player_npc, 15, 16, 18, 17, 24, 21, 23, 22)
221
        break
222
    case 22:
223
        cutscene_npc_set_sprites(obj_ceroba_npc, 81, 80, 78, 79, 61, 65, 60, 63)
224
        break
225
    case 23:
226
        cutscene_npc_walk(1168, 740, 710, 4, "x", "up")
227
        cutscene_advance()
228
        break
229
    case 24:
230
        cutscene_npc_walk(1161, 740, 710, 4, "x", "up")
231
        cutscene_advance()
232
        break
233
    case 25:
234
        with (obj_player_npc)
235
        {
236
            if (y <= 755 && image_alpha > 0)
237
                image_alpha -= 0.2
238
        }
239
        with (obj_ceroba_npc)
240
        {
241
            if (y <= 755 && image_alpha > 0)
242
                image_alpha -= 0.2
243
        }
244
        if (obj_ceroba_npc.image_alpha <= 0 && obj_player_npc.image_alpha <= 0)
245
        {
246
            layer_set_visible("door_visible", false)
247
            audio_play_sound(snd_undertale_thud, 1, 0)
248
            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] intensity = argument1 } }
(8, 2.5)
249
            cutscene_advance()
250
        }
251
        break
252
    case 26:
253
        cutscene_wait(2.5)
254
        break
255
    case 27:
256
        cutscene_dialogue()
257
        with (msg)
258
        {
259
            talker[0] = 1166
260
            message[0] = "* COOL."
261
            prt[0] = 473
262
        }
263
        break
264
    case 28:
265
        global.sworks_flag[37] = 3
266
        cutscene_change_room(240, 400, 760, 0.03)
267
        break
268
}