Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_castle_throne_room_controller_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
switch scene
4
{
5
    case 0:
6
        cutscene_instance_create(64, 288, obj_asgore_npc)
7
        obj_asgore_npc.npc_direction = "left"
8
        break
9
    case 1:
10
        if (obj_pl.y < 520)
11
        {
12
            cutscene_instance_create(obj_pl.x, obj_pl.y, obj_player_npc)
13
            obj_player_npc.npc_direction = "up"
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
        }
16
        break
17
    case 2:
18
        cutscene_npc_walk(1168, 160, 420, 3, "y", "up")
19
        break
20
    case 3:
21
        cutscene_wait(0.5)
22
        break
23
    case 4:
24
        cutscene_camera_move(obj_pl.x, 330, 2)
25
        break
26
    case 5:
27
        cutscene_wait(1)
28
        break
29
    case 6:
30
        cutscene_dialogue()
31
        with (msg)
32
        {
33
            message[0] = "* . . ."
34
            message[1] = "* The Underground is full#  of beauty."
35
            message[2] = "* Friends... Families..."
36
            message[3] = "* Hopes... Dreams..."
37
            message[4] = "* Or at least... it was."
38
            prt[0] = 3090
39
            prt[1] = 3090
40
            prt[2] = 3090
41
            prt[3] = 3597
42
            prt[4] = 3557
43
            talker[0] = 959
44
            position = 0
45
        }
46
        break
47
    case 7:
48
        cutscene_wait(1)
49
        break
50
    case 8:
51
        cutscene_npc_walk(959, 160, 288, 1, "x", "right")
52
        break
53
    case 9:
54
        cutscene_wait(0.25)
55
        break
56
    case 10:
57
        cutscene_npc_direction(obj_asgore_npc, "down")
58
        break
59
    case 11:
60
        cutscene_wait(1)
61
        break
62
    case 12:
63
        cutscene_dialogue()
64
        with (msg)
65
        {
66
            message[0] = "* . . ."
67
            message[1] = "* Though valiantly they#  fought..."
68
            message[2] = "* Nobody could stop you,#  could they?"
69
            prt[0] = 3557
70
            prt[1] = 3597
71
            prt[2] = 3107
72
            talker[0] = 959
73
            position = 0
74
        }
75
        break
76
    case 13:
77
        cutscene_wait(1)
78
        break
79
    case 14:
80
        cutscene_dialogue()
81
        with (msg)
82
        {
83
            message[0] = "* I had hoped this day#  wouldn't come."
84
            message[1] = "* Retaliation was#  inevitable but..."
85
            message[2] = "* I believed we could#  handle it as we always#  have."
86
            prt[0] = 1923
87
            prt[1] = 3107
88
            prt[2] = 3090
89
            talker[0] = 959
90
            position = 0
91
        }
92
        break
93
    case 15:
94
        cutscene_npc_direction(obj_asgore_npc, "left")
95
        break
96
    case 16:
97
        cutscene_wait(1.5)
98
        break
99
    case 17:
100
        cutscene_dialogue()
101
        with (msg)
102
        {
103
            message[0] = "* My dear friends... "
104
            message[1] = "* I am sorry."
105
            prt[0] = 3090
106
            prt[1] = 3597
107
            talker[0] = 959
108
            position = 0
109
        }
110
        break
111
    case 18:
112
        cutscene_npc_direction(obj_asgore_npc, "down")
113
        break
114
    case 19:
115
        cutscene_dialogue()
116
        with (msg)
117
        {
118
            message[0] = "* I know why you are here#  but... I'm afraid it's#  too late."
119
            message[1] = "* Your goal is out of#  reach."
120
            message[2] = "* Monsterkind's plight is#  not something I take#  pride in..."
121
            message[3] = "* But it is a conflict#  not of our making."
122
            message[4] = "* ..."
123
            message[5] = "* One thing is certain,#  however."
124
            message[6] = "* Your violence has#  ensured this war never#  to end."
125
            message[7] = "* Many more, of both our#  kinds, will perish#  because of this day."
126
            message[8] = "* Such is the path you#  chose."
127
            prt[0] = 3107
128
            prt[1] = 3107
129
            prt[2] = 3090
130
            prt[3] = 3090
131
            prt[4] = 3557
132
            prt[5] = 3557
133
            prt[6] = 3597
134
            prt[7] = 3597
135
            prt[8] = 3557
136
            talker[0] = 959
137
            position = 0
138
        }
139
        break
140
    case 20:
141
        cutscene_npc_direction(obj_asgore_npc, "left")
142
        break
143
    case 21:
144
        if cutscene_wait(2)
145
            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, 800)
146
        break
147
    case 22:
148
        cutscene_dialogue()
149
        with (msg)
150
        {
151
            message[0] = "* But..."
152
            message[1] = "* Even if you chose#  differently..."
153
            message[2] = "* The unfortunate truth#  of the matter is..."
154
            prt[0] = 3090
155
            prt[1] = 3107
156
            prt[2] = 3090
157
            talker[0] = 959
158
            position = 0
159
        }
160
        break
161
    case 23:
162
        cutscene_npc_direction(obj_asgore_npc, "down")
163
        obj_asgore_npc.action_sprite = true
164
        obj_asgore_npc.sprite_index = spr_asgore_ready
165
        obj_asgore_npc.image_index = 0
166
        obj_asgore_npc.image_speed = 0
167
        break
168
    case 24:
169
        cutscene_dialogue()
170
        with (msg)
171
        {
172
            message[0] = "* Your fate was sealed#  the moment you entered#  my kingdom."
173
            prt[0] = 1703
174
            talker[0] = 959
175
            position = 0
176
        }
177
        break
178
    case 25:
179
        cutscene_wait(0.5)
180
        break
181
    case 26:
182
        cutscene_npc_action_sprite(959, 3197, 1, true, 0, 658, 6)
183
        obj_asgore_npc.image_speed = 1
184
        darken_target = 0.6
185
        break
186
    case 27:
187
        cutscene_dialogue()
188
        with (msg)
189
        {
190
            message[0] = "* We will rebuild."
191
            message[1] = "* And with the help of#  your SOUL, we will be#  free."
192
            message[2] = "* Goodbye."
193
            prt[0] = 1703
194
            prt[1] = 1703
195
            prt[2] = 1703
196
            talker[0] = 959
197
            position = 0
198
        }
199
        break
200
    case 28:
201
        cutscene_camera_move(obj_pl.x, 360, 1)
202
        break
203
    case 29:
204
        if (obj_asgore_npc.sprite_index != spr_asgore_throw)
205
            cutscene_npc_action_sprite(959, 3615, 1, true, 0)
206
        if (obj_asgore_npc.image_index >= 12 && (!instance_exists(obj_asgore_trident)))
207
        {
208
            instance_create_depth((obj_asgore_npc.x + 20), (obj_asgore_npc.y - 4), -100, obj_asgore_trident)
209
            audio_play_sound(snd_undertale_swoosh, 1, 0)
210
            obj_asgore_trident.vspeed = 6
211
        }
212
        if (obj_player_npc.sprite_index != spr_clover_geno_summon)
213
            cutscene_npc_action_sprite(1168, 190, 1, true, 0)
214
        if (obj_player_npc.image_index >= 7)
215
            obj_player_npc.image_speed = 0
216
        if (instance_exists(obj_asgore_trident) && obj_asgore_trident.bbox_bottom >= (obj_player_npc.bbox_top - 12))
217
        {
218
            if (obj_asgore_trident.draw_overlay == false)
219
            {
220
                audio_play_sound(snd_hurt, 1, 0)
221
                obj_asgore_trident.draw_overlay = true
222
                obj_asgore_trident.vspeed = 0
223
            }
224
            if cutscene_wait(1)
225
            {
226
                var break_sound = audio_play_sound(snd_mirrorbreak1, 1, 0)
227
                audio_sound_pitch(break_sound, 0.8)
228
                audio_play_sound(snd_soul_gameover_hit_break, 1, 0)
229
                instance_destroy(obj_asgore_trident)
230
                for (var i = 200; i <= 340; i += 15.555555555555555)
231
                {
232
                    if (round(i) != 270)
233
                    {
234
                        var shard = instance_create_depth((obj_player_npc.x + 14), (obj_player_npc.y - 5), (obj_player_npc.depth - 1), obj_asgore_trident_shard)
235
                        shard.direction = i
236
                        shard.speed = 3
237
                    }
238
                }
239
            }
240
        }
241
        break
242
    case 30:
243
        obj_asgore_npc.sprite_index = spr_asgore_surprised
244
        obj_asgore_npc.image_index = 0
245
        cutscene_wait(3.5)
246
        break
247
    case 31:
248
        cutscene_dialogue()
249
        with (msg)
250
        {
251
            message[0] = "* !"
252
            prt[0] = 64
253
            talker[0] = 959
254
            position = 0
255
            skippable = false
256
        }
257
        cutscene_advance()
258
        break
259
    case 32:
260
        darken_target = 0.35
261
        if cutscene_wait(1)
262
            instance_destroy(obj_dialogue)
263
        break
264
    case 33:
265
        obj_player_npc.image_speed = 1
266
        cutscene_npc_action_sprite(1168, 190, 1, true, 0)
267
        charge_time = 110
268
        charge_time_max = 110
269
        is_charged = false
270
        charge_percentage = 1
271
        break
272
    case 34:
273
        charge_percentage = charge_time / charge_time_max
274
        if (!audio_is_playing(snd_chargeshot_charge))
275
        {
276
            charge_sound = audio_play_sound(snd_chargeshot_charge, 1, 1)
277
            audio_sound_gain(charge_sound, 0.8, 0)
278
            audio_sound_pitch(charge_sound, 0.5)
279
        }
280
        else
281
        {
282
            var pitch_original = audio_sound_get_pitch(charge_sound)
283
            if (pitch_original < 0.99)
284
                audio_sound_pitch(charge_sound, (1 - 0.5 * charge_percentage))
285
            else
286
                audio_sound_pitch(charge_sound, 1)
287
        }
288
        if (charge_time > 0)
289
            charge_time -= 1
290
        else if (!is_charged)
291
        {
292
            darken_target = 0.75
293
            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 } }
(6, 3)
294
            is_charged = true
295
            var ready_sound = audio_play_sound(snd_undertale_flash, 1, 0)
296
            audio_sound_gain(ready_sound, 0.5, 0)
297
            instance_create_depth(0, 0, -9999, obj_clover_flash)
298
            cutscene_advance()
299
        }
300
        break
301
    case 35:
302
        cutscene_wait(3)
303
        break
304
    case 36:
305
        audio_stop_sound(charge_sound)
306
        instance_create_depth(obj_pl.x, (obj_pl.y - 30), -9999, obj_castle_beam)
307
        obj_asgore_npc.sprite_index = spr_asgore_death
308
        obj_asgore_npc.image_speed = 0
309
        obj_asgore_npc.xstart = obj_asgore_npc.x
310
        obj_asgore_npc.ystart = obj_asgore_npc.y
311
        cutscene_advance()
312
        break
313
    case 37:
314
        if (!instance_exists(obj_castle_beam))
315
            cutscene_wait(1.5)
316
        break
317
    case 38:
318
        cutscene_npc_action_sprite(1168, 75, 1, false)
319
        break
320
    case 39:
321
        if cutscene_wait(2)
322
        {
323
        }
324
        break
325
    case 40:
326
        cutscene_camera_move(obj_player_npc.x, obj_asgore_soul.y, 1, false)
327
        break
328
    case 41:
329
        cutscene_npc_walk(1168, obj_player_npc.x, (obj_asgore_soul.y + 40), 1, "y", "up")
330
        break
331
    case 42:
332
        cutscene_wait(1.5)
333
        break
334
    case 43:
335
        obj_asgore_soul.scene += 1
336
        cutscene_advance()
337
        break
338
    case 44:
339
        if (!instance_exists(obj_asgore_soul))
340
            cutscene_advance()
341
        break
342
    case 45:
343
        if (!instance_exists(obj_asgore_soul))
344
            cutscene_wait(1.5)
345
        break
346
    case 46:
347
        if (obj_pl.y < 300)
348
            cutscene_camera_move(1168, 120, 1, true)
349
        cutscene_npc_walk(1168, 160, 120, 1, "x", "up")
350
        break
351
    case 47:
352
        cutscene_wait(1)
353
        break
354
    case 48:
355
        if instance_exists(obj_player_npc)
356
            instance_destroy(obj_player_npc)
357
        if cutscene_change_room(269, 160, 210, 0.03)
358
            obj_pl.image_alpha = 1
359
        break
360
}
361
362
if (abs(darken_target - darken_current) > 0.01)
363
    darken_current = lerp(darken_current, darken_target, 0.15)
364
else
365
    darken_current = darken_target