Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_transition_Step_0

(view raw script w/o annotations or w/e)
1
if (prefill == 1)
2
{
3
    for (i = 0; i < 24; i += 1)
4
    {
5
        for (j = 0; j < 16; j += 1)
6
            tile[i][j] = 1;
7
    }
8
    prefill = 0;
9
}
10
if (con == 0)
11
{
12
    timer = 0;
13
    con = 1;
14
}
15
if (type == 0)
16
{
17
    if (con == 1)
18
    {
19
        timer++;
20
        if (i_ex(obj_gameshow_swordroute))
21
        {
22
            var amt = merge_color(s_curcol, c_black, (tilescovered + 1) / 8);
23
            obj_gameshow_swordroute.screencolor = amt;
24
        }
25
        if (timer >= transitionspeed)
26
        {
27
            timer = 0;
28
            tilescovered += 1;
29
        }
30
        for (i = 0; i < 24; i += 1)
31
        {
32
            tile[i][tilescovered] = 1;
33
            tile[i][15 - tilescovered] = 1;
34
            tile[tilescovered][i] = 1;
35
            tile[23 - tilescovered][i] = 1;
36
        }
37
        if (tilescovered >= 8)
38
        {
39
            con = 2;
40
            timer = 0;
41
        }
42
    }
43
    if (con == 2)
44
    {
45
        timer += 1;
46
        if (timer == 1)
47
            triggered = 1;
48
        if (timer >= pausetime)
49
        {
50
            tilescovered = 8;
51
            timer = 0;
52
            con = 3;
53
        }
54
    }
55
    if (con == 3)
56
    {
57
        timer++;
58
        if (timer >= transitionspeed)
59
        {
60
            timer = 0;
61
            tilescovered -= 1;
62
        }
63
        for (i = 13; i >= (tilescovered * 2); i -= 1)
64
        {
65
            for (j = 7; j >= tilescovered; j -= 1)
66
            {
67
                tile[i][j] = 0;
68
                tile[i][15 - j] = 0;
69
                tile[23 - i][j] = 0;
70
                tile[23 - i][15 - j] = 0;
71
            }
72
        }
73
        if (tilescovered <= 0)
74
        {
75
            con = 4;
76
            timer = 0;
77
        }
78
        var amt = tilescovered / 8;
79
        if (i_ex(obj_gameshow_swordroute))
80
        {
81
            var mynewcolor = -4;
82
            with (obj_board_screenColorChanger)
83
            {
84
                if (distance_to_point(160, 96) < 32)
85
                {
86
                    mynewcolor = id;
87
                    init = 1;
88
                }
89
            }
90
            if (i_ex(mynewcolor))
91
                obj_gameshow_swordroute.screencolor = merge_color(mynewcolor.image_blend, c_black, amt);
92
        }
93
    }
94
    if (con == 4)
95
    {
96
        if (interactResetter == true)
97
            global.interact = 0;
98
        instance_destroy();
99
    }
100
}