Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_rhythmgame_draw

(view raw script w/o annotations or w/e)
1
function 
scr_rhythmgame_draw
scr_rhythmgame_draw

function
scr_rhythmgame_draw(arg0, arg1, arg2 = false)
{ scr_rhythmgame_draw_backing(arg0, arg1, arg2); if (!arg2) scr_rhythmgame_draw_combo(arg1); scr_rhythmgame_draw_chart(arg0, arg1, arg2); } function scr_rhythmgame_draw_backing(arg0, arg1, arg2 = false, arg3 = 0) { if (arg2) fade = 0; if (fade == 1 && brightness == 1) draw_set_color(c_gray); else draw_set_color(merge_color(c_black, c_gray, fade * brightness)); var _gray = merge_color(c_black, c_gray, brightness); draw_set_color(c_black); var _flash = 0; if (invc > 0 && fade == 1) _flash = remap_clamped(0, 6, 0, 1, hurt_flash); draw_set_alpha(0.75); ossafe_fill_rectangle(arg1 - 40, bottomy - 200, arg1 + 40, bottomy + 50, false); draw_set_alpha(1); draw_set_blend_mode(bm_normal); var whitebar = -1; var linegap = arg0 * notespacing * 16; var linestart = (bottomy - linegap) + (((trackpos - startoffset) % notespacing) * arg0); var whitebarstart = (bottomy - linegap) + (((trackpos - startoffset) % (notespacing * 4)) * arg0); draw_set_color(_gray); for (var i = 0; i < 20; i++) { var liney = linestart + (notespacing * arg0 * i); if (!arg2 && (liney < (bottomy - 200) || liney > (bottomy + 50))) continue; draw_set_color(_gray); draw_line(arg1 - 40, liney, arg1 + 40, liney); } var nextBar = floor(trackpos / meter); for (var i = 0; i < 5; i++) { var liney = whitebarstart + (notespacing * 4 * arg0 * i); if (arg2) { draw_text(arg1 - 70, liney - 1 - 8, (nextBar - i) + 4); draw_text(arg1 + 70, liney - 1 - 8, (((nextBar - i) + 4) * meter) - 0.01); } if (!arg2 && ((liney - 1) < (bottomy - 200) || (liney + 1) > (bottomy + 50))) continue; ossafe_fill_rectangle(arg1 - 40, liney - 1, arg1 + 40, liney + 1, false); } if (_flash > 0) { draw_set_blend_mode(bm_add); var _flashCol = merge_color(c_black, c_red, _flash * fade * brightness); ossafe_fill_rectangle_color(arg1 - 40, bottomy - 200, arg1 + 40, bottomy + 50, c_black, c_black, _flashCol, _flashCol, false); draw_set_blend_mode(bm_normal); } draw_set_color(c_white); } function scr_rhythmgame_draw_border(arg0, arg1 = false) { var _bordercolor = note_color[1]; if (invc > 0) _bordercolor = merge_color(note_color[1], c_red, scr_rhythmgame_damage_flash()); draw_set_color(merge_color(c_black, _bordercolor, brightness)); if (!arg1) { var _jp = global.lang == "ja"; var _icon, _hoff, _name; if (instrument == 0) { _icon = 2847; _name = _jp ? spr_ja_bnamekris : spr_bnamekris; _hoff = 21; } else if (instrument == 1) { _icon = 2849; _name = _jp ? spr_ja_bnamesusie : spr_bnamesusie; _hoff = 24; } else if (instrument == 2) { _icon = 2848; _name = _jp ? spr_ja_bnameralsei : spr_bnameralsei; _hoff = 30; } draw_sprite_ext(_icon, 0, arg0 - _hoff - 20, bottomy - 234, 1, 1, 0, merge_color(c_black, c_white, brightness), 1); draw_sprite_ext(_name, 0, (arg0 - _hoff) + 20, bottomy - 228, 1, 1, 0, draw_get_color(), 1); } draw_set_color(c_black); draw_set_alpha(0.5); ossafe_fill_rectangle((arg0 - 40) + 2, (bottomy - 200) + 2, arg0 + 40 + 2, bottomy + 50 + 2, true); ossafe_fill_rectangle((arg0 - 41) + 2, (bottomy - 201) + 2, arg0 + 41 + 2, bottomy + 51 + 2, true); draw_set_alpha(1); draw_set_color(merge_color(c_black, _bordercolor, brightness)); ossafe_fill_rectangle(arg0 - 40, bottomy - 200, arg0 + 40, bottomy + 50, true); ossafe_fill_rectangle(arg0 - 41, bottomy - 201, arg0 + 41, bottomy + 51, true); } ...
(arg0, arg1, arg2 = false)
2
{
3
    scr_rhythmgame_draw_backing(arg0, arg1, arg2);
4
    if (!arg2)
5
        scr_rhythmgame_draw_combo(arg1);
6
    scr_rhythmgame_draw_chart(arg0, arg1, arg2);
7
}
8
9
function scr_rhythmgame_draw_backing(arg0, arg1, arg2 = false, arg3 = 0)
10
{
11
    if (arg2)
12
        fade = 0;
13
    if (fade == 1 && brightness == 1)
14
        draw_set_color(c_gray);
15
    else
16
        draw_set_color(merge_color(c_black, c_gray, fade * brightness));
17
    var _gray = merge_color(c_black, c_gray, brightness);
18
    draw_set_color(c_black);
19
    var _flash = 0;
20
    if (invc > 0 && fade == 1)
21
        _flash = remap_clamped(0, 6, 0, 1, hurt_flash);
22
    draw_set_alpha(0.75);
23
    ossafe_fill_rectangle(arg1 - 40, bottomy - 200, arg1 + 40, bottomy + 50, false);
24
    draw_set_alpha(1);
25
    draw_set_blend_mode(bm_normal);
26
    var whitebar = -1;
27
    var linegap = arg0 * notespacing * 16;
28
    var linestart = (bottomy - linegap) + (((trackpos - startoffset) % notespacing) * arg0);
29
    var whitebarstart = (bottomy - linegap) + (((trackpos - startoffset) % (notespacing * 4)) * arg0);
30
    draw_set_color(_gray);
31
    for (var i = 0; i < 20; i++)
32
    {
33
        var liney = linestart + (notespacing * arg0 * i);
34
        if (!arg2 && (liney < (bottomy - 200) || liney > (bottomy + 50)))
35
            continue;
36
        draw_set_color(_gray);
37
        draw_line(arg1 - 40, liney, arg1 + 40, liney);
38
    }
39
    var nextBar = floor(trackpos / meter);
40
    for (var i = 0; i < 5; i++)
41
    {
42
        var liney = whitebarstart + (notespacing * 4 * arg0 * i);
43
        if (arg2)
44
        {
45
            draw_text(arg1 - 70, liney - 1 - 8, (nextBar - i) + 4);
46
            draw_text(arg1 + 70, liney - 1 - 8, (((nextBar - i) + 4) * meter) - 0.01);
47
        }
48
        if (!arg2 && ((liney - 1) < (bottomy - 200) || (liney + 1) > (bottomy + 50)))
49
            continue;
50
        ossafe_fill_rectangle(arg1 - 40, liney - 1, arg1 + 40, liney + 1, false);
51
    }
52
    if (_flash > 0)
53
    {
54
        draw_set_blend_mode(bm_add);
55
        var _flashCol = merge_color(c_black, c_red, _flash * fade * brightness);
56
        ossafe_fill_rectangle_color(arg1 - 40, bottomy - 200, arg1 + 40, bottomy + 50, c_black, c_black, _flashCol, _flashCol, false);
57
        draw_set_blend_mode(bm_normal);
58
    }
59
    draw_set_color(c_white);
60
}
61
62
function scr_rhythmgame_draw_border(arg0, arg1 = false)
63
{
64
    var _bordercolor = note_color[1];
65
    if (invc > 0)
66
        _bordercolor = merge_color(note_color[1], c_red, scr_rhythmgame_damage_flash());
67
    draw_set_color(merge_color(c_black, _bordercolor, brightness));
68
    if (!arg1)
69
    {
70
        var _jp = global.lang == "ja";
71
        var _icon, _hoff, _name;
72
        if (instrument == 0)
73
        {
74
            _icon = 2847;
75
            _name = _jp ? spr_ja_bnamekris : spr_bnamekris;
76
            _hoff = 21;
77
        }
78
        else if (instrument == 1)
79
        {
80
            _icon = 2849;
81
            _name = _jp ? spr_ja_bnamesusie : spr_bnamesusie;
82
            _hoff = 24;
83
        }
84
        else if (instrument == 2)
85
        {
86
            _icon = 2848;
87
            _name = _jp ? spr_ja_bnameralsei : spr_bnameralsei;
88
            _hoff = 30;
89
        }
90
        draw_sprite_ext(_icon, 0, arg0 - _hoff - 20, bottomy - 234, 1, 1, 0, merge_color(c_black, c_white, brightness), 1);
91
        draw_sprite_ext(_name, 0, (arg0 - _hoff) + 20, bottomy - 228, 1, 1, 0, draw_get_color(), 1);
92
    }
93
    draw_set_color(c_black);
94
    draw_set_alpha(0.5);
95
    ossafe_fill_rectangle((arg0 - 40) + 2, (bottomy - 200) + 2, arg0 + 40 + 2, bottomy + 50 + 2, true);
96
    ossafe_fill_rectangle((arg0 - 41) + 2, (bottomy - 201) + 2, arg0 + 41 + 2, bottomy + 51 + 2, true);
97
    draw_set_alpha(1);
98
    draw_set_color(merge_color(c_black, _bordercolor, brightness));
99
    ossafe_fill_rectangle(arg0 - 40, bottomy - 200, arg0 + 40, bottomy + 50, true);
100
    ossafe_fill_rectangle(arg0 - 41, bottomy - 201, arg0 + 41, bottomy + 51, true);
101
}
102
103
function scr_rhythmgame_draw_combo(arg0)
104
{
105
    if (combo > 0)
106
    {
107
        draw_set_halign(fa_center);
108
        draw_set_font(fnt_main);
109
        var _combotext = (combo > 999) ? stringsetloc(
BIG
"BIG", "scr_rhythmgame_draw_slash_scr_rhythmgame_draw_gml_125_0"
) : combo;
110
        draw_text_transformed_color(arg0 + 2, bottomy - 121, _combotext, (combo >= 100) ? 3.5 : 5, 5, 0, #666666, #666666, #BBBBBB, #BBBBBB, 0.25);
111
        draw_text_transformed_color(arg0 + 2, bottomy - 60, stringsetloc(
COMBO
"COMBO", "scr_rhythmgame_draw_slash_scr_rhythmgame_draw_gml_127_0"
), 2, 2, 0, #BBBBBB, #BBBBBB, #DDDDDD, #DDDDDD, 0.25);
112
        draw_set_halign(fa_left);
113
    }
114
}
115
116
function scr_rhythmgame_draw_chart(arg0, arg1, arg2 = false)
117
{
118
    var _hitspeed = !arg2 ? obj_rhythmgame.pitch : 1;
119
    if (!arg2 && obj_rhythmgame.lose_con == 2)
120
        _hitspeed = 0;
121
    var _xstart = (instrument == 2) ? 280 : 280;
122
    var _xwidth = (instrument == 2) ? 30 : 40;
123
    var _beam = 0;
124
    var _notecol = [];
125
    var _flash = 0;
126
    var _altcolor = 0;
127
    if (invc > 0)
128
        _flash = scr_rhythmgame_damage_flash();
129
    _notecol[0] = merge_color(note_color[0], c_red, _flash);
130
    _notecol[0] = merge_color(c_black, _notecol[0], brightness);
131
    _notecol[1] = merge_color(note_color[1], c_red, _flash);
132
    _notecol[1] = merge_color(c_black, _notecol[1], brightness);
133
    _notecol[2] = merge_color(note_color[2], c_red, _flash);
134
    _notecol[2] = merge_color(c_black, _notecol[2], brightness);
135
    var _yellow = merge_color(c_black, merge_color(c_yellow, c_red, _flash), brightness);
136
    var _gold = merge_color(c_black, #FFED72, brightness);
137
    var _orange = merge_color(c_black, merge_color(c_orange, c_red, _flash), brightness);
138
    var _white = merge_color(c_black, merge_color(c_white, c_red, _flash), brightness);
139
    var _gray = merge_color(c_black, merge_color(c_gray, c_red, _flash), brightness);
140
    if (instrument == 1 && !arg2)
141
    {
142
        draw_sprite_ext(spr_rhythmgame_button, 4, arg1 - 20, bottomy, 1, 1, 0, _notecol[0], 1);
143
        draw_sprite_ext(spr_rhythmgame_button, 4, arg1 + 20, bottomy, 1, 1, 0, _notecol[1], 1);
144
    }
145
    if (instrument == 2)
146
    {
147
        draw_set_color(c_black);
148
        ossafe_fill_rectangle(arg1 - 40, bottomy - 2, arg1 + 40, bottomy + 2, false);
149
        draw_set_color(_orange);
150
        ossafe_fill_rectangle(arg1 - 40, bottomy - 1, arg1 + 40, bottomy + 1, false);
151
        for (var i = 0; i < 3; i++)
152
        {
153
            _beam = 
scr_ease_in
scr_ease_in

function
scr_ease_in(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_in_bounce(arg0, 0, 1, 1); case -2: return ease_in_elastic(arg0, 0, 1, 1); case -1: var _s = 1.70158; return arg0 * arg0 * (((_s + 1) * arg0) - _s); case 0: return arg0; case 1: return -cos(arg0 * 1.5707963267948966) + 1; case 6: return power(2, 10 * (arg0 - 1)); case 7: return -(sqrt(1 - sqr(arg0)) - 1); default: return power(arg0, arg1); } }
(note_hit_timer[i] / 5, 2);
154
            if (note_hit_timer[i] > 0)
155
            {
156
                draw_sprite_ext(spr_whitegradientdown_rhythm, 1, (arg1 - 30) + (30 * i), bottomy, _beam * 0.75, 1, 0, _gold, 1);
157
                draw_sprite_ext(spr_whitegradientdown_rhythm, 2, (arg1 - 30) + (30 * i), bottomy, _beam * 0.75, 1, 0, _white, 1);
158
                if (last_note != i && cooldown > 1)
159
                    notex = clamp01(last_note - i) * 6;
160
                else if (cooldown <= 1)
161
                    notex = 0;
162
                last_note = i;
163
                cooldown = 2;
164
            }
165
            note_hit_timer[i] -= _hitspeed;
166
        }
167
        if (cooldown > 0)
168
        {
169
            var _arrow = (cooldown == 2) ? _yellow : _white;
170
            draw_sprite_ext(spr_custommenu_arrow, 0, (arg1 - 30) + (30 * last_note) + notex, bottomy + 10, 1, 2, 180, _arrow, clamp01(cooldown));
171
            notex = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(notex, 0, 4);
172
            cooldown -= (1/15);
173
        }
174
    }
175
    else
176
    {
177
        for (var i = 0; i < 2; i++)
178
        {
179
            if (note_hit_timer[i] > 0)
180
            {
181
                _beam = 
scr_ease_in
scr_ease_in

function
scr_ease_in(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_in_bounce(arg0, 0, 1, 1); case -2: return ease_in_elastic(arg0, 0, 1, 1); case -1: var _s = 1.70158; return arg0 * arg0 * (((_s + 1) * arg0) - _s); case 0: return arg0; case 1: return -cos(arg0 * 1.5707963267948966) + 1; case 6: return power(2, 10 * (arg0 - 1)); case 7: return -(sqrt(1 - sqr(arg0)) - 1); default: return power(arg0, arg1); } }
(note_hit_timer[i] / 5, 2);
182
                var _ease = note_hit_timer[i] / 5;
183
                var _col = _white;
184
                var _cool = false;
185
                var _side = (i * 2) - 1;
186
                var _cenx = arg1 + (20 * _side);
187
                var _score = 0;
188
                if (instrument == 0)
189
                {
190
                    _score = note_hit_score[i];
191
                    _cool = _score >= 100;
192
                    _col = _cool ? _gold : _white;
193
                }
194
                if (instrument == 1)
195
                {
196
                    if (auto_play)
197
                    {
198
                        _score = 100;
199
                        _cool = true;
200
                        _col = _gold;
201
                    }
202
                    draw_sprite_ext(spr_rhythmgame_button, 3, _cenx, bottomy, 1, 1, 0, _white, note_hit_timer[i] / 5);
203
                }
204
                if (!arg2 && obj_rhythmgame.fame >= 12000 && _score > 0)
205
                    draw_sprite_ext(spr_rhythmgame_note_hit, (1 - _beam) * 2.9, _cenx + (_side * (1 - _ease) * 2), bottomy, 2 - _beam, 2 - _beam, 0, merge_color(_white, _col, 1 - _ease), _ease);
206
                if (_cool)
207
                {
208
                    draw_sprite_ext(spr_whitegradientdown_rhythm, 1, _cenx, bottomy, _beam, 1, 0, _gold, 1);
209
                    draw_sprite_ext(spr_whitegradientdown_rhythm, 2, _cenx, bottomy, _beam, 1, 0, _white, 1);
210
                }
211
                else
212
                {
213
                    draw_sprite_ext(spr_whitegradientdown_rhythm, 0, _cenx, bottomy, _beam, 1, 0, _white, 1);
214
                }
215
                note_hit_timer[i] -= _hitspeed;
216
            }
217
        }
218
    }
219
    if (!arg2 && !paused)
220
    {
221
        scr_draw_set_mask(true);
222
        ossafe_fill_rectangle(arg1 - 40, bottomy + 50, arg1 + 40, bottomy - 200, false);
223
        scr_draw_in_mask_begin();
224
    }
225
    var _looper = !arg2 && ((loop && (instrument != 0 || tutorial != 1)) || (chart_end > track_length && maxnote > 0 && notetime[0] < chart_start));
226
    var _loopcheck = false;
227
    var _averagetimeunit = ((trackpos - remtrackpos[0]) + (remtrackpos[0] - remtrackpos[1]) + (remtrackpos[1] - remtrackpos[2])) / 3;
228
    var _end_buffer = trackpos - (3.6 * _averagetimeunit);
229
    if (!arg2 && instrument == 0 && hardmode)
230
        _end_buffer = trackpos - (2.4 * _averagetimeunit);
231
    var notei = max(minnote - 8, 0);
232
    for (; notei < maxnote; notei++)
233
    {
234
        var _notetime = notetime[notei];
235
        var _notealive = notealive[notei];
236
        var _notescore = notescore[notei];
237
        var _noteend = noteend[notei];
238
        if (!arg2 && instrument != 1 && obj_rhythmgame.song_id == 0)
239
        {
240
            _notetime = scr_rhythmgame_noteskip(notetime[notei]);
241
            if (_noteend > 0)
242
                _noteend = scr_rhythmgame_noteskip(_noteend);
243
        }
244
        else if (_loopcheck)
245
        {
246
            _notetime = scr_rhythmgame_noteloop(notetime[notei]);
247
            if (_notetime > (track_length / 2))
248
            {
249
                _notealive = 1;
250
                _notescore = 0;
251
            }
252
            else
253
            {
254
                _notealive = 0;
255
                if (notei >= (maxnote - 5))
256
                    _notescore = last_score[notei - (maxnote - 5)];
257
            }
258
            if (_noteend > 0)
259
                _noteend = scr_rhythmgame_noteloop(_noteend);
260
        }
261
        var notey = (bottomy - (_notetime * arg0)) + (trackpos * arg0);
262
        var _topy = camy - 20;
263
        if (notey < _topy)
264
        {
265
            if (_looper && !_loopcheck && trackpos < 4 && maxnote > 9)
266
            {
267
                _loopcheck = true;
268
                notei = maxnote - 9;
269
                continue;
270
            }
271
            break;
272
        }
273
        if (notey >= _topy && (notei >= minnote || _notescore <= 0 || (_loopcheck && _notealive)))
274
        {
275
            _end_buffer = trackpos - 0.12000000000000001;
276
            if (!arg2 && instrument == 0 && hardmode)
277
                _end_buffer = trackpos - 0.08666666666666667;
278
            if (_loopcheck == 0 && _notetime < _end_buffer)
279
            {
280
                if (notescore[notei] <= 0 && notealive[notei] == 1 && fade == 1)
281
                {
282
                    missnotecon = 1;
283
                    if (instrument == 0 && !arg2)
284
                        miss++;
285
                }
286
                notealive[notei] = 0;
287
                minnote = notei + 1;
288
            }
289
            if (_notealive == 1)
290
                draw_set_color(_notecol[notetype[notei]]);
291
            else
292
                draw_set_color(_gray);
293
            if (_notescore >= 100)
294
                draw_set_color(_yellow);
295
            else if (_notescore >= 30)
296
                draw_set_color(_orange);
297
            if (_notealive == 1 || _notescore <= 0)
298
            {
299
                if (_notescore < 0 && _noteend > 0 && _notealive == 0)
300
                {
301
                    _notetime -= notescore[notei];
302
                    notey = (bottomy - (_notetime * arg0)) + (trackpos * arg0);
303
                    _notescore = 0;
304
                }
305
                if (noteanim[notei] > 0 && arg2)
306
                {
307
                    var _oldcolor = draw_get_color();
308
                    draw_set_color(_yellow);
309
                    draw_circle((arg1 - 20 - 15) + (notetype[notei] * 40), notey, 3, false);
310
                    draw_circle((arg1 - 20) + 15 + (notetype[notei] * 40), notey, 3, false);
311
                    draw_set_color(_oldcolor);
312
                }
313
                scr_rhythmgame_draw_note(arg1, notey, notetype[notei]);
314
                if (arg2 && paused && do_refresh)
315
                {
316
                    var _xleft = arg1;
317
                    if (instrument == 2)
318
                        _xleft -= 15;
319
                    else
320
                        _xleft += 5;
321
                    var _node = instance_create((_xleft - _xwidth) + (notetype[notei] * _xwidth) + 15, notey, obj_rhythmgame_editor_note_node);
322
                    _node.depth = depth + 1;
323
                    _node.noteindex = notei;
324
                    if (instrument == 2)
325
                        _node.image_xscale = 1.375;
326
                }
327
                if (_noteend > 0)
328
                {
329
                    var notelength = (_noteend - _notetime) * arg0;
330
                    scr_rhythmgame_draw_note_long(arg1, notey, notetype[notei], notelength, false);
331
                }
332
            }
333
        }
334
        if (_looper && !_loopcheck && (notei + 1) == maxnote && trackpos > (track_length - 4))
335
        {
336
            notei = -1;
337
            _loopcheck = true;
338
        }
339
    }
340
    var _note_count = (instrument == 0) ? 1 : 2;
341
    for (var i = 0; i <= _note_count; i++)
342
    {
343
        if (hold_end[i] > 0)
344
        {
345
            var note_end = (hold_end[i] - trackpos) * arg0;
346
            draw_set_color(_orange);
347
            scr_rhythmgame_draw_note_long(arg1, bottomy, i, note_end, true);
348
            draw_set_color(_yellow);
349
            scr_rhythmgame_draw_note(arg1, bottomy, i);
350
        }
351
    }
352
    if (!arg2 && !paused)
353
        scr_draw_in_mask_end();
354
}
355
356
function scr_rhythmgame_draw_note(arg0, arg1, arg2, arg3 = 0)
357
{
358
    if (instrument == 2)
359
    {
360
        arg0 = (arg0 - 30) + (arg2 * 30);
361
        if (paused)
362
            ossafe_fill_rectangle(arg0 - 10, arg1 - 3, arg0 + 10, arg1 + 3, false);
363
        else
364
            draw_sprite_ext(spr_rhythmgame_heldnote, 0, arg0, arg1, 1, 1, 0, draw_get_color(), 1);
365
    }
366
    else if (instrument == 1 && arg2 == 2)
367
    {
368
        ossafe_fill_rectangle(arg0 - 45, arg1 - 1, arg0 + 45, arg1 + 1, false);
369
    }
370
    else
371
    {
372
        arg0 = (arg0 - 20) + (arg2 * 40);
373
        draw_sprite_ext(spr_rhythmgame_note, 0, arg0, arg1, 1, 1, 0, draw_get_color(), 1);
374
    }
375
}
376
377
function scr_rhythmgame_draw_note_long(arg0, arg1, arg2, arg3, arg4 = false)
378
{
379
    if (instrument == 2)
380
    {
381
        arg0 = (arg0 - 30) + (arg2 * 30);
382
        var _col = draw_get_color();
383
        draw_sprite_ext(spr_rhythmgame_heldnote, 0, arg0, arg1 - arg3, 1, 1, 0, _col, 1);
384
        draw_sprite_ext(spr_rhythmgame_heldnote, 0, arg0, arg1, 1, 1, 0, _col, 1);
385
    }
386
    else
387
    {
388
        arg0 = (arg0 - 20) + (arg2 * 40);
389
    }
390
    ossafe_fill_rectangle(arg0 - 3, arg1 - arg3, arg0 + 3, arg1, false);
391
    if (arg4)
392
    {
393
        var _endColor = merge_color(c_yellow, c_orange, clamp01(inverselerp(arg1, arg1 - 40, arg1 - arg3)));
394
        _endColor = merge_color(c_black, _endColor, brightness);
395
        var _startColor = merge_color(c_black, c_yellow, brightness);
396
        if (instrument == 2)
397
        {
398
            draw_set_color(_endColor);
399
            draw_sprite_ext(spr_rhythmgame_heldnote, 0, arg0, arg1 - arg3, 1, 1, 0, _endColor, 1);
400
        }
401
        ossafe_fill_rectangle_color(arg0 - 3, arg1 - arg3, arg0 + 3, arg1, _endColor, _endColor, _startColor, _startColor, false);
402
    }
403
}
404
405
function scr_rhythmgame_noteloop(arg0)
406
{
407
    if (arg0 < (track_length / 2))
408
        arg0 += scr_round_to_beat(track_length, bpm);
409
    else
410
        arg0 -= scr_round_to_beat(track_length, bpm);
411
    return arg0;
412
}
413
414
function scr_rhythmgame_noteskip(arg0)
415
{
416
    with (obj_rhythmgame)
417
    {
418
        if (solo_difficulty < 2)
419
        {
420
            var _skiplength = timestamp[3] - timestamp[solo_difficulty + 1];
421
            var _solodiff = timestamp[solo_difficulty + 1];
422
            if (trackpos <= _solodiff && arg0 >= timestamp[3])
423
                arg0 -= _skiplength;
424
            else if (trackpos >= timestamp[3] && arg0 <= _solodiff)
425
                arg0 += _skiplength;
426
        }
427
        if (solo_difficulty > 0)
428
        {
429
            var _skiplength = timestamp[solo_difficulty] - timestamp[0];
430
            var _solodiff = timestamp[solo_difficulty];
431
            if (trackpos <= timestamp[0] && arg0 >= _solodiff)
432
                arg0 -= _skiplength;
433
            else if (trackpos >= _solodiff && arg0 <= timestamp[0])
434
                arg0 += _skiplength;
435
        }
436
    }
437
    return arg0;
438
}
439
440
function scr_rhythmgame_damage_flash(arg0 = false)
441
{
442
    if (invc > 0)
443
    {
444
        var _flash;
445
        if (arg0)
446
        {
447
            var _blink = ((invc % 8) < 4) ? (1/3) : 0;
448
            _flash = max(_blink, remap_clamped(0, 6, 0, 1, hurt_flash));
449
        }
450
        else
451
        {
452
            _flash = remap_clamped(0, 6, 0, 1, hurt_flash);
453
        }
454
        return _flash;
455
    }
456
    else
457
    {
458
        return 0;
459
    }
460
}
461
462
function scr_rhythmgame_songlist()
463
{
464
    var _trackname = [];
465
    _trackname[0] = "Lightners Live";
466
    _trackname[1] = "Soundcheck";
467
    _trackname[2] = "Tenna boss";
468
    _trackname[3] = "How to play";
469
    _trackname[4] = "Board 4";
470
    _trackname[5] = "Rude Buster (Boss)";
471
    _trackname[6] = "Rude Buster (Vapor)";
472
    return _trackname;
473
}