Deltarune (Chapter 4) 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
            skip_ready = true;
11
            global.typer = 41;
12
            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"
);
13
            w = instance_create(40, 160, obj_writer);
14
            w.depth = -10;
15
        }
16
        if (textimer == 220)
17
        {
18
            with (obj_writer)
19
                instance_destroy();
20
            global.msg[0] = stringsetloc(
It was
a LEGEND
of HOPE.
"It was&a LEGEND&of HOPE.", "obj_legend_slash_Draw_0_gml_21_0"
);
21
            w = instance_create(40, 160, obj_writer);
22
            w.depth = -10;
23
            global.msg[0] = stringsetloc(
It was
a LEGEND
of DREAMS.
"It was&a LEGEND&of DREAMS.", "obj_legend_slash_Draw_0_gml_24_0"
);
24
            w = instance_create(220, 160, obj_writer);
25
            w.depth = -10;
26
        }
27
        if (textimer == 340)
28
        {
29
            with (obj_writer)
30
                instance_destroy();
31
            global.msg[0] = stringsetloc(
It was
a LEGEND
of LIGHT.
"It was&a LEGEND&of LIGHT.", "obj_legend_slash_Draw_0_gml_32_0"
);
32
            w = instance_create(40, 160, obj_writer);
33
            w.depth = -10;
34
            global.msg[0] = stringsetloc(
It was
a LEGEND
of DARK.
"It was&a LEGEND&of DARK.", "obj_legend_slash_Draw_0_gml_35_0"
);
35
            w = instance_create(220, 160, obj_writer);
36
            w.depth = -10;
37
        }
38
        if (textimer == 460)
39
        {
40
            with (obj_writer)
41
                instance_destroy();
42
            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"
);
43
            w = instance_create(80, 160, obj_writer);
44
            w.depth = -10;
45
        }
46
        shader_set(shd_prophecy_legend);
47
        texture_set_stage(u_texture, texture_prophecy);
48
        shader_set_uniform_f(u_time, ((get_timer() / 1000000) * 30) / 4);
49
        draw_sprite(pic, 0, 60, 48 + yoff);
50
        shader_reset();
51
        draw_sprite_ext(pic, 0, 60, 48 + yoff, 1, 1, 0, c_white, prophecy_alpha);
52
        ytimer += 1;
53
        if (ytimer >= 4 && yoff > -260)
54
        {
55
            ytimer = 0;
56
            yoff -= 2;
57
            prophecy_alpha -= 0.016666666666666666;
58
        }
59
        if (yoff <= -260)
60
        {
61
            contimer += 1;
62
            if (contimer == 40)
63
            {
64
            }
65
            if (contimer == 100)
66
            {
67
                con = 2;
68
                contimer = 0;
69
                chunkfade = 1;
70
            }
71
        }
72
    }
73
    if (con == 2)
74
    {
75
        shader_set(shd_prophecy_legend);
76
        texture_set_stage(u_texture, texture_prophecy);
77
        shader_set_uniform_f(u_time, ((get_timer() / 1000000) * 30) / 4);
78
        draw_sprite(pic, 0, 60, 48 + yoff);
79
        w.textalpha = 1 - alph;
80
        shader_reset();
81
        contimer += 1;
82
        if (contimer >= 120)
83
        {
84
            snd_free_all();
85
            room_goto(PLACE_LOGO );
86
        }
87
    }
88
    if (border == 1)
89
    {
90
        draw_set_color(c_black);
91
        ossafe_fill_rectangle(-10, -10, 330, 27, false);
92
        ossafe_fill_rectangle(-10, -10, 59, 300, false);
93
        ossafe_fill_rectangle(400, -10, 260, 300, false);
94
        ossafe_fill_rectangle(-10, 400, 330, 138, false);
95
    }
96
    if (chunkfade == 0 && chunkamt > 0)
97
        chunkamt -= fadespeed;
98
    if (chunkfade == 1 && chunkamt < 1)
99
        chunkamt += fadespeed;
100
    draw_set_color(fadecolor);
101
    alph = 0;
102
    if (chunkamt >= 0.25)
103
        alph = 0.25;
104
    if (chunkamt >= 0.5)
105
        alph = 0.5;
106
    if (chunkamt >= 0.75)
107
        alph = 0.75;
108
    if (chunkamt >= 1)
109
        alph = 1;
110
    draw_set_alpha(alph);
111
    ossafe_fill_rectangle(-10, -10, 500, 500, false);
112
}
113
draw_set_alpha(1);
114
if (ingame == 0)
115
{
116
    if (!variable_instance_exists(id, "presscount"))
117
        presscount = 0;
118
    if (button1_p())
119
        presscount++;
120
    if (!skipped)
121
    {
122
        if ((button1_p() && textimer > 30) || presscount >= 2)
123
        {
124
            skipped = 1;
125
            skiptimer = 0;
126
            f = instance_create(0, 0, obj_fadeout);
127
            f.fadespeed = 0.08;
128
            mus_volume(global.currentsong[1], 0, 15);
129
        }
130
    }
131
    if (skipped == 1)
132
        skiptimer += 1;
133
    if (skiptimer == 19)
134
    {
135
        snd_free(global.currentsong[0]);
136
        global.flag[6 disable_text_skip] = 0;
137
    }
138
    if (skiptimer == 20)
139
        room_goto(PLACE_LOGO );
140
}