Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_battleblcon_Draw_0

(view raw script w/o annotations or w/e)
1
draw_set_alpha(1);
2
if (type == 2 && i_ex(mywriter))
3
    mywriter.special = 5;
4
if (i_ex(mywriter))
5
{
6
    if (global.chapter == 5 && i_ex(obj_date_controller) && obj_date_controller.con == 0)
7
        depth = obj_date_controller.depth + 10;
8
    mywriter.depth = depth - 5;
9
    if (global.chapter == 5 && i_ex(obj_pink_enemy))
10
        mywriter.depth = depth - 1;
11
    if (remmsgno != obj_writer.msgno)
12
        reformatted = 0;
13
    if (auto_length == 0)
14
    {
15
        init = 1;
16
        reformatted = 1;
17
    }
18
    if (reformatted == 0)
19
    {
20
        if (mywriter.formatted == 0)
21
        {
22
            with (mywriter)
23
                event_user(5);
24
        }
25
        if (mywriter.formatted == 1)
26
        {
27
            if (init == 0)
28
            {
29
                initwritingx = mywriter.writingx;
30
                initwritingy = mywriter.writingy;
31
                init = 1;
32
            }
33
            writingx = mywriter.writingx;
34
            writingy = mywriter.writingy;
35
            stringmax = mywriter.stringmax;
36
            hspace = mywriter.hspace;
37
            vspace = mywriter.vspace;
38
            linecount = mywriter.linecount;
39
            balloonwidth = (stringmax * hspace) + 10;
40
            balloonheight = ((linecount + 1) * vspace) + 5;
41
            if (global.lang == "ja")
42
            {
43
                var checkstring = mywriter.mystring;
44
                var spacing = mywriter.hspace;
45
                var stringlength = string_length(checkstring);
46
                var newmaxlength = 0;
47
                var currentlength = 0;
48
                for (var ii = 1; ii < (stringlength + 1); ii += 1)
49
                {
50
                    var mychar = string_char_at(checkstring, ii);
51
                    if (mychar == "&" || mychar == "\n")
52
                    {
53
                        currentlength = 0;
54
                    }
55
                    else if (mychar == "^" || mychar == "*")
56
                    {
57
                        ii++;
58
                    }
59
                    else if (mychar == "\\")
60
                    {
61
                        ii += 2;
62
                    }
63
                    else if (mychar == "/" || mychar == "%")
64
                    {
65
                    }
66
                    else if (ord(mychar) < 256 || (ord(mychar) >= 65377 && ord(mychar) <= 65439))
67
                    {
68
                        currentlength += (spacing * 0.5);
69
                    }
70
                    else
71
                    {
72
                        currentlength += spacing;
73
                    }
74
                    if (currentlength >= newmaxlength)
75
                        newmaxlength = currentlength;
76
                }
77
                balloonwidth = newmaxlength + 10;
78
            }
79
            if (side == 1)
80
            {
81
                mywriter.writingx = initwritingx - (balloonwidth + 20);
82
                mywriter.writingy = initwritingy - (balloonheight / 2);
83
                writingx = initwritingx - (balloonwidth + 20);
84
                writingy = initwritingy - (balloonheight / 2);
85
            }
86
            if (side == -1)
87
            {
88
                xoffset = 20;
89
                mywriter.writingx = initwritingx;
90
                mywriter.writingy = initwritingy - (balloonheight / 2);
91
                writingx = initwritingx;
92
                writingy = initwritingy - (balloonheight / 2);
93
            }
94
            if (side == 2)
95
            {
96
                mywriter.writingx = initwritingx - (balloonwidth / 2);
97
                mywriter.writingy = initwritingy - (balloonheight + 20);
98
                writingx = initwritingx - (balloonwidth / 2);
99
                writingy = initwritingy - (balloonheight + 20);
100
            }
101
            if (side == 3 || side == 4)
102
            {
103
                mywriter.writingx = initwritingx - (balloonwidth / 2);
104
                mywriter.writingy = initwritingy;
105
                writingx = initwritingx - (balloonwidth / 2);
106
                writingy = initwritingy;
107
            }
108
        }
109
    }
110
    var __x = 0;
111
    if (global.chapter == 5 && i_ex(obj_pink_enemy) && obj_pink_enemy.idlesprite == spr_mew_pushing)
112
        __x = sin(obj_pink_enemy.siner * 1) * 5;
113
    var __y = 0;
114
    if (global.chapter == 5 && i_ex(obj_flowery_enemy) && sprite_index == spr_battleblcon_long && auto_length == 1 && side == -1)
115
    {
116
        __y = sin(obj_flowery_enemy.susieflower.sintimer * 0.1) * 6;
117
        if (global.typer == 74)
118
            __y = sin(obj_flowery_enemy.ralseiflower.sintimer * 0.1) * 6;
119
    }
120
    if (flowery_float == true)
121
        __y = sin(obj_flowery_enemy.float_siner * 0.33) * 5;
122
    if (flowery_aqua_float == true)
123
        __y = sin(obj_flowery_enemy.float_siner * 0.5) * 8;
124
    if (targetaqua != -4)
125
    {
126
        __x = targetaqua.x;
127
        __y = targetaqua.y;
128
    }
129
    if (auto_length == 0)
130
    {
131
        var _len = 110;
132
        if (dir > 0)
133
        {
134
            __x = lengthdir_x(_len * 0.25, dir);
135
            __y = lengthdir_y(_len, dir);
136
            dir += 6;
137
            with (mywriter)
138
                pinkballoonid = other.id;
139
            if (dir < 300)
140
            {
141
                x -= 2;
142
                extrax -= 2;
143
            }
144
        }
145
        if (shakecon == 1)
146
        {
147
            __x = -2 + irandom(4);
148
            __y = -2 + irandom(4);
149
            extrax = __x;
150
            extray = __y;
151
        }
152
        writingx = mywriter.writingx;
153
        writingy = mywriter.writingy;
154
        stringmax = mywriter.stringmax;
155
        hspace = mywriter.hspace;
156
        vspace = mywriter.vspace;
157
        linecount = mywriter.linecount;
158
        balloonwidth = (stringmax * hspace) + 10;
159
        balloonheight = ((linecount + 1) * vspace) + 5;
160
        if (sprite_index == spr_pink_balloon1)
161
        {
162
            heart_random_timer++;
163
            if (heart_random_timer == 10)
164
            {
165
                heart_random_timer = 0;
166
                var __r = 1;
167
                repeat (8)
168
                {
169
                    heart_x_random[__r] = -3 + random(6);
170
                    heart_y_random[__r] = -3 + random(6);
171
                    __r++;
172
                }
173
            }
174
            var __heart_x_offset = -35;
175
            var __heart_y_offset = -70;
176
            var __hx = x + __heart_x_offset + __x;
177
            var __hy = y + __heart_y_offset;
178
            var _heart_x1 = __hx + 10 + heart_x_random[1];
179
            var _heart_y1 = __hy + 45 + balloonheight + 30 + heart_y_random[1];
180
            var _heart_x2 = __hx + 10 + heart_x_random[1];
181
            var _heart_y2 = __hy + 45 + heart_y_random[2];
182
            var _heart_x3 = 0;
183
            var _heart_y3 = __hy + 20 + heart_y_random[3];
184
            var _heart_x4 = __hx + 80 + heart_x_random[4];
185
            var _heart_y4 = __hy + 48;
186
            var _heart_x5 = 0;
187
            var _heart_y5 = __hy + 20 + heart_y_random[5];
188
            var _heart_x6 = __hx + 80 + (balloonwidth / 2) + 20 + heart_x_random[6];
189
            var _heart_y6 = __hy + 45 + heart_y_random[6];
190
            var _heart_x7 = __hx + 80 + (balloonwidth / 2) + 20 + heart_x_random[7];
191
            var _heart_y7 = __hy + 45 + balloonheight + 30 + heart_y_random[7];
192
            var _heart_x8 = __hx + 80 + heart_x_random[8];
193
            var _heart_y8 = __hy + 45 + balloonheight + 30 + 45 + heart_y_random[8];
194
            _heart_x4 = (_heart_x1 + _heart_x7) / 2;
195
            _heart_x3 = (_heart_x2 + _heart_x4) / 2;
196
            _heart_x5 = (_heart_x4 + _heart_x6) / 2;
197
            _heart_x8 = (_heart_x2 + _heart_x6) / 2;
198
            if (notail == false && dir == 0 && shakecon == 0)
199
                draw_sprite_ext(spr_pink_heart_tail, 0, _heart_x7 + 2, y + 120 + __heart_y_offset, 1, 1, 0, c_white, 1);
200
            draw_set_color(make_color_rgb(160, 27, 30));
201
            d_triangle(_heart_x2, _heart_y2, _heart_x3, _heart_y3, _heart_x4, _heart_y4, false);
202
            d_triangle(_heart_x4, _heart_y4, _heart_x5, _heart_y5, _heart_x6, _heart_y6, false);
203
            d_triangle(_heart_x1, _heart_y1, _heart_x2, _heart_y2, _heart_x6, _heart_y6, false);
204
            d_triangle(_heart_x1, _heart_y1, _heart_x6, _heart_y6, _heart_x7, _heart_y7, false);
205
            d_triangle(_heart_x2, _heart_y2, _heart_x4, _heart_y4, _heart_x6, _heart_y6, false);
206
            d_triangle(_heart_x1, _heart_y1, _heart_x7, _heart_y7, _heart_x8, _heart_y8, false);
207
            var _w = 3;
208
            draw_set_color(make_color_rgb(255, 138, 144));
209
            d_line_width(_heart_x1, _heart_y1, _heart_x2, _heart_y2, _w);
210
            d_line_width(_heart_x2, _heart_y2, _heart_x3, _heart_y3, _w);
211
            d_line_width(_heart_x3, _heart_y3, _heart_x4, _heart_y4, _w);
212
            d_line_width(_heart_x4, _heart_y4, _heart_x5, _heart_y5, _w);
213
            d_line_width(_heart_x5, _heart_y5, _heart_x6, _heart_y6, _w);
214
            d_line_width(_heart_x6, _heart_y6, _heart_x7, _heart_y7, _w);
215
            d_line_width(_heart_x7, _heart_y7, _heart_x8, _heart_y8, _w);
216
            d_line_width(_heart_x8, _heart_y8, _heart_x1, _heart_y1, _w);
217
            draw_set_color(c_white);
218
            with (mywriter)
219
                pinkballoonid = other.id;
220
        }
221
        else if (sprite_index == spr_pink_balloon2)
222
        {
223
            __x = -10;
224
            __y = 10;
225
            draw_sprite_ext(spr_battleblcon_parts_ghost, 0, (parentid.ghostmarker.x + __x) - 264, (parentid.ghostmarker.y + __y) - 56, 2, 2, 0, c_white, 1);
226
            draw_sprite_ext(spr_battleblcon_parts_ghost, 1, ((parentid.ghostmarker.x + __x) - 264) + balloonwidth, (parentid.ghostmarker.y + __y) - 56, 2, 2, 0, c_white, 1);
227
            draw_sprite_ext(spr_battleblcon_parts_ghost, 2, (parentid.ghostmarker.x + __x) - 264, ((parentid.ghostmarker.y + __y) - 56) + balloonheight, 2, 2, 0, c_white, 1);
228
            draw_sprite_ext(spr_battleblcon_parts_ghost, 3, ((parentid.ghostmarker.x + __x) - 264) + balloonwidth, ((parentid.ghostmarker.y + __y) - 56) + balloonheight, 2, 2, 0, c_white, 1);
229
            var __repeat = 0;
230
            repeat (round(balloonwidth / 24))
231
            {
232
                draw_sprite_ext(spr_battleblcon_parts_ghost, 5, ((parentid.ghostmarker.x + __x) - 242) + (24 * __repeat), ((parentid.ghostmarker.y + __y) - 56) + balloonheight, 2, 2, 0, c_white, 1);
233
                __repeat++;
234
            }
235
            draw_set_color(make_color_rgb(192, 174, 219));
236
            d_line_width((parentid.ghostmarker.x + __x) - 264, (parentid.ghostmarker.y + __y) - 40, (parentid.ghostmarker.x + __x) - 264, ((parentid.ghostmarker.y + __y) - 56) + balloonheight, 2);
237
            d_line_width(((parentid.ghostmarker.x + __x) - 264) + balloonwidth + 24, (parentid.ghostmarker.y + __y) - 40, ((parentid.ghostmarker.x + __x) - 264) + 24 + balloonwidth, ((parentid.ghostmarker.y + __y) - 56) + balloonheight, 2);
238
            d_line_width((parentid.ghostmarker.x + __x) - 240, (parentid.ghostmarker.y + __y) - 56, ((parentid.ghostmarker.x + __x) - 264) + balloonwidth, (parentid.ghostmarker.y + __y) - 56, 2);
239
            draw_set_color(c_white);
240
            draw_sprite_ext(spr_battleblcon_parts_ghost, 4, ((parentid.ghostmarker.x + __x) - 240) + balloonwidth, parentid.ghostmarker.y + __y + -56 + (balloonheight / 2), 2, 2, 0, c_white, 1);
241
        }
242
        else if (sprite_index == spr_realisticexplosion)
243
        {
244
            index++;
245
            draw_sprite_ext(sprite_index, index, x + 50 + __x, y + 30 + __y, 5, 2, 0, make_color_rgb(255, 181, 153), 1);
246
            if (index > 15)
247
            {
248
                with (mywriter)
249
                    instance_destroy();
250
                instance_destroy();
251
                exit;
252
            }
253
        }
254
        else
255
        {
256
            draw_self();
257
        }
258
    }
259
    if (auto_length == 1 && init == 1 && sprite_index == spr_pink_balloon2)
260
    {
261
        mywriter.xstart = __x;
262
        var _writingx = (parentid.ghostmarker.x + __x) - balloonwidth - 60;
263
        var _writingy = (parentid.ghostmarker.y + __y) - (balloonheight / 2);
264
        var _right_x = 0;
265
        var _left_x = 0;
266
        var _y = 0;
267
        __y = 0;
268
        var _balloonwidth_adjusted = floor(balloonwidth / 12) * 12;
269
        var _width_remainder = balloonwidth;
270
        repeat (30)
271
        {
272
            if (_width_remainder >= 12)
273
                _width_remainder -= 12;
274
        }
275
        var _rep = round(point_distance(_writingx + 2 + __x, (_writingy - 5) + _y + __y, ((_writingx + _balloonwidth_adjusted) - 13) + __x, (_writingy - 5) + _y + __y) / 12);
276
        var _iii = 0;
277
        repeat (_rep + 2)
278
        {
279
            draw_sprite_ext(spr_battleblcon_ghost_bottom_anim3, ghost_balloon_index, (_writingx - 11) + __x + (_iii * 12), (_writingy + 1 + balloonheight + _y + __y) - 2, 1, 1, 0, c_white, 1);
280
            _iii++;
281
            _right_x = (_writingx - 12) + __x + (_iii * 12);
282
            _left_x = (_writingx - 11) + __x;
283
        }
284
        ghost_balloon_index += 1;
285
        d_rectangle_color((_writingx - 10) + __x, (_writingy - 4) + _y + __y, _right_x - 8, ((_writingy + balloonheight) - 0) + _y + __y, 0, 0, 0, 0, false);
286
        d_rectangle_color((_writingx - 10) + __x, (_writingy - 0) + _y + __y, _right_x - 1, ((_writingy + balloonheight) - 0) + _y + __y, 0, 0, 0, 0, false);
287
        d_rectangle_color((_writingx - 10) + __x, (_writingy - 3) + _y + __y, (_writingx + balloonwidth + __x) - 14, ((_writingy + balloonheight) - 0) + _y + __y, 0, 0, 0, 0, false);
288
        _iii = 0;
289
        repeat (_rep + 2)
290
        {
291
            draw_sprite_ext(spr_battleblcon_ghost_bottom_anim3, ghost_balloon_index, (_writingx - 11) + __x + (_iii * 12), (_writingy + 1 + balloonheight + _y + __y) - 2, 1, 1, 0, c_white, 1);
292
            _iii++;
293
            _right_x = (_writingx - 12) + __x + (_iii * 12);
294
            _left_x = (_writingx - 11) + __x;
295
        }
296
        draw_sprite_ext(spr_battleblcon_parts_ghost, 4, _right_x, ((_writingy + (balloonheight / 2)) - 6) + _y + __y, 1, 1, 0, c_white, 1);
297
        draw_set_color(c_purple);
298
        draw_set_color(c_white);
299
        draw_sprite_ext(spr_battleblcon_parts_ghost2, 0, _left_x, (_writingy - 4) + _y + __y, 1, 1, 0, c_white, 1);
300
        draw_sprite_ext(spr_battleblcon_parts_ghost2, 1, _right_x - 12, (_writingy - 4) + _y + __y, 1, 1, 0, c_white, 1);
301
        var _purp_color = make_color_rgb(192, 174, 219);
302
        d_line_color(_left_x, _writingy + 3 + _y + __y, _left_x, (_writingy - 4) + balloonheight + _y + __y + 5, _purp_color, _purp_color);
303
        d_line_color(_writingx + 1 + __x, (_writingy - 5) + _y + __y, _right_x - 12, (_writingy - 5) + _y + __y, _purp_color, _purp_color);
304
        d_line_color(_right_x, _writingy + 5 + _y + __y, _right_x, (_writingy - 6) + (balloonheight / 2) + _y + __y, _purp_color, _purp_color);
305
        d_line_color(_right_x, _writingy + 6 + (balloonheight / 2) + _y + __y, _right_x, (_writingy - 4) + balloonheight + _y + __y + 5, _purp_color, _purp_color);
306
        if (parentid != -1)
307
        {
308
            with (mywriter)
309
                pinkballoonid = other.id;
310
            extrax = (_writingx - 10) + __x;
311
            extray = (_writingy - 4) + _y + __y;
312
        }
313
    }
314
    else if (auto_length == 1 && init == 1)
315
    {
316
        var _color = blcon_default_color;
317
        if (type == 1)
318
            _color = merge_color(c_black, c_gray, 0.1);
319
        blconscale = 1;
320
        if (balloonheight < 40)
321
            blconscale = 0.5;
322
        if (side == 1)
323
            draw_sprite_ext(spr_battleblcon_parts, 4, x + __x, y + __y, 1, blconscale, 0, _color, 1);
324
        if (side == -1)
325
            draw_sprite_ext(spr_battleblcon_parts, 4, (x - xoffset) + __x, y + __y, -1, blconscale, 0, _color, 1);
326
        if (side == 2)
327
            draw_sprite_ext(spr_battleblcon_parts, 4, x + __x, (y + __y) - 1, 1, 1, -90, _color, 1);
328
        if (side == 3)
329
            draw_sprite_ext(spr_battleblcon_parts, 4, (x + __x) - 40, (y - 20) + __y, 1, 1, 90, _color, 1);
330
        if (side == 4)
331
            draw_sprite_ext(spr_battleblcon_parts, 4, x + __x, (y - 20) + __y, 1, 1, 90, _color, 1);
332
        draw_set_color(_color);
333
        mywriter.xstart = __x;
334
        var _y = 0;
335
        if (global.lang == "ja")
336
            _y = 1;
337
        d_rectangle((writingx - 10) + __x, (writingy - 5) + _y + __y, writingx + balloonwidth + __x, ((writingy + balloonheight) - 5) + _y + __y, false);
338
        d_rectangle((writingx - 5) + __x, (writingy - 10) + _y + __y, ((writingx + balloonwidth) - 5) + __x, writingy + balloonheight + _y + __y, false);
339
        draw_set_color(c_white);
340
    }
341
    remmsgno = mywriter.msgno;
342
}
343
if (aquafollowballoon == true)
344
{
345
    draw_set_font(
scr_84_get_font
scr_84_get_font

function
scr_84_get_font(arg0)
{ if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("dotumche"));
346
    draw_text_transformed_color(x - 24, y - 42, string(global.msg[0]), 1, 1, 0, c_black, c_black, c_black, c_black, 1);
347
}