Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_mainchara_board_Draw_0

(view raw script w/o annotations or w/e)
1
if (init)
2
{
3
    if (visible && sleeping)
4
    {
5
        var _sleepnum = 0;
6
        if (name == "susie")
7
            _sleepnum = 1;
8
        if (name == "ralsei")
9
            _sleepnum = 2;
10
        var sleepmod = sin(sleepytimer / 4) * 2;
11
        draw_sprite_ext(spr_board_sleep, _sleepnum, x, 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
((y - 32) + sleepmod), 2, 2, 0, c_white, 1);
12
    }
13
    if (obj_board_controller.pathfind_debug)
14
    {
15
        if (is_moving == true)
16
            draw_path(path, x, y, true);
17
        if (name == "ralsei")
18
        {
19
            for (i = 0; i < 75; i += 1)
20
                draw_sprite_ext(spr_whitepixel, 0, remx[i], remy[i], 2, 2, 0, c_red, 1);
21
        }
22
    }
23
    var drawbefore = false;
24
    if (ribbon > 0)
25
    {
26
        if (facing == 0 || facing == 3)
27
            drawbefore = true;
28
        var btargx = x + 8;
29
        var btargy = y + 8;
30
        if (facing == 0)
31
        {
32
            btargx = x + 6;
33
            btargy = y - 8;
34
        }
35
        if (facing == 2)
36
        {
37
            btargx = x + 6;
38
            btargy = y;
39
        }
40
        if (facing == 1)
41
        {
42
            btargx = x - 4;
43
            btargy = y;
44
        }
45
        if (facing == 3)
46
        {
47
            btargx = x + 14;
48
            btargy = y;
49
        }
50
        if (name == "susie")
51
        {
52
            if (facing == 0)
53
            {
54
                btargx = (x + 6) - 4;
55
                btargy = y - 6;
56
            }
57
            if (facing == 2)
58
            {
59
                btargx = x + 6 + 2;
60
                btargy = y - 2;
61
            }
62
            if (facing == 1)
63
            {
64
                btargx = (x - 4) + 2;
65
                btargy = y;
66
            }
67
            if (facing == 3)
68
            {
69
                btargx = x + 14;
70
                btargy = y;
71
            }
72
        }
73
        bowx = btargx;
74
        bowy = btargy;
75
    }
76
    if (ribbon && drawbefore)
77
    {
78
        if (ribbon == 2)
79
        {
80
            if (facing == 0)
81
                draw_sprite_ext(spr_board_bow_small, 0, 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowx) + 4,
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowy) - 8, 2, 2, 0, image_blend, image_alpha);
82
            if (facing == 3)
83
                draw_sprite_ext(spr_board_bow_small, 0, 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowx) + 4,
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowy) - 6, 2, 2, 0, image_blend, image_alpha);
84
        }
85
        draw_sprite_ext(spr_board_bow_small, 0, 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowx),
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowy), 2, 2, 0, image_blend, image_alpha);
86
    }
87
    if (iframes > 0)
88
    {
89
        if ((iframes % 2) == 0)
90
        {
91
            if (image_blend == c_white)
92
                image_blend = c_red;
93
            else
94
                image_blend = c_white;
95
        }
96
    }
97
    else
98
    {
99
        image_blend = c_white;
100
    }
101
    if (image_blend == c_white)
102
    {
103
        if (boardgrid)
104
            draw_sprite_ext(sprite_index, image_index, round(x / 2) * 2, round(y / 2) * 2, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
105
        else
106
            draw_self();
107
    }
108
    if (ribbon > 0)
109
    {
110
        if (!drawbefore)
111
        {
112
            if (ribbon == 2)
113
            {
114
                if (facing == 1)
115
                    draw_sprite_ext(spr_board_bow_small, 0, 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowx) - 4,
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowy) - 6, 2, 2, 0, image_blend, image_alpha);
116
            }
117
            draw_sprite_ext(spr_board_bow_small, 0, 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowx),
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowy), 2, 2, 0, image_blend, image_alpha);
118
            if (ribbon == 2)
119
            {
120
                if (facing == 2)
121
                    draw_sprite_ext(spr_board_bow_small, 0, 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowx) - 4,
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(bowy) - 6, 2, 2, 0, image_blend, image_alpha);
122
            }
123
        }
124
    }
125
    if (button1_h() && 
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && controlled == 1 && name == "kris" && sword == false)
126
    {
127
        draw_set_color(c_red);
128
        draw_set_blend_mode(bm_add);
129
        if (facing == 1)
130
            ossafe_fill_rectangle(x + 16, y + 16 + 6, x + 16 + 32, (y + 32) - 2, true);
131
        if (facing == 3)
132
            ossafe_fill_rectangle(x + 16, y + 16 + 6, (x + 16) - 32, (y + 32) - 2, true);
133
        if (facing == 0)
134
            ossafe_fill_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, y + 16 + 28, true);
135
        if (facing == 2)
136
            ossafe_fill_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, (y + 16) - 28, true);
137
        draw_set_color(c_white);
138
        draw_set_blend_mode(bm_normal);
139
    }
140
    if (controlled == 1 && name == "susie" && button2_h())
141
    {
142
        var _dx = 0;
143
        var _dy = 0;
144
        var _dx2 = 0;
145
        var _dy2 = 0;
146
        if (facing == 1)
147
        {
148
            _dx = 16;
149
            _dx2 = 18;
150
            _dy2 = 16;
151
            _dy = -4;
152
        }
153
        if (facing == 3)
154
        {
155
            _dx = -48;
156
            _dx2 = 14;
157
            _dy2 = 16;
158
            _dy = -4;
159
        }
160
        if (facing == 0)
161
        {
162
            _dy = 16;
163
            _dy2 = 20;
164
            _dx = -8;
165
            _dx2 = 8;
166
        }
167
        if (facing == 2)
168
        {
169
            _dy = -20;
170
            _dy2 = -16;
171
            _dx = -8;
172
            _dx2 = 8;
173
        }
174
    }
175
    draw_set_color(c_white);
176
    draw_set_font(fnt_small);
177
    if (controlled)
178
    {
179
    }
180
    if (susierecordcon == 1)
181
        draw_text_outline(128, 64, name + " RECORDING", 255);
182
    if (graballpots_con == 3 && graballpots_timer > 1)
183
    {
184
    }
185
}
186
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
187
{
188
    var drawstoole = false;
189
    if (keyboard_check(ord("F")))
190
        drawstoole = true;
191
    if (drawstoole)
192
    {
193
        if (name == "ralsei")
194
        {
195
            stoolx = round(x / 32) * 32;
196
            stooly = round(y / 32) * 32;
197
            if (stooly < bbox_top)
198
                stooly += 32;
199
            if (stooly > bbox_bottom)
200
                stooly -= 32;
201
            draw_sprite_ext(spr_ralsei_board_stoolforme, 0, stoolx, stooly, 2, 2, 0, c_white, 0.5);
202
        }
203
    }
204
    var count = 0;
205
}