Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_legend_Draw_0

(view raw script w/o annotations or w/e)
1
if (os_type == os_macosx)
2
    draw_screen = skiptimer < 19;
3
if (draw_screen)
4
{
5
    if (con == 1)
6
    {
7
        textimer += 1;
8
        if (textimer == 6)
9
        {
10
            global.typer = 41;
11
            global.msg[0] = stringsetloc(
Once upon a time, a LEGEND
was whispered among shadows.
"Once upon a time, a LEGEND&was whispered among shadows.", "obj_legend_slash_Draw_0_gml_13_0"
);
12
            w = instance_create(40, 160, obj_writer);
13
            w.depth = -10;
14
        }
15
        if (textimer == 220)
16
        {
17
            with (obj_writer)
18
                instance_destroy();
19
            global.msg[0] = stringsetloc(
It was
a LEGEND
of HOPE.
"It was&a LEGEND&of HOPE.", "obj_legend_slash_Draw_0_gml_21_0"
);
20
            w = instance_create(40, 160, obj_writer);
21
            w.depth = -10;
22
            global.msg[0] = stringsetloc(
It was
a LEGEND
of DREAMS.
"It was&a LEGEND&of DREAMS.", "obj_legend_slash_Draw_0_gml_24_0"
);
23
            w = instance_create(220, 160, obj_writer);
24
            w.depth = -10;
25
        }
26
        if (textimer == 340)
27
        {
28
            with (obj_writer)
29
                instance_destroy();
30
            global.msg[0] = stringsetloc(
It was
a LEGEND
of LIGHT.
"It was&a LEGEND&of LIGHT.", "obj_legend_slash_Draw_0_gml_32_0"
);
31
            w = instance_create(40, 160, obj_writer);
32
            w.depth = -10;
33
            global.msg[0] = stringsetloc(
It was
a LEGEND
of DARK.
"It was&a LEGEND&of DARK.", "obj_legend_slash_Draw_0_gml_35_0"
);
34
            w = instance_create(220, 160, obj_writer);
35
            w.depth = -10;
36
        }
37
        if (textimer == 460)
38
        {
39
            with (obj_writer)
40
                instance_destroy();
41
            global.msg[0] = stringsetloc(
This is the legend of
Delay 33 DELTA RUNE
"This is the legend of& ^3 DELTA RUNE", "obj_legend_slash_Draw_0_gml_43_0"
);
42
            w = instance_create(80, 160, obj_writer);
43
            w.depth = -10;
44
        }
45
        draw_sprite(pic, 0, 60, 48 + yoff);
46
        ytimer += 1;
47
        if (ytimer >= 4 && yoff > -260)
48
        {
49
            ytimer = 0;
50
            yoff -= 2;
51
        }
52
        if (yoff <= -260)
53
        {
54
            contimer += 1;
55
            if (subsubcon == 0)
56
            {
57
                var dopause = false;
58
                if (os_type == os_ps4 || os_type == os_ps5)
59
                {
60
                    var trackpos = audio_sound_get_track_position(global.currentsong[1]);
61
                    var beginSil = 17.934;
62
                    var endSil = 19.612;
63
                    if (trackpos >= beginSil && trackpos <= endSil)
64
                    {
65
                        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ }
(string("trackpos=" + string(trackpos)));
66
                        dopause = true;
67
                    }
68
                }
69
                else if (contimer >= 40)
70
                {
71
                    dopause = true;
72
                }
73
                if (dopause)
74
                {
75
                    subsubcon = 1;
76
                    with (obj_switchAsyncHelper)
77
                        docheck = false;
78
                    audio_pause_sound(global.currentsong[1]);
79
                }
80
            }
81
            if (contimer == 100)
82
            {
83
                con = 2;
84
                contimer = 0;
85
                chunkfade = 1;
86
                alarm[4]
 = 90;
gml_Object_obj_legend_Alarm_4.gml

con += 1;
87
            }
88
        }
89
    }
90
    if (con == 2)
91
    {
92
        audio_pause_sound(global.currentsong[1]);
93
        draw_sprite(pic, 0, 60, 48 + yoff);
94
        contimer += 1;
95
        if (contimer == 40)
96
        {
97
            with (obj_writer)
98
                instance_destroy();
99
        }
100
    }
101
    if (con == 3)
102
    {
103
        pic = spr_introimage1;
104
        audio_sound_set_track_position(global.currentsong[1], 19.656);
105
        audio_resume_sound(global.currentsong[1]);
106
        with (obj_switchAsyncHelper)
107
            docheck = true;
108
        con = 4;
109
        contimer = 0;
110
        chunkfade = 0;
111
        global.typer = 40;
112
        global.msg[0] = stringsetloc(
For millenia, LIGHT and DARK
have lived in balance,Delay 66Close Message
"For millenia, LIGHT and DARK&have lived in balance^6,%", "obj_legend_slash_Draw_0_gml_98_0"
);
113
        global.msg[1] = stringsetloc(
Bringing peace to the WORLD.
"Bringing peace to the WORLD.", "obj_legend_slash_Draw_0_gml_99_0"
);
114
        w = instance_create(40, 160, obj_writer);
115
    }
116
    if (con == 4)
117
    {
118
        draw_sprite(pic, 0, 60, 28);
119
        contimer += 1;
120
        if (contimer == 270)
121
        {
122
            with (obj_writer)
123
                instance_destroy();
124
            global.msg[0] = stringsetloc(
But if this harmony
were to shatter...
"But if this harmony&were to shatter...", "obj_legend_slash_Draw_0_gml_113_0"
);
125
            w = instance_create(70, 160, obj_writer);
126
        }
127
        if (contimer >= 276)
128
        {
129
            c_chunkamt = 0;
130
            contimer = 0;
131
            con = 5;
132
        }
133
    }
134
    if (con == 5)
135
    {
136
        if (contimer <= 200)
137
            draw_sprite(pic, 0, 60, 28);
138
        con_alph = 0;
139
        c_chunkamt += 0.05;
140
        if (c_chunkamt >= 0.25)
141
            con_alph = 0.25;
142
        if (c_chunkamt >= 0.5)
143
            con_alph = 0.5;
144
        if (c_chunkamt >= 0.75)
145
            con_alph = 0.75;
146
        if (c_chunkamt >= 1)
147
            con_alph = 1;
148
        if (contimer <= 200)
149
            draw_sprite_ext(pic, 1, 60, 28, 1, 1, 0, c_white, con_alph);
150
        contimer += 1;
151
        if (contimer == 120)
152
            chunkfade = 1;
153
        if (contimer == 130)
154
        {
155
            with (obj_writer)
156
                instance_destroy();
157
            global.msg[0] = stringsetloc(
A terrible calamity would occur.
"A terrible calamity would occur.", "obj_legend_slash_Draw_0_gml_151_0"
);
158
            w = instance_create(40, 80, obj_writer);
159
        }
160
        if (contimer == 210)
161
        {
162
            chunkfade = 0;
163
            fadespeed = 0.2;
164
        }
165
        if (contimer == 230)
166
        {
167
            chunkfade = 1;
168
            fadespeed = 0.03;
169
            fadecolor = c_white;
170
        }
171
        if (contimer == 275)
172
        {
173
            with (obj_writer)
174
                instance_destroy();
175
            global.msg[0] = stringsetloc(
The sky will run
black with terror
"The sky will run&black with terror", "obj_legend_slash_Draw_0_gml_170_0"
);
176
            w = instance_create(80, 185, obj_writer);
177
            fadespeed = 0.05;
178
            con = 6;
179
            chunkfade = 0;
180
            contimer = 0;
181
            border = 0;
182
            c_chunkamt = 0;
183
            pic = spr_introimage2;
184
        }
185
    }
186
    if (con == 6)
187
    {
188
        draw_sprite(pic, 0, 0, 0);
189
        con_alph = 0;
190
        if (contimer >= 276)
191
            c_chunkamt += 0.05;
192
        if (c_chunkamt >= 0.25)
193
            con_alph = 0.25;
194
        if (c_chunkamt >= 0.5)
195
            con_alph = 0.5;
196
        if (c_chunkamt >= 0.75)
197
            con_alph = 0.75;
198
        if (c_chunkamt >= 1)
199
            con_alph = 1;
200
        draw_sprite_ext(pic, 1, 0, 0, 1, 1, 0, c_white, con_alph);
201
        contimer += 1;
202
        if (contimer == 138)
203
        {
204
            with (obj_writer)
205
                instance_destroy();
206
            global.msg[0] = stringsetloc(
And the land will
crack with fear.
"And the land will&crack with fear.", "obj_legend_slash_Draw_0_gml_205_0"
);
207
            w = instance_create(80, 185, obj_writer);
208
        }
209
        if (contimer == 276)
210
        {
211
            with (obj_writer)
212
                instance_destroy();
213
            global.msg[0] = stringsetloc(
Then,Delay 11 her heart pounding...
"Then^1, her heart pounding...", "obj_legend_slash_Draw_0_gml_212_0"
);
214
            w = instance_create(60, 185, obj_writer);
215
        }
216
        if (contimer == 414)
217
        {
218
            with (obj_writer)
219
                instance_destroy();
220
            global.msg[0] = stringsetloc(
The EARTH will draw
her final breath.
"The EARTH will draw&her final breath.", "obj_legend_slash_Draw_0_gml_219_0"
);
221
            w = instance_create(80, 185, obj_writer);
222
        }
223
        if (contimer == 520)
224
        {
225
            fadespeed = 0.04;
226
            fadecolor = c_black;
227
            chunkfade = 1;
228
        }
229
        if (contimer == 551)
230
        {
231
            with (obj_writer)
232
                instance_destroy();
233
            global.msg[0] = stringsetloc(
Only then,Delay 11 shining with hope...
"Only then^1, shining with hope...", "obj_legend_slash_Draw_0_gml_233_0"
);
234
            w = instance_create(40, 185, obj_writer);
235
            contimer = 0;
236
            c_chunkamt = 0;
237
            chunkfade = 0;
238
            con = 7;
239
            c_chunkamt = 0;
240
            pic = spr_introimage3;
241
        }
242
    }
243
    if (con == 7)
244
    {
245
        draw_sprite(pic, 0, 0, 0);
246
        if (contimer == 138)
247
        {
248
            with (obj_writer)
249
                instance_destroy();
250
            global.msg[0] = stringsetloc(
Three HEROES appear
at WORLDS' edge.
"Three HEROES appear&at WORLDS' edge.", "obj_legend_slash_Draw_0_gml_253_0"
);
251
            w = instance_create(80, 185, obj_writer);
252
        }
253
        con_alph = 0;
254
        if (contimer >= 138)
255
            c_chunkamt += 0.05;
256
        if (c_chunkamt >= 0.25)
257
            con_alph = 0.25;
258
        if (c_chunkamt >= 0.5)
259
            con_alph = 0.5;
260
        if (c_chunkamt >= 0.75)
261
            con_alph = 0.75;
262
        if (c_chunkamt >= 1)
263
            con_alph = 1;
264
        draw_sprite_ext(pic, 1, 0, 0, 1, 1, 0, c_white, con_alph);
265
        contimer += 1;
266
        if (contimer == 246)
267
        {
268
            fadespeed = 0.04;
269
            fadecolor = c_black;
270
            chunkfade = 1;
271
        }
272
        if (contimer >= 277)
273
        {
274
            with (obj_writer)
275
                instance_destroy();
276
            contimer = 0;
277
            c_chunkamt = 0;
278
            chunkfade = 0;
279
            con = 8;
280
            c_chunkamt = 0;
281
            pic = spr_introimage4;
282
        }
283
    }
284
    if (con == 8)
285
    {
286
        draw_sprite(pic, 0, 0, 0);
287
        con_alph = 0;
288
        if (contimer == 4)
289
        {
290
            with (obj_writer)
291
                instance_destroy();
292
            global.msg[0] = stringsetloc(
A HUMAN,
"A HUMAN,", "obj_legend_slash_Draw_0_gml_301_0"
);
293
            w = instance_create(20, 185, obj_writer);
294
        }
295
        if (contimer == 69)
296
        {
297
            global.msg[0] = stringsetloc(
A MONSTER,
"A MONSTER,", "obj_legend_slash_Draw_0_gml_309_0"
);
298
            w = instance_create(110, 185, obj_writer);
299
        }
300
        if (contimer == 138)
301
        {
302
            global.msg[0] = stringsetloc(
And a PRINCE
FROM THE DARK.
"And a PRINCE&FROM THE DARK.", "obj_legend_slash_Draw_0_gml_317_0"
);
303
            w = instance_create(200, 185, obj_writer);
304
        }
305
        if (contimer >= 69 && contimer <= 138)
306
        {
307
            c_chunkamt += 0.05;
308
            if (c_chunkamt >= 0.25)
309
                con_alph = 0.25;
310
            if (c_chunkamt >= 0.5)
311
                con_alph = 0.5;
312
            if (c_chunkamt >= 0.75)
313
                con_alph = 0.75;
314
            if (c_chunkamt >= 1)
315
                con_alph = 1;
316
            if (c_chunkamt > 1)
317
                c_chunkamt = 1;
318
        }
319
        if (contimer >= 138)
320
        {
321
            con_alph = 1;
322
            c_chunkamt += 0.05;
323
            if (c_chunkamt >= 1.25)
324
                con_alph = 1.25;
325
            if (c_chunkamt >= 1.5)
326
                con_alph = 1.5;
327
            if (c_chunkamt >= 1.75)
328
                con_alph = 1.75;
329
            if (c_chunkamt >= 2)
330
                con_alph = 2;
331
        }
332
        draw_sprite_ext(pic, 1, 0, 0, 1, 1, 0, c_white, con_alph);
333
        draw_sprite_ext(pic, 2, 0, 0, 1, 1, 0, c_white, con_alph - 1);
334
        contimer += 1;
335
        if (contimer == 246)
336
        {
337
            fadespeed = 0.04;
338
            fadecolor = c_black;
339
            chunkfade = 1;
340
        }
341
        if (contimer >= 277)
342
        {
343
            with (obj_writer)
344
                instance_destroy();
345
            global.msg[0] = stringsetloc(
Only they can seal the fountains
"Only they can seal the fountains", "obj_legend_slash_Draw_0_gml_356_0"
);
346
            w = instance_create(40, 185, obj_writer);
347
            contimer = 0;
348
            c_chunkamt = 0;
349
            chunkfade = 0;
350
            con = 9;
351
            pic = spr_introimage5;
352
        }
353
    }
354
    if (con == 9)
355
    {
356
        draw_sprite(pic, 0, 0, 0);
357
        con_alph = 0;
358
        if (contimer >= 276)
359
            c_chunkamt += 0.05;
360
        if (c_chunkamt >= 0.25)
361
            con_alph = 0.25;
362
        if (c_chunkamt >= 0.5)
363
            con_alph = 0.5;
364
        if (c_chunkamt >= 0.75)
365
            con_alph = 0.75;
366
        if (c_chunkamt >= 1)
367
            con_alph = 1;
368
        draw_sprite_ext(pic, 1, 0, 0, 1, 1, 0, c_white, con_alph);
369
        contimer += 1;
370
        if (contimer == 138)
371
        {
372
            with (obj_writer)
373
                instance_destroy();
374
            global.msg[0] = stringsetloc(
And banish the ANGEL'S HEAVEN.
"And banish the ANGEL'S HEAVEN.", "obj_legend_slash_Draw_0_gml_387_0"
);
375
            w = instance_create(40, 185, obj_writer);
376
        }
377
        if (contimer == 276)
378
        {
379
            with (obj_writer)
380
                instance_destroy();
381
            global.msg[0] = stringsetloc(
Only then will balance
be restored,
"Only then will balance&be restored,", "obj_legend_slash_Draw_0_gml_394_0"
);
382
            w = instance_create(80, 185, obj_writer);
383
        }
384
        if (contimer == 414)
385
        {
386
            with (obj_writer)
387
                instance_destroy();
388
            global.msg[0] = stringsetloc(
And the WORLD saved
from destruction.
"And the WORLD saved&from destruction.", "obj_legend_slash_Draw_0_gml_401_0"
);
389
            w = instance_create(80, 185, obj_writer);
390
            fadespeed = 0.04;
391
            fadecolor = c_black;
392
            chunkfade = 1;
393
        }
394
        if (contimer >= 552)
395
        {
396
            xoff = 0;
397
            yoff = 0;
398
            fadespeed = 0.02;
399
            contimer = 0;
400
            c_chunkamt = 0;
401
            chunkfade = 0;
402
            con = 10;
403
            c_chunkamt = 0;
404
            pic = spr_introimage6;
405
            border = 1;
406
            ytimer = 0;
407
            xtimer = 0;
408
            with (obj_writer)
409
                instance_destroy();
410
            global.msg[0] = stringsetloc(
Today, the FOUNTAIN OF DARKNESS-
"Today, the FOUNTAIN OF DARKNESS-", "obj_legend_slash_Draw_0_gml_426_0"
);
411
            w = instance_create(40, 160, obj_writer);
412
        }
413
    }
414
    if (con == 10)
415
    {
416
        draw_sprite(pic, 0, 60 + xoff, 28 + yoff);
417
        ytimer += 1;
418
        if (ytimer >= 4 && yoff > -110)
419
        {
420
            ytimer = 0;
421
            yoff -= 2;
422
        }
423
        contimer += 1;
424
        if (contimer == 138)
425
        {
426
            with (obj_writer)
427
                instance_destroy();
428
            global.msg[0] = stringsetloc(
The geyser that
gives this land form-
"The geyser that&gives this land form-", "obj_legend_slash_Draw_0_gml_451_0"
);
429
            w = instance_create(80, 160, obj_writer);
430
        }
431
        if (contimer == 276)
432
        {
433
            with (obj_writer)
434
                instance_destroy();
435
            global.msg[0] = stringsetloc(
Stands tall at the
center of the kingdom.
"Stands tall at the&center of the kingdom.", "obj_legend_slash_Draw_0_gml_459_0"
);
436
            w = instance_create(80, 160, obj_writer);
437
        }
438
        if (contimer == 444)
439
        {
440
            with (obj_writer)
441
                instance_destroy();
442
            global.msg[0] = stringsetloc(
But recently, another fountain
has appeared on the horizon...
"But recently, another fountain&has appeared on the horizon...", "obj_legend_slash_Draw_0_gml_466_0"
);
443
            w = instance_create(40, 160, obj_writer);
444
        }
445
        if (contimer == 640)
446
        {
447
            with (obj_writer)
448
                instance_destroy();
449
            global.msg[0] = stringsetloc(
And with it,Delay 11 the balance of
LIGHT and DARK begins to shift...
"And with it^1, the balance of&LIGHT and DARK begins to shift...", "obj_legend_slash_Draw_0_gml_473_0"
);
450
            w = instance_create(40, 160, obj_writer);
451
        }
452
        if (contimer >= 444)
453
        {
454
            xtimer += 1;
455
            if (xoff > -60 && xtimer >= 4)
456
            {
457
                xtimer = 0;
458
                xoff -= 2;
459
            }
460
        }
461
        if (contimer == 760)
462
        {
463
            fadespeed = 0.02;
464
            chunkfade = 1;
465
        }
466
        if (contimer == 880 && skipped == 0)
467
        {
468
            snd_free(global.currentsong[0]);
469
            global.flag[6 disable_text_skip] = 0;
470
            f = instance_create(0, 0, obj_fadeout);
471
            f.fadespeed = 0.02;
472
        }
473
        if (contimer == 960 && skipped == 0)
474
        {
475
            if (global.plot == 20)
476
            {
477
                instance_create(0, 0, obj_persistentfadein);
478
                room_goto(room_castle_front);
479
            }
480
            else
481
            {
482
                room_goto(PLACE_LOGO );
483
            }
484
        }
485
    }
486
    if (border == 1)
487
    {
488
        draw_set_color(c_black);
489
        draw_rectangle(-10, -10, 330, 27, false);
490
        draw_rectangle(-10, -10, 59, 300, false);
491
        draw_rectangle(400, -10, 260, 300, false);
492
        draw_rectangle(-10, 400, 330, 138, false);
493
    }
494
    if (chunkfade == 0 && chunkamt > 0)
495
        chunkamt -= fadespeed;
496
    if (chunkfade == 1 && chunkamt < 1)
497
        chunkamt += fadespeed;
498
    draw_set_color(fadecolor);
499
    alph = 0;
500
    if (chunkamt >= 0.25)
501
        alph = 0.25;
502
    if (chunkamt >= 0.5)
503
        alph = 0.5;
504
    if (chunkamt >= 0.75)
505
        alph = 0.75;
506
    if (chunkamt >= 1)
507
        alph = 1;
508
    draw_set_alpha(alph);
509
    draw_rectangle(-10, -10, 330, 330, false);
510
}
511
draw_set_alpha(1);
512
if (ingame == 0)
513
{
514
    if (!variable_instance_exists(id, "presscount"))
515
        presscount = 0;
516
    if (button1_p())
517
        presscount++;
518
    if (!skipped)
519
    {
520
        if ((button1_p() && textimer > 30) || presscount >= 2)
521
        {
522
            skipped = 1;
523
            skiptimer = 0;
524
            f = instance_create(0, 0, obj_fadeout);
525
            f.fadespeed = 0.08;
526
            mus_volume(global.currentsong[1], 0, 15);
527
        }
528
    }
529
    if (skipped == 1)
530
        skiptimer += 1;
531
    if (skiptimer == 19)
532
    {
533
        snd_free(global.currentsong[0]);
534
        global.flag[6 disable_text_skip] = 0;
535
    }
536
    if (skiptimer == 20)
537
        room_goto(PLACE_LOGO );
538
}