Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_room_controller_snowdin_13_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var rephil = obj_snowdin_13_rephil
4
var toast = obj_snowdin_13_toast
5
var swig = obj_snowdin_13_swig
6
var toast_col = make_color_rgb(119, 255, 198)
7
var swig_col = make_color_rgb(150, 173, 255)
8
var rephil_col = make_color_rgb(211, 231, 221)
9
if (global.snowdin_flag[8] == 0)
10
{
11
    switch scene
12
    {
13
        case 1:
14
            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 }
()
15
            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)
16
            timer = 10
17
            scene++
18
            break
19
        case 2:
20
            if (timer > 0)
21
                timer--
22
            else
23
            {
24
                with (rephil)
25
                {
26
                    image_speed = 0.25
27
                    if on_animation_end()
28
                    {
29
                        sprite_index = spr_rephil_overworld_yellow
30
                        image_speed = 0
31
                        other.timer = 45
32
                        other.scene += 1
33
                    }
34
                }
35
            }
36
            break
37
        case 3:
38
            if (timer > 0)
39
                timer--
40
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
41
            with (msg)
42
            {
43
                portrait = false
44
                talker[0] = rephil
45
                message[0] = "* Hey, watch it!"
46
                message[1] = "* Oh ho ho. Wouldya look at that."
47
                message[2] = "* I think this chump wants to#  pass."
48
                message[3] = string("* {0}! Toast! Come over here!", global.fun_swig_name)
49
            }
50
            if (global.dialogue_open == false)
51
            {
52
                timer = 30
53
                audio_play_sound(mus_occupied_turf_yellow, 1, 1)
54
                scene++
55
            }
56
            break
57
        case 4:
58
            with (rephil)
59
            {
60
                if (y > 200)
61
                    y -= 3
62
            }
63
            with (toast)
64
            {
65
                if (x > 190)
66
                    x -= 5
67
            }
68
            with (swig)
69
            {
70
                if (x < 130)
71
                    x += 5
72
            }
73
            if (timer > 0)
74
                timer--
75
            else
76
                scene++
77
            break
78
        case 5:
79
            with (toast)
80
            {
81
                path_start(pt_toast_jump_snowdin_13_yellow, 5, path_action_stop, false)
82
                audio_play_sound(snd_toast_jump, 1, 0)
83
            }
84
            scene++
85
            break
86
        case 6:
87
            with (toast)
88
            {
89
                if (path_position == 1)
90
                {
91
                    sprite_index = spr_toast_turn_overworld_yellow
92
                    image_speed = 0.5
93
                    other.timer = 15
94
                    other.scene++
95
                }
96
            }
97
            break
98
        case 7:
99
            if (timer > 0)
100
                timer--
101
            else
102
                scene++
103
            break
104
        case 8:
105
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
106
            with (msg)
107
            {
108
                message[0] = "* Yeah boss?"
109
                message[1] = "* What's up? You need a shave#  again?"
110
                message[2] = "* We got ourselves some fresh#  meat."
111
                message[3] = "* Ha! You ain't gettin' nowhere,#  small fry!"
112
                message[4] = "* Yeah! Not nowhere!"
113
                message[5] = "* Will you two put a lid on it?"
114
                message[6] = "* Ahm."
115
                message[7] = "* Anyway."
116
                message[8] = "* The name's Rephil."
117
                message[9] = "* I'm the boss of the#  world-renowned gang, The#  Shufflers."
118
                message[10] = "* We rule this town."
119
                message[11] = "* If you wanna pass, you're gonna#  have to go through us!"
120
                talker[0] = toast
121
                talker[1] = swig
122
                talker[2] = rephil
123
                talker[3] = swig
124
                talker[4] = toast
125
                talker[5] = rephil
126
            }
127
            if (global.dialogue_open == false)
128
                scene++
129
            break
130
        case 9:
131
            global.sound_carry_overworld = true
132
            global.battle_enemy_name = "shufflers"
133
            global.exclamation_mark_type = "nothing"
134
            global.battling_enemy = false
135
            global.battling_boss = true
136
            global.battle_start = true
137
            global.current_room_overworld = room_get_name(room)
138
            instance_create(obj_pl.x, obj_pl.y, obj_heart_initiate_battle)
139
            scene++
140
            break
141
    }
142
143
}
144
else if (global.snowdin_flag[8] == 1)
145
{
146
    switch scene
147
    {
148
        case 0:
149
            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, 0)
150
            if (timer < 0)
151
                timer--
152
            else
153
                scene++
154
            break
155
        case 1:
156
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
157
            with (msg)
158
            {
159
                portrait = false
160
                talker[0] = rephil
161
                message[0] = "* Geez."
162
                message[1] = "* We Shufflers prefer to settle#  things in a more dignified#  manner."
163
                message[2] = "* Ya catch my drift?"
164
                message[3] = "* We would like to propose a#  challenge."
165
                message[4] = "* A game of sorts."
166
            }
167
            scene++
168
            break
169
        case 2:
170
            if (!instance_exists(obj_dialogue))
171
            {
172
                obj_snowdin_13_ball.active = true
173
                audio_play_sound(snd_slide_whistle, 20, 0)
174
                scene++
175
            }
176
            break
177
        case 3:
178
            if (obj_snowdin_13_ball.ball_arrived == 1)
179
            {
180
                obj_snowdin_13_ball.ball_arrived = 0
181
                scene++
182
            }
183
            break
184
        case 4:
185
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
186
            with (msg)
187
            {
188
                portrait = false
189
                talker[0] = rephil
190
                message[0] = "* We'll take this ball 'ere, and#  hide it under one of us."
191
                message[1] = "* Next, we'll shuffle around."
192
                message[2] = "* When we finish, you'll have to#  guess who has the ball."
193
                message[3] = "* We'll do this three times in a#  row."
194
                message[4] = "* You win?"
195
                message[5] = "* You can pass."
196
                message[6] = "* You lose?"
197
                message[7] = "* We'll sit here blockin' ya for#  all eternity."
198
            }
199
            scene++
200
            break
201
        case 5:
202
            if (!instance_exists(obj_dialogue))
203
            {
204
                obj_snowdin_13_ball.active = 3
205
                audio_play_sound(snd_slide_whistle_reversed, 20, 0)
206
                scene++
207
            }
208
            break
209
        case 6:
210
            if (obj_snowdin_13_ball.ball_arrived == 1)
211
            {
212
                instance_destroy(obj_snowdin_13_ball)
213
                scene++
214
            }
215
            break
216
        case 7:
217
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
218
            with (msg)
219
            {
220
                portrait = false
221
                ch[1] = "Yes"
222
                ch[2] = "No"
223
                ch_msg = 0
224
                talker[0] = rephil
225
                message[0] = "* Ya pickin' up what I'm puttin'#  down?"
226
                message[1] = "* That makes things easy, then."
227
                message[2] = "* Here we go!"
228
                if (outcome == 1)
229
                {
230
                    talker[1] = rephil
231
                    message[1] = "* That makes things easy, then."
232
                    message[2] = "* Here we go!"
233
                    other.scene = 11
234
                }
235
                if (outcome == 2)
236
                {
237
                    instance_destroy()
238
                    global.dialogue_open = false
239
                    other.scene = 8
240
                }
241
            }
242
            break
243
        case 8:
244
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
245
            with (msg)
246
            {
247
                message[0] = "* No?"
248
                message[1] = "* Well ain't you just some#  unwanted coffee dregs."
249
                message[2] = "* Yeah, dregs."
250
                message[3] = "* Now, now. If ya don't get#  somethin', ya don't get it."
251
                message[4] = "* It ain't the kid's fault."
252
                message[5] = "* Tell ya what. Give that head of#  yours a nice break."
253
                message[6] = "* Mull over the rules. Make sure#  ya get 'em good an' proper."
254
                message[7] = "* Until then, the Shufflers'll be#  on path blockin' duty."
255
                message[8] = "* Ain't that right boys?"
256
                message[9] = "* Yeah boss. Duty!"
257
                talker[0] = rephil
258
                talker[1] = swig
259
                talker[2] = toast
260
                talker[3] = rephil
261
                talker[9] = toast
262
            }
263
            if (!global.dialogue_open)
264
                scene++
265
            break
266
        case 9:
267
            if (!instance_exists(obj_dialogue))
268
            {
269
                scr_audio_fade
scr_audio_fade

function scr_audio_fade(argument0, argument1) //gml_Script_scr_audio_fade { var snd = argument0 var fade_len = argument1 with (obj_radio) { audio_other_fade = true audio_to_fade = snd audio_fade_length = fade_len } }
(156, 1000)
270
                shufflers_turn_away = true
271
                if (timer > 0)
272
                    timer--
273
                else
274
                    scene++
275
            }
276
            break
277
        case 10:
278
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
279
            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) }
(1, 500)
280
            audio_stop_sound(mus_occupied_turf_yellow)
281
            global.snowdin_flag[8] = 2
282
            scene = 0
283
            break
284
        case 11:
285
            if (!instance_exists(obj_dialogue))
286
            {
287
                shufflers_puzzle = true
288
                timer = 0
289
                scene = 0
290
                global.snowdin_flag[8] = 3
291
            }
292
            break
293
    }
294
295
}
296
if ((global.snowdin_flag[8] == 2 || global.snowdin_flag[8] == 3) && (!failure))
297
{
298
    switch scene
299
    {
300
        case 1:
301
            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 }
()
302
            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)
303
            shufflers_turn = true
304
            scene++
305
            break
306
        case 2:
307
            with (rephil)
308
            {
309
                if on_animation_end()
310
                {
311
                    sprite_index = spr_rephil_overworld_yellow
312
                    image_speed = 0
313
                    other.scene += 1
314
                }
315
            }
316
            break
317
        case 3:
318
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
319
            with (msg)
320
            {
321
                if (global.snowdin_flag[8] == 2)
322
                {
323
                    portrait = false
324
                    ch[1] = "Yes"
325
                    ch[2] = "No"
326
                    ch_msg = 2
327
                    talker[0] = rephil
328
                    message[0] = "* 'Ey, look who's back!"
329
                    message[1] = "* That's the type of stand-up kid#  I like to see."
330
                    message[2] = "* You ready to play?"
331
                    if (outcome == 1)
332
                    {
333
                        color_noloop = false
334
                        message[3] = "* That makes things easy, then."
335
                        message[4] = "* Here we go!"
336
                        other.scene = 6
337
                    }
338
                    if (outcome == 2)
339
                    {
340
                        color_noloop = false
341
                        message[3] = "* Fine then."
342
                        timer = 45
343
                        other.scene = 4
344
                    }
345
                }
346
                else
347
                {
348
                    portrait = false
349
                    talker[0] = rephil
350
                    message[0] = "* Think you can pass this time?#  Let's find out!"
351
                    other.scene = 6
352
                }
353
            }
354
            break
355
        case 4:
356
            if (!instance_exists(obj_dialogue))
357
            {
358
                scr_audio_fade
scr_audio_fade

function scr_audio_fade(argument0, argument1) //gml_Script_scr_audio_fade { var snd = argument0 var fade_len = argument1 with (obj_radio) { audio_other_fade = true audio_to_fade = snd audio_fade_length = fade_len } }
(156, 1000)
359
                shufflers_turn_away = true
360
                if (timer > 0)
361
                    timer--
362
                else
363
                    scene++
364
            }
365
            break
366
        case 5:
367
            audio_stop_sound(mus_occupied_turf_yellow)
368
            with (obj_radio)
369
                audio_sound_gain(bgm, 1, 500)
370
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
371
            break
372
        case 6:
373
            if (!instance_exists(obj_dialogue))
374
            {
375
                shufflers_puzzle = true
376
                global.snowdin_flag[8] = 3
377
                timer = 0
378
                scene = 0
379
            }
380
            break
381
    }
382
383
}
384
if (shufflers_puzzle == true)
385
    cts_shufflers_puzzle()
386
if (failure && (!shufflers_puzzle))
387
{
388
    if (shufflers_failsafe < 6)
389
    {
390
        if (scene == 0)
391
        {
392
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
393
            with (msg)
394
            {
395
                talker[0] = rephil
396
                message[0] = "* Well, ain't that a pity."
397
                message[1] = "* Why don't you take a while an'#  come back when you're ready to#  try again?"
398
                message[2] = "* Take some time to practice by#  yourself if ya can."
399
                message[3] = "* Maybe then you'll be a bit more#  of a challenge."
400
                message[4] = "* Until then, we ain't movin'.#  Right boys?"
401
                message[5] = "* Yeah boss, we'll stay right#  'ere."
402
                talker[5] = swig
403
                message[6] = "* Yeah. We ain't got anywhere#  better to go."
404
                talker[6] = toast
405
            }
406
            if (global.dialogue_open == false)
407
            {
408
                shufflers_turn_away = true
409
                timer = 60
410
                scene++
411
            }
412
        }
413
        if (scene == 1)
414
        {
415
            if (timer > 0)
416
                timer--
417
            else
418
            {
419
                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) }
(1, 500)
420
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
421
                failure = false
422
                scene = 0
423
            }
424
        }
425
    }
426
    else
427
    {
428
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
429
        with (msg)
430
        {
431
            talker[0] = rephil
432
            message[0] = "* Uhh, hey there, kid."
433
            message[1] = "* We've been at this a while, ya#  know?"
434
            message[2] = "* Ain't you gettin' tired of this?"
435
            message[3] = "* Even we're gettin' pretty tired."
436
            message[4] = "* We don't usually have this much#  exercise."
437
            message[5] = "* See, we don't get many#  customers tryin' to come#  through."
438
            message[6] = "* They must have heard how#  intimidatin' we can be, right#  boys?"
439
            talker[7] = swig
440
            message[7] = "* Yeah, boss!"
441
            message[8] = "* Ain't nobody messin' with us!"
442
            talker[9] = toast
443
            message[9] = "* Yeah, boss!"
444
            message[10] = "* Mess!"
445
            talker[11] = rephil
446
            message[11] = "* Tell ya what, kid."
447
            message[12] = "* Challengin' us again an' again,"
448
            message[13] = "* Failin' over an' over,"
449
            message[14] = "* 'Specially when you're so#  clearly outmatched,"
450
            message[15] = "* Takes a lot outta ya."
451
            message[16] = "* You gotta have a ton of#  perseverance to pull that off."
452
            message[17] = "* That, or you're one of the#  stupidest monsters I ever met."
453
            message[18] = "* Either way, I think you've#  earned your way through."
454
            message[19] = "* Come on, boys."
455
        }
456
        if (global.dialogue_open == false)
457
        {
458
            global.snowdin_flag[8] = 4
459
            failure = false
460
            scene = 1
461
        }
462
    }
463
}
464
if (global.snowdin_flag[8] == 4)
465
{
466
    switch scene
467
    {
468
        case 0:
469
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
470
            with (msg)
471
            {
472
                message[0] = "* Boss, I think the little punk#  beat us."
473
                message[1] = "* That must've been a lucky#  guess!"
474
                message[2] = "* There's no way a glass of#  spoiled milk like you could#  beat us!"
475
                message[3] = "* Now, now, Toast. Let's simmer#  down."
476
                message[4] = "* There ain't nothing to get#  heated over."
477
                message[5] = "* The kid beat us fair n' square."
478
                message[6] = "* The Shufflers ain't nothing if#  not true to their word."
479
                message[7] = "* Ain't that right?"
480
                message[8] = "* Yeah boss, a Shuffler always#  keeps their word."
481
                message[9] = "* Yeah, always."
482
                message[10] = "* Now, kid, we'll let you pass on#  through."
483
                message[11] = "* You've earned ya self a#  powerful friend in the#  Shufflers today."
484
                message[12] = "* All ya gotta do is remember the#  name,"
485
                message[13] = "* An' we'll be on ya side if ya#  ever need us."
486
                message[14] = "* The Shufflers always protect a#  friend, right boys?"
487
                message[15] = "* Yeah, you got a problem, we can#  handle it."
488
                message[16] = "* Yeah, handle."
489
                talker[0] = toast
490
                talker[1] = swig
491
                talker[3] = rephil
492
                talker[8] = swig
493
                talker[9] = toast
494
                talker[10] = rephil
495
                talker[15] = swig
496
                talker[16] = toast
497
            }
498
            if (global.dialogue_open == false)
499
                scene++
500
            break
501
        case 1:
502
            if instance_exists(obj_dialogue)
503
                break
504
            else
505
            {
506
                scr_audio_fade
scr_audio_fade

function scr_audio_fade(argument0, argument1) //gml_Script_scr_audio_fade { var snd = argument0 var fade_len = argument1 with (obj_radio) { audio_other_fade = true audio_to_fade = snd audio_fade_length = fade_len } }
(156, 500)
507
                with (rephil)
508
                {
509
                    if (y > 170)
510
                        y -= 1.5
511
                    else if (x > 120)
512
                        x -= 1.5
513
                    else
514
                    {
515
                        other.scene++
516
                        other.timer = 15
517
                    }
518
                }
519
                with (toast)
520
                {
521
                    if (x < 200)
522
                        x += 1
523
                }
524
                with (swig)
525
                {
526
                    if (x > 120)
527
                        x -= 1
528
                }
529
                break
530
            }
531
        case 2:
532
            if (timer > 0)
533
                timer--
534
            else
535
            {
536
                global.snowdin_flag[8] = 5
537
                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) }
(1, 500)
538
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
539
                scene = 0
540
            }
541
            break
542
    }
543
544
}
545
if shufflers_turn_away
546
{
547
    shufflers_turn_away = false
548
    with (rephil)
549
    {
550
        sprite_index = spr_rephil_turn_away
551
        image_speed = 0.2
552
    }
553
    with (swig)
554
    {
555
        sprite_index = spr_swig_turn_away
556
        image_speed = 0.2
557
    }
558
    with (toast)
559
    {
560
        sprite_index = spr_toast_turn_away
561
        image_speed = 0.2
562
    }
563
}
564
if shufflers_turn
565
{
566
    shufflers_turn = false
567
    with (rephil)
568
    {
569
        sprite_index = spr_rephil_turn_overworld_yellow
570
        image_index = 0
571
        image_speed = 0.2
572
    }
573
    with (swig)
574
    {
575
        sprite_index = spr_swig_turn_overworld_yellow
576
        image_index = 0
577
        image_speed = 0.2
578
    }
579
    with (toast)
580
    {
581
        sprite_index = spr_toast_turn_overworld_yellow
582
        image_index = 0
583
        image_speed = 0.2
584
    }
585
}
586
if instance_exists(obj_dialogue)
587
{
588
    with (obj_dialogue)
589
    {
590
        if (!(variable_instance_exists(id, "color_noloop")))
591
            color_noloop = false
592
        color = true
593
        col_modif[0] = toast_col
594
        col_modif[1] = swig_col
595
        col_modif[2] = rephil_col
596
        var new_col = 2
597
        if (!color_noloop)
598
        {
599
            for (var i = 0; i < array_length(message); i++)
600
            {
601
                if is_array(talker)
602
                {
603
                    var talker_current = talker[clamp(i, 0, (array_length(talker) - 1))]
604
                    if (talker_current != -4 || other.shufflers_puzzle == true)
605
                    {
606
                        if (talker_current == rephil || other.shufflers_puzzle == true)
607
                            new_col = 2
608
                        if (talker_current == swig)
609
                            new_col = 1
610
                        if (talker_current == toast)
611
                            new_col = 0
612
                        message_col[i][0] = ""
613
                        message_col[i][1] = ""
614
                        message_col[i][2] = ""
615
                        message_col[i][new_col] = message[i]
616
                    }
617
                }
618
            }
619
            color_noloop = true
620
        }
621
    }
622
}