Deltarune (Chapter 3) 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
                        dopause = true;
65
                }
66
                else if (contimer >= 40)
67
                {
68
                    dopause = true;
69
                }
70
                if (dopause)
71
                {
72
                    subsubcon = 1;
73
                    with (obj_switchAsyncHelper)
74
                        docheck = false;
75
                    audio_pause_sound(global.currentsong[1]);
76
                }
77
            }
78
            if (contimer >= 100)
79
            {
80
                con = 2;
81
                contimer = 0;
82
                chunkfade = 1;
83
                alarm[4]
 = 90;
gml_Object_obj_legend_Alarm_4.gml

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