Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_puzzlecloset_manager_Draw_0

(view raw script w/o annotations or w/e)
1
if (room == room_dw_puzzlecloset_1)
2
{
3
    if (!surface_exists(surf1))
4
        surf1 = surface_create(vwid, vhei);
5
    if (!surface_exists(surf2))
6
        surf2 = surface_create(vwid, vhei);
7
    if (!surface_exists(surf3))
8
        surf3 = surface_create(vwid, vhei);
9
    if (!surface_exists(surf1b))
10
        surf1b = surface_create(vwid, vhei);
11
    if (!surface_exists(surf2b))
12
        surf2b = surface_create(vwid, vhei);
13
    if (!surface_exists(surf3b))
14
        surf3b = surface_create(vwid, vhei);
15
    if (view_get_surface_id(1) != surf1)
16
        view_set_surface_id(1, surf1);
17
    if (view_get_surface_id(2) != surf2)
18
        view_set_surface_id(2, surf2);
19
    if (view_get_surface_id(3) != surf3)
20
        view_set_surface_id(3, surf3);
21
    surface_copy(surf1b, 0, 0, surf1);
22
    surface_copy(surf2b, 0, 0, surf2);
23
    surface_copy(surf3b, 0, 0, surf3);
24
    var yloc = 96;
25
    var xloc = 384;
26
    var xspace = 176;
27
    if (crtinit == 0)
28
    {
29
        crtinit = 1;
30
        for (var i = 0; i < 3; i++)
31
        {
32
            with (instance_create(xloc + (xspace * i), yloc, obj_board_screen))
33
                screenheight = 160;
34
        }
35
        with (obj_board_screen)
36
            depth = other.depth - 1;
37
    }
38
    if (shuffle == 0)
39
    {
40
        if (surface_exists(surf1b))
41
            draw_surface(surf1b, xloc + (xspace * 1), yloc);
42
        if (surface_exists(surf2b))
43
            draw_surface(surf2b, xloc + (xspace * 0), yloc);
44
        if (surface_exists(surf3b))
45
            draw_surface(surf3b, xloc + (xspace * 2), yloc);
46
    }
47
    else
48
    {
49
        if (surface_exists(surf2b))
50
            draw_surface(surf2b, xloc + (xspace * 1), yloc);
51
        if (surface_exists(surf1b))
52
            draw_surface(surf1b, xloc + (xspace * 0), yloc);
53
        if (surface_exists(surf3b))
54
            draw_surface(surf3b, xloc + (xspace * 2), yloc);
55
    }
56
}
57
if (room == room_dw_puzzlecloset_2)
58
{
59
    if (!surface_exists(surf1))
60
        surf1 = surface_create(vwid, vhei);
61
    if (!surface_exists(surf1b))
62
        surf1b = surface_create(vwid, vhei);
63
    if (view_get_surface_id(1) != surf1)
64
        view_set_surface_id(1, surf1);
65
    surface_copy(surf1b, 0, 0, surf1);
66
    if (!surface_exists(surf2))
67
        surf2 = surface_create(vwid, vhei);
68
    if (!surface_exists(surf2b))
69
        surf2b = surface_create(vwid, vhei);
70
    if (view_get_surface_id(2) != surf2)
71
        view_set_surface_id(2, surf2);
72
    surface_copy(surf2b, 0, 0, surf2);
73
    if (!surface_exists(surf3))
74
        surf3 = surface_create(vwid, vhei);
75
    if (!surface_exists(surf3b))
76
        surf3b = surface_create(vwid, vhei);
77
    if (view_get_surface_id(3) != surf3)
78
        view_set_surface_id(3, surf3);
79
    surface_copy(surf3b, 0, 0, surf3);
80
    if (!surface_exists(surf4))
81
        surf4 = surface_create(vwid, vhei);
82
    if (!surface_exists(surf4b))
83
        surf4b = surface_create(vwid, vhei);
84
    if (view_get_surface_id(4) != surf4)
85
        view_set_surface_id(4, surf4);
86
    surface_copy(surf4b, 0, 0, surf4);
87
    if (!surface_exists(surf5))
88
        surf5 = surface_create(vwid, vhei);
89
    if (!surface_exists(surf5b))
90
        surf5b = surface_create(vwid, vhei);
91
    if (view_get_surface_id(5) != surf5)
92
        view_set_surface_id(5, surf5);
93
    surface_copy(surf5b, 0, 0, surf5);
94
    if (!surface_exists(surf6))
95
        surf6 = surface_create(vwid, vhei);
96
    if (!surface_exists(surf6b))
97
        surf6b = surface_create(vwid, vhei);
98
    if (view_get_surface_id(6) != surf6)
99
        view_set_surface_id(6, surf6);
100
    surface_copy(surf6b, 0, 0, surf6);
101
    var xloc = 448;
102
    var yloc = 32;
103
    var xspace = 192;
104
    var yspace = 160;
105
    if (crtinit == 0)
106
    {
107
        crtinit = 1;
108
        for (var i = 0; i < 3; i++)
109
        {
110
            instance_create(xloc + (xspace * i), yloc, obj_board_screen);
111
            instance_create(xloc + (xspace * i), yloc + yspace, obj_board_screen);
112
        }
113
        with (obj_board_screen)
114
            screenwidth = 160;
115
        with (obj_board_screen)
116
            depth = other.depth - 1;
117
    }
118
    if (shuffle == 0)
119
    {
120
        if (surface_exists(surf1b))
121
            draw_surface(surf1b, xloc + (xspace * 0), yloc + (yspace * 0));
122
        if (surface_exists(surf2b))
123
            draw_surface(surf2b, xloc + (xspace * 1), yloc + (yspace * 0));
124
        if (surface_exists(surf3b))
125
            draw_surface(surf3b, xloc + (xspace * 2), yloc + (yspace * 0));
126
        if (surface_exists(surf4b))
127
            draw_surface(surf4b, xloc + (xspace * 0), yloc + (yspace * 1));
128
        if (surface_exists(surf5b))
129
            draw_surface(surf5b, xloc + (xspace * 1), yloc + (yspace * 1));
130
        if (surface_exists(surf6b))
131
            draw_surface(surf6b, xloc + (xspace * 2), yloc + (yspace * 1));
132
    }
133
    else
134
    {
135
        if (surface_exists(surf5b))
136
            draw_surface(surf5b, xloc + (xspace * 0), yloc + (yspace * 0));
137
        if (surface_exists(surf1b))
138
            draw_surface(surf1b, xloc + (xspace * 1), yloc + (yspace * 0));
139
        if (surface_exists(surf4b))
140
            draw_surface(surf4b, xloc + (xspace * 2), yloc + (yspace * 0));
141
        if (surface_exists(surf6b))
142
            draw_surface(surf6b, xloc + (xspace * 0), yloc + (yspace * 1));
143
        if (surface_exists(surf2b))
144
            draw_surface(surf2b, xloc + (xspace * 1), yloc + (yspace * 1));
145
        if (surface_exists(surf3b))
146
            draw_surface(surf3b, xloc + (xspace * 2), yloc + (yspace * 1));
147
    }
148
}
149
if (room == room_dw_puzzlecloset_3)
150
{
151
    if (!surface_exists(surf1))
152
        surf1 = surface_create(vwid, vhei);
153
    if (!surface_exists(surf1b))
154
        surf1b = surface_create(vwid, vhei);
155
    if (view_get_surface_id(1) != surf1)
156
        view_set_surface_id(1, surf1);
157
    surface_copy(surf1b, 0, 0, surf1);
158
    var xloc = 524;
159
    var yloc = 32;
160
    if (crtinit == 0)
161
    {
162
        crtinit = 1;
163
        instance_create(xloc, yloc, obj_board_screen);
164
        with (obj_board_screen)
165
        {
166
            screenwidth = 384;
167
            screenheight = 256;
168
            depth = other.depth - 1;
169
        }
170
    }
171
    if (surface_exists(surf1b))
172
        draw_surface(surf1b, xloc, yloc);
173
}
174
draw_set_color(c_white);