Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_steamworks_21_controller_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var axis_run_speed = npc_axis_run_speed
4
show_debug_message(scene)
5
switch scene
6
{
7
    case 0:
8
        if (obj_pl.x < 1960)
9
        {
10
            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 }
()
11
            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, 300)
12
            if (global.sworks_flag[12] == 0)
13
            {
14
                instance_create(0, 0, obj_steamworks_21_light_flash)
15
                cutscene_advance()
16
            }
17
            else
18
                cutscene_advance(5)
19
        }
20
        break
21
    case 1:
22
        cutscene_wait(1)
23
        break
24
    case 2:
25
        instance_create(0, 0, obj_steamworks_21_light_flash)
26
        cutscene_advance()
27
        break
28
    case 3:
29
        obj_pl.direction = 0
30
        cutscene_advance()
31
        if (cutscene_follower_into_actor() == true)
32
        {
33
            with (obj_shadow_master)
34
                event_perform(ev_alarm, 0)
35
            actor_follower.npc_direction = "right"
36
        }
37
        break
38
    case 4:
39
        cutscene_wait(2)
40
        break
41
    case 5:
42
        cutscene_instance_create(2100, 115, obj_axis_npc)
43
        with (obj_shadow_master)
44
            event_perform(ev_alarm, 0)
45
        obj_axis_npc.image_alpha = 0
46
        audio_play_sound(snd_undertale_appear, 1, 0)
47
        if (global.sworks_flag[12] == 1)
48
            cutscene_advance(5.3)
49
        break
50
    case 5.3:
51
        with (obj_axis_npc)
52
        {
53
            if (image_alpha < 1)
54
                image_alpha += 0.05
55
            else
56
                other.scene = 5.6
57
        }
58
        break
59
    case 5.6:
60
        if cutscene_wait(1.5)
61
            cutscene_advance(10)
62
        break
63
    case 6:
64
        if (shadow_axis_image_alpha < 1)
65
            shadow_axis_image_alpha += 0.05
66
        else
67
            other.scene++
68
        break
69
    case 7:
70
        if cutscene_wait(1)
71
        {
72
            obj_axis_npc.image_alpha = 1
73
            cutscene_advance(7.3)
74
        }
75
        break
76
    case 7.3:
77
        if (shadow_axis_image_alpha > 0)
78
            shadow_axis_image_alpha -= 0.1
79
        else
80
            cutscene_advance(7.6)
81
        break
82
    case 7.6:
83
        if cutscene_wait(1)
84
            cutscene_advance(8)
85
        break
86
    case 8:
87
        var spawn_arrows = false
88
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
89
        with (msg)
90
        {
91
            sndfnt_array[0] = 111
92
            if (global.route == 2)
93
            {
94
                message[0] = "* ESCAPED CONVICTS SPOTTED.#  STEAMWORKS:#  OFFICE BRANCH."
95
                prt[0] = 2916
96
                sndfnt_array[1] = 108
97
                message[1] = "* Oh no! Run!"
98
                prt[1] = 381
99
                if (message_current == 1)
100
                {
101
                    other.scene = 9
102
                    skippable = false
103
                    spawn_arrows = true
104
                }
105
            }
106
            if (global.route == 1)
107
            {
108
                message[0] = "* ESCAPED CONVICT SPOTTED.#  STEAMWORKS:#  OFFICE BRANCH."
109
                prt[0] = 2916
110
            }
111
        }
112
        if (!global.dialogue_open)
113
        {
114
            spawn_arrows = true
115
            cutscene_advance(10)
116
        }
117
        if (spawn_arrows == true)
118
        {
119
            instance_create_depth(1952, 96, -100, obj_axis_chase_flashing_arrow)
120
            instance_create_depth(1856, 96, -100, obj_axis_chase_flashing_arrow)
121
            var arrow_down = instance_create_depth(1792, 160, -100, obj_axis_chase_flashing_arrow)
122
            arrow_down.image_angle = 0
123
        }
124
        break
125
    case 9:
126
        if (instance_exists(obj_ceroba_npc) && ceroba_is_running == false)
127
        {
128
            ceroba_is_running = true
129
            with (obj_ceroba_npc)
130
            {
131
                can_walk = false
132
                action_sprite = true
133
                path_start(pt_steamworks_21_ceroba_chase, 5.9, path_action_stop, false)
134
                path_change_point(pt_steamworks_21_ceroba_chase, 0, obj_ceroba_npc.x, obj_ceroba_npc.y, 100)
135
                direction = 180
136
            }
137
        }
138
        global.party_member = -4
139
        if cutscene_wait(1)
140
        {
141
            instance_destroy(obj_dialogue)
142
            global.dialogue_open = false
143
            cutscene_advance(10)
144
        }
145
        break
146
    case 10:
147
        event_music = audio_play_sound(mus_axis_chase, 1, 1)
148
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
149
        cutscene_advance()
150
        break
151
    case 11:
152
        with (obj_axis_npc)
153
        {
154
            can_walk = false
155
            action_sprite = true
156
            path_start(pt_steamworks_21_axis_chase, axis_run_speed, path_action_stop, false)
157
        }
158
        axis_is_running = true
159
        cutscene_advance()
160
        break
161
    case 12:
162
        if point_in_rectangle(obj_pl.x, obj_pl.y, 200, 660, 280, 720)
163
        {
164
            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 }
()
165
            cutscene_instance_create(obj_pl.x, obj_pl.y, obj_player_npc)
166
        }
167
        break
168
    case 13:
169
        cutscene_npc_walk(1168, 210, 700, 4, "y", "up")
170
        break
171
    case 14:
172
        cutscene_advance()
173
        break
174
    case 15:
175
        if (obj_axis_npc.path_position < 0.95)
176
            obj_axis_npc.path_position = 0.95
177
        if (global.route == 2)
178
            cutscene_wait(0.75)
179
        else if (axis_is_running == false && cutscene_wait(0.75))
180
        {
181
            if (!instance_exists(obj_axis_chase_blocker))
182
            {
183
                with (instance_create_depth(200, 680, 0, obj_axis_chase_blocker))
184
                {
185
                    image_xscale = 4
186
                    image_yscale = 1
187
                }
188
            }
189
            cutscene_advance(47)
190
            instance_destroy(obj_player_npc)
191
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
192
        }
193
        break
194
    case 16:
195
        if (axis_is_running == false)
196
            cutscene_npc_direction(obj_ceroba_npc, "left")
197
        break
198
    case 17:
199
        cutscene_npc_direction(obj_player_npc, "right")
200
        break
201
    case 18:
202
        cutscene_dialogue()
203
        with (msg)
204
        {
205
            sndfnt = 108
206
            message[0] = "* Clover! The lockers!"
207
            message[1] = "* Follow me!"
208
            prt[0] = 370
209
            prt[1] = 370
210
        }
211
        break
212
    case 19:
213
        cutscene_npc_walk(1161, 76, 740, 4, "y", "up")
214
        cutscene_advance()
215
        break
216
    case 20:
217
        cutscene_npc_walk(1168, 117, 735, 4, "y", "up")
218
        cutscene_advance()
219
        break
220
    case 21:
221
        if obj_ceroba_npc.npc_arrived
222
        {
223
            with (obj_steamworks_21_locker_tall)
224
            {
225
                if (image_index == 0 && obj_ceroba_npc.image_alpha > 0)
226
                {
227
                    audio_play_sound(snd_undertale_snap, 1, 0)
228
                    image_index = 1
229
                }
230
            }
231
            if (obj_ceroba_npc.image_alpha > 0)
232
                obj_ceroba_npc.image_alpha -= 0.2
233
            if (obj_ceroba_npc.image_alpha <= 0 && obj_steamworks_21_locker_tall.image_index == 1)
234
            {
235
                audio_play_sound(snd_undertale_thud, 1, 0)
236
                obj_steamworks_21_locker_tall.image_index = 0
237
            }
238
        }
239
        if obj_player_npc.npc_arrived
240
        {
241
            with (obj_steamworks_21_locker)
242
            {
243
                if (image_index == 0 && obj_player_npc.image_alpha > 0)
244
                {
245
                    audio_play_sound(snd_undertale_snap, 1, 0)
246
                    image_index = 1
247
                }
248
            }
249
            if (obj_player_npc.image_alpha > 0)
250
                obj_player_npc.image_alpha -= 0.2
251
            if (obj_player_npc.image_alpha <= 0 && obj_steamworks_21_locker.image_index == 1)
252
            {
253
                audio_play_sound(snd_undertale_thud, 1, 0)
254
                obj_steamworks_21_locker.image_index = 0
255
            }
256
        }
257
        if (obj_player_npc.image_alpha == 0 && obj_ceroba_npc.image_alpha == 0)
258
            cutscene_advance()
259
        break
260
    case 22:
261
        cutscene_wait(1)
262
        break
263
    case 23:
264
        cutscene_camera_move(obj_pl.x, (obj_axis_npc.y + 40), 2)
265
        break
266
    case 24:
267
        if (obj_axis_npc.sprite_index != spr_axis_down_bonk_restore)
268
        {
269
            obj_axis_npc.sprite_index = spr_axis_down_bonk_restore
270
            obj_axis_npc.image_index = 0
271
            obj_axis_npc.image_speed = 1
272
        }
273
        if (obj_axis_npc.image_index >= (obj_axis_npc.image_number - 1))
274
        {
275
            obj_axis_npc.action_sprite = false
276
            obj_axis_npc.npc_direction = "down"
277
            tile_layer_hide(-99899)
278
            cutscene_advance()
279
        }
280
        break
281
    case 25:
282
        cutscene_wait(1)
283
        break
284
    case 26:
285
        cutscene_camera_move(obj_pl.x, obj_pl.y, 2, true)
286
        with (obj_axis_npc)
287
        {
288
            action_sprite = true
289
            if (path_index != pt_steamworks_21_axis_walk && other.axis_is_running == false)
290
            {
291
                other.axis_is_running = true
292
                path_start(pt_steamworks_21_axis_walk, 3, path_action_stop, false)
293
            }
294
            if (path_position >= 1)
295
            {
296
                action_sprite = false
297
                axis_is_running = false
298
                other.scene += 1
299
            }
300
        }
301
        break
302
    case 27:
303
        cutscene_wait(0.5)
304
        break
305
    case 28:
306
        cutscene_npc_direction(obj_axis_npc, "up")
307
        break
308
    case 29:
309
        cutscene_wait(0.5)
310
        break
311
    case 30:
312
        cutscene_npc_direction(obj_axis_npc, "left")
313
        break
314
    case 31:
315
        cutscene_wait(0.5)
316
        break
317
    case 32:
318
        cutscene_npc_direction(obj_axis_npc, "down")
319
        break
320
    case 33:
321
        cutscene_wait(1)
322
        break
323
    case 34:
324
        cutscene_dialogue()
325
        with (msg)
326
        {
327
            sndfnt = 111
328
            message[0] = "* HOW."
329
            prt[0] = 473
330
        }
331
        break
332
    case 35:
333
        cutscene_wait(0.25)
334
        break
335
    case 36:
336
        cutscene_npc_walk(1166, -40, obj_axis_npc.y, 3, "x", "left")
337
        break
338
    case 37:
339
        cutscene_wait(1)
340
        break
341
    case 38:
342
        obj_ceroba_npc.npc_direction = "down"
343
        with (obj_steamworks_21_locker_tall)
344
        {
345
            if (image_index == 0 && obj_ceroba_npc.image_alpha < 1)
346
            {
347
                audio_play_sound(snd_undertale_snap, 1, 0)
348
                image_index = 1
349
            }
350
        }
351
        if (obj_ceroba_npc.image_alpha < 1)
352
            obj_ceroba_npc.image_alpha += 0.2
353
        if (obj_ceroba_npc.image_alpha >= 1)
354
        {
355
            audio_play_sound(snd_undertale_thud, 1, 0)
356
            obj_steamworks_21_locker_tall.image_index = 0
357
            cutscene_advance()
358
        }
359
        break
360
    case 39:
361
        cutscene_wait(0.25)
362
        break
363
    case 40:
364
        obj_ceroba_npc.npc_direction = "right"
365
        obj_player_npc.npc_direction = "down"
366
        with (obj_steamworks_21_locker)
367
        {
368
            if (image_index == 0 && obj_player_npc.image_alpha < 1)
369
            {
370
                audio_play_sound(snd_undertale_snap, 1, 0)
371
                image_index = 1
372
            }
373
        }
374
        if (obj_player_npc.image_alpha < 1)
375
            obj_player_npc.image_alpha += 0.2
376
        if (obj_player_npc.image_alpha >= 1)
377
        {
378
            audio_play_sound(snd_undertale_thud, 1, 0)
379
            obj_steamworks_21_locker.image_index = 0
380
            cutscene_advance()
381
        }
382
        break
383
    case 41:
384
        cutscene_wait(0.25)
385
        break
386
    case 42:
387
        obj_player_npc.npc_direction = "left"
388
        cutscene_dialogue()
389
        with (msg)
390
        {
391
            talker[0] = 1161
392
            message[0] = "* Huff... Huff..."
393
            message[1] = "* This guy means#  business!"
394
            message[2] = "* My husband was one hell#  of an engineer."
395
            message[3] = "* I just wonder why he#  kept all this from me?"
396
            message[4] = "* He could've left me#  some sort of off-switch,#  right?"
397
            message[5] = "* ..."
398
            message[6] = "* THE ROBOT! I totally#  forgot about our plan!"
399
            message[7] = "* Ugh, sorry. Next time#  we see Axis, we'll try#  it for sure."
400
            prt[0] = 381
401
            prt[1] = 394
402
            prt[2] = 377
403
            prt[3] = 370
404
            prt[4] = 370
405
            prt[5] = 394
406
            prt[6] = 393
407
            prt[7] = 394
408
        }
409
        break
410
    case 43:
411
        scr_actor_into_follower
scr_actor_into_follower

function scr_actor_into_follower(argument0, argument1) //gml_Script_scr_actor_into_follower { if (!instance_exists(argument0)) return false; if (argument1 == noone) return false; instance_create(argument0.x, argument0.y, argument1) argument1.x = argument0.x argument1.y = argument0.y with (argument0) { switch npc_direction { case "up": argument1.sprite_index = argument1.up_sprite_idle break case "down": argument1.sprite_index = argument1.down_sprite_idle break case "left": argument1.sprite_index = argument1.left_sprite_idle break case "right": argument1.sprite_index = argument1.right_sprite_idle break } } instance_destroy(argument0) }
(obj_ceroba_npc, obj_ceroba_follower)
412
        global.party_member = 1171
413
        cutscene_advance()
414
        break
415
    case 44:
416
        camera_set_view_target(view_camera[0], 1031)
417
        tile_layer_hide(-99999)
418
        cutscene_end()
419
        global.sworks_flag[12] = 2
420
        break
421
    case 45:
422
        with (obj_axis_npc)
423
            path_end()
424
        global.cutscene = true
425
        cutscene_dialogue()
426
        with (msg)
427
        {
428
            talker[0] = 1166
429
            if (global.sworks_flag[12] == 0)
430
            {
431
                message[0] = "* HALT."
432
                message[1] = "* YOU ARE COMING WITH ME."
433
                prt[0] = 473
434
                prt[1] = 473
435
            }
436
            else
437
            {
438
                message[0] = "* ENOUGH RUNNING."
439
                prt[0] = 473
440
            }
441
        }
442
        break
443
    case 46:
444
        cutscene_change_room(172, 160, 290, 0.05)
445
        break
446
    case 47:
447
        if (obj_steamworks_21_locker.waiter == 2)
448
            cutscene_advance(48)
449
        break
450
    case 48:
451
        if (obj_axis_npc.sprite_index != spr_axis_down_bonk_restore)
452
        {
453
            obj_axis_npc.sprite_index = spr_axis_down_bonk_restore
454
            obj_axis_npc.image_index = 0
455
            obj_axis_npc.image_speed = 1
456
        }
457
        if (obj_axis_npc.image_index >= (obj_axis_npc.image_number - 1))
458
        {
459
            obj_axis_npc.action_sprite = false
460
            obj_axis_npc.npc_direction = "down"
461
            tile_layer_hide(-99899)
462
            cutscene_advance()
463
        }
464
        break
465
    case 49:
466
        cutscene_wait(1)
467
        break
468
    case 50:
469
        with (obj_axis_npc)
470
        {
471
            action_sprite = true
472
            if (path_index != pt_steamworks_21_axis_walk_neutral && other.axis_is_running == false)
473
            {
474
                other.axis_is_running = true
475
                path_start(pt_steamworks_21_axis_walk_neutral, 3, path_action_stop, false)
476
            }
477
            if (path_position >= 1)
478
            {
479
                if (obj_steamworks_21_locker.waiter == 0)
480
                {
481
                    action_sprite = false
482
                    other.axis_is_running = false
483
                    other.scene = 45
484
                    global.sworks_flag[43] += 1
485
                }
486
                else
487
                {
488
                    action_sprite = false
489
                    other.axis_is_running = false
490
                    other.scene += 1
491
                }
492
            }
493
        }
494
        break
495
    case 51:
496
        cutscene_wait(0.5)
497
        break
498
    case 52:
499
        cutscene_npc_direction(obj_axis_npc, "up")
500
        break
501
    case 53:
502
        cutscene_wait(0.5)
503
        break
504
    case 54:
505
        cutscene_npc_direction(obj_axis_npc, "left")
506
        break
507
    case 55:
508
        cutscene_wait(0.5)
509
        break
510
    case 56:
511
        cutscene_npc_direction(obj_axis_npc, "down")
512
        break
513
    case 57:
514
        cutscene_wait(1)
515
        break
516
    case 58:
517
        cutscene_dialogue()
518
        with (msg)
519
        {
520
            sndfnt = 111
521
            message[0] = "* HOW."
522
            prt[0] = 473
523
        }
524
        break
525
    case 59:
526
        cutscene_npc_walk(1166, -40, obj_axis_npc.y, 3, "x", "left")
527
        break
528
    case 60:
529
        cutscene_wait(0.5)
530
        break
531
    case 61:
532
        with (obj_steamworks_21_locker)
533
            waiter = 3
534
        global.sworks_flag[12] = 2
535
        instance_destroy(obj_axis_npc)
536
        cutscene_end()
537
        break
538
}
539
540
if (ceroba_is_running == true)
541
{
542
    with (obj_ceroba_npc)
543
    {
544
        image_speed = (1/3)
545
        if (direction == 0)
546
            sprite_index = spr_ceroba_right_run
547
        else if (direction == 90)
548
            sprite_index = spr_ceroba_up_run
549
        else if (direction == 180)
550
            sprite_index = spr_ceroba_left_run
551
        else if (direction == 270)
552
            sprite_index = spr_ceroba_down_run
553
        if (path_position >= 1)
554
        {
555
            action_sprite = false
556
            npc_direction = "up"
557
            other.ceroba_is_running = false
558
        }
559
    }
560
}
561
if (axis_is_running == true)
562
{
563
    with (obj_axis_npc)
564
    {
565
        if (path_position < 1)
566
        {
567
            image_speed = (1/3)
568
            if (direction == 0)
569
                sprite_index = spr_axis_right
570
            else if (direction == 90)
571
                sprite_index = spr_axis_up
572
            else if (direction == 180)
573
                sprite_index = spr_axis_left
574
            else if (direction == 270)
575
                sprite_index = spr_axis_down
576
            var player_is_caught = false
577
            other.checkpoint_x = path_get_point_x(pt_steamworks_21_axis_chase, other.check_point_current)
578
            other.checkpoint_y = path_get_point_y(pt_steamworks_21_axis_chase, other.check_point_current)
579
            other.checkpoint_x_axis = path_get_point_x(pt_steamworks_21_axis_chase, other.check_point_current_axis)
580
            other.checkpoint_y_axis = path_get_point_y(pt_steamworks_21_axis_chase, other.check_point_current_axis)
581
            var distance_axis = point_distance(obj_axis_npc.x, obj_axis_npc.y, other.checkpoint_x, other.checkpoint_y)
582
            var distance_pl = point_distance(obj_pl.x, obj_pl.y, other.checkpoint_x, other.checkpoint_y)
583
            if (distance_pl <= 60)
584
            {
585
                if (other.check_point_current < path_get_number(pt_steamworks_21_axis_chase))
586
                    other.check_point_current += 1
587
            }
588
            if (point_distance(obj_axis_npc.x, obj_axis_npc.y, other.checkpoint_x_axis, other.checkpoint_y_axis) < 60)
589
            {
590
                if (other.check_point_current_axis < path_get_number(pt_steamworks_21_axis_chase))
591
                    other.check_point_current_axis += 1
592
            }
593
            if (other.check_point_current == other.check_point_current_axis && distance_pl > distance_axis && other.check_point_current < path_get_number(pt_steamworks_21_axis_chase))
594
            {
595
                if (!other.alarm[0])
596
                    other.alarm[0] = room_speed / 4
597
            }
598
            if (distance_to_point(obj_pl.x, obj_pl.y) < 15)
599
            {
600
                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 }
(other.event_music, 300)
601
                player_is_caught = true
602
            }
603
            if (player_is_caught && other.scene < 13)
604
            {
605
                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 }
(other.event_music, 300)
606
                other.scene = 45
607
                global.sworks_flag[43] += 1
608
            }
609
        }
610
        else if (sprite_index != spr_axis_down_bonk && other.scene < 20)
611
        {
612
            path_position = 1
613
            audio_play_sound(snd_washpan_bonk, 1, 0)
614
            obj_axis_npc.sprite_index = spr_axis_down_bonk
615
            obj_axis_npc.image_speed = 1
616
            obj_axis_npc.image_index = 0
617
            audio_stop_sound(other.event_music)
618
            other.axis_is_running = false
619
        }
620
    }
621
}
622
if (scene >= 47 && obj_steamworks_21_locker.waiter == 0)
623
{
624
    with (obj_axis_npc)
625
    {
626
        if (distance_to_point(obj_pl.x, obj_pl.y) < 40)
627
        {
628
            action_sprite = false
629
            axis_is_running = false
630
            other.scene = 45
631
            global.sworks_flag[43] += 1
632
        }
633
    }
634
}
635
if instance_exists(obj_axis_npc)
636
{
637
    with (obj_axis_npc)
638
    {
639
        if (sprite_index == spr_axis_down_bonk && image_index >= (image_number - 1))
640
        {
641
            image_index = image_number - 1
642
            image_speed = 0
643
        }
644
    }
645
}