Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_rhythmgame_Draw_0

(view raw script w/o annotations or w/e)
1
if (freeplay < 0)
2
{
3
    var _textspacing = 16;
4
    draw_set_color(c_white);
5
    _ystart = 80;
6
    draw_text(230, _ystart - _textspacing, "TRACK SELECT");
7
    var _difficulty = "";
8
    for (i = 0; i < array_length(tracklist); i++)
9
    {
10
        if (i == song_id)
11
        {
12
            draw_set_color(hardmode ? c_orange : c_yellow);
13
            if (hardmode)
14
                _difficulty = " (Hard)";
15
        }
16
        draw_text(210, _ystart + (_textspacing * i), string_format_zero(i, 2, 0) + " - " + tracklist[i] + _difficulty);
17
        if (i == song_id)
18
        {
19
            _difficulty = "";
20
            draw_set_color(c_white);
21
        }
22
    }
23
    draw_sprite(spr_heart, 0, 190, _ystart + (song_id * _textspacing));
24
    exit;
25
}
26
camy = cameray();
27
camx = camerax();
28
with (obj_rhythmgame_chart)
29
{
30
    camy = other.camy;
31
    camx = other.camx;
32
}
33
if (tenna_boss)
34
{
35
    draw_set_color(c_black);
36
    ossafe_fill_rectangle(camx, camy, camx + camerawidth(), camy + 100);
37
    draw_set_color(c_white);
38
}
39
bg_timer++;
40
if (palette_active)
41
{
42
    palette_pos = 
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); } }
(palette_pos, 1 - bg_con, 0.1);
43
    pal_swap_set(spr_dw_rhythm_stage_palette, palette_pos, false);
44
    draw_sprite_ext(spr_rhythmgame_bg, 1, x, y + 100, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
45
    pal_swap_reset();
46
    if (palette_pos == 0)
47
        palette_active = false;
48
}
49
else
50
{
51
    draw_sprite_ext(spr_rhythmgame_bg, bg_con, x, y + 100, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
52
    draw_set_blend_mode(bm_add);
53
    draw_sprite_ext(spr_rhythmgame_bg, bg_con, x, y + 100, image_xscale, image_yscale, image_angle, image_blend, 0.1 + (sin(bg_timer / 6) * 0.1 * (kchart_ease * 0.65)));
54
    draw_set_blend_mode(bm_normal);
55
    draw_sprite_ext(spr_rhythmgame_bg_mask, 1, x, y + 100, image_xscale, image_yscale, image_angle, image_blend, image_alpha * (kchart_ease * 0.65));
56
}
57
var _silhouette = false;
58
var _floor = y + 394;
59
with (obj_rhythmgame_performer)
60
{
61
    if (silhouette)
62
    {
63
        if (!_silhouette)
64
        {
65
            _silhouette = true;
66
            if (!surface_exists(other.silhouette_surf))
67
                other.silhouette_surf = surface_create(640, 480);
68
            surface_set_target(other.silhouette_surf);
69
            draw_clear_alpha(c_black, 0);
70
        }
71
        var _floorb = _floor + 2;
72
        if (name == "susie")
73
            _floorb -= 8;
74
        if (marker != -4)
75
        {
76
            with (marker)
77
            {
78
                scr_perspective_shadow_ext(id, 350, _floor - 78, _floor, true, 0, 120);
79
                scr_perspective_shadow_ext(id, 290, _floor - 78, _floor, true, 0, 120);
80
            }
81
        }
82
        scr_perspective_shadow_ext(id, 350, _floor - 90, _floorb, true, 0, 120);
83
        scr_perspective_shadow_ext(id, 290, _floor - 90, _floorb, true, 0, 120);
84
    }
85
}
86
if (_silhouette)
87
{
88
    gpu_set_blendmode(bm_subtract);
89
    draw_sprite_ext(spr_rhythmgame_bg_overlay, 0, x, y + 100, image_xscale, image_yscale, image_angle, image_blend, 1);
90
    gpu_set_blendmode(bm_normal);
91
    surface_reset_target();
92
    draw_surface(silhouette_surf, x, 0);
93
}
94
if (stage_con >= 1)
95
{
96
    draw_sprite_ext(spr_rhythmgame_bg_mask, 0, x, y + 100, image_xscale, image_yscale, image_angle, spotlight_color[3], ((image_alpha * (stage_con - 1)) / 2) + 0.25);
97
    stage_con = 
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); } }
(stage_con, 1, 0.05);
98
}
99
if ((miss_timer > 0 || fame <= 2000) && tutorial < 7)
100
{
101
    draw_set_blend_mode(bm_add);
102
    red_glow = miss_timer / 20;
103
    if (fame <= 2000)
104
    {
105
        if (lose_con < 2)
106
            siner++;
107
        red_glow += ((sin((siner / 20) * pi) * 0.25) + 0.25);
108
    }
109
    draw_sprite_ext(spr_rhythmgame_bg_mask, 0, x, y + 100, image_xscale, image_yscale, 0, spotlight_color[1], red_glow);
110
    draw_set_blend_mode(bm_normal);
111
}
112
else if (red_glow > 0)
113
{
114
    red_glow = 0;
115
}
116
var _inv_ease = chart_ease - 1;
117
var _ystart = y + 100 + (16 * image_yscale);
118
draw_sprite_ext(spr_rhythmgame_spotlight, bg_con, x + (16 * image_xscale), _ystart - (50 * chart_ease), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
119
draw_sprite_ext(spr_rhythmgame_spotlight, bg_con, (x + camerawidth()) - (16 * image_xscale), _ystart - (50 * chart_ease), -image_xscale, image_yscale, image_angle, image_blend, image_alpha);
120
if (chart_ease > 0)
121
{
122
    draw_set_halign(fa_center);
123
    draw_set_color(spotlight_color[2]);
124
    draw_set_font(fnt_main);
125
    draw_text_transformed(x + 60 + (110 * _inv_ease), _ystart - 60 - 30, stringsetloc(
POPU
"POPU", "obj_rhythmgame_slash_Draw_0_gml_38_0"
), 2, 2, 0);
126
    draw_text_transformed((x + camerawidth()) - 60 - (110 * _inv_ease), _ystart - 60 - 30, stringsetloc(
LARITY
"LARITY", "obj_rhythmgame_slash_Draw_0_gml_39_0"
), 2, 2, 0);
127
    draw_set_halign(fa_left);
128
    draw_sprite_ext(spr_rhythmgame_spotlight, bg_con, x + (16 * image_xscale) + (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
129
    draw_sprite_ext(spr_rhythmgame_spotlight, bg_con, (x + camerawidth()) - (16 * image_xscale) - (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), -image_xscale, image_yscale, image_angle, image_blend, image_alpha);
130
    draw_sprite_ext(spr_rhythmgame_spotlight, bg_con, x + (16 * image_xscale) + (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
131
    draw_sprite_ext(spr_rhythmgame_spotlight, bg_con, (x + camerawidth()) - (16 * image_xscale) - (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), -image_xscale, image_yscale, image_angle, image_blend, image_alpha);
132
    var _col = spotlight_col(0);
133
    draw_sprite_ext(spr_rhythmgame_spotlight, 5, x + (16 * image_xscale), _ystart - (50 * chart_ease), image_xscale, image_yscale, image_angle, _col, image_alpha);
134
    draw_sprite_ext(spr_rhythmgame_spotlight, 5, (x + camerawidth()) - (16 * image_xscale), _ystart - (50 * chart_ease), -image_xscale, image_yscale, image_angle, _col, image_alpha);
135
    if (fame >= 12000)
136
    {
137
        draw_set_blend_mode(bm_add);
138
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, x + (16 * image_xscale), _ystart - (50 * chart_ease), image_xscale, image_yscale, image_angle, _col, 0.1);
139
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, (x + camerawidth()) - (16 * image_xscale), _ystart - (50 * chart_ease), -image_xscale, image_yscale, image_angle, _col, 0.1);
140
        draw_set_blend_mode(bm_normal);
141
    }
142
    _col = spotlight_col(1);
143
    draw_sprite_ext(spr_rhythmgame_spotlight, 5, x + (16 * image_xscale) + (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), image_xscale, image_yscale, image_angle, _col, image_alpha);
144
    draw_sprite_ext(spr_rhythmgame_spotlight, 5, (x + camerawidth()) - (16 * image_xscale) - (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), -image_xscale, image_yscale, image_angle, _col, image_alpha);
145
    if (fame >= 10000)
146
    {
147
        draw_set_blend_mode(bm_add);
148
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, x + (16 * image_xscale) + (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), image_xscale, image_yscale, image_angle, _col, 0.1);
149
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, (x + camerawidth()) - (16 * image_xscale) - (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), -image_xscale, image_yscale, image_angle, _col, 0.1);
150
        draw_set_blend_mode(bm_normal);
151
    }
152
    _col = spotlight_col(2);
153
    draw_sprite_ext(spr_rhythmgame_spotlight, 5, x + (16 * image_xscale) + (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), image_xscale, image_yscale, image_angle, _col, image_alpha);
154
    draw_sprite_ext(spr_rhythmgame_spotlight, 5, (x + camerawidth()) - (16 * image_xscale) - (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), -image_xscale, image_yscale, image_angle, _col, image_alpha);
155
    if (fame >= 8000)
156
    {
157
        draw_set_blend_mode(bm_add);
158
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, x + (16 * image_xscale) + (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), image_xscale, image_yscale, image_angle, _col, 0.1);
159
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, (x + camerawidth()) - (16 * image_xscale) - (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), -image_xscale, image_yscale, image_angle, _col, 0.1);
160
        draw_set_blend_mode(bm_normal);
161
    }
162
    draw_set_font(fnt_main);
163
    draw_set_halign(fa_left);
164
    draw_set_valign(fa_bottom);
165
    draw_set_color(note_color[0]);
166
    draw_text_outline(x + 110 + (300 * _inv_ease), y + 467, stringsetloc(
SCORE
"SCORE", "obj_rhythmgame_slash_Draw_0_gml_220_0"
), 0);
167
    draw_set_font(fnt_mainbig);
168
    draw_text_outline(x + 20 + (200 * _inv_ease), y + 470, string_format_zero(points + hold_score, 6, 0), 0);
169
    draw_set_font(fnt_main);
170
    draw_set_color(note_color[1]);
171
    draw_set_halign(fa_right);
172
    draw_text_outline((x + 530) - (300 * _inv_ease), y + 467, stringsetloc(
MAX COMBO
"MAX COMBO", "obj_rhythmgame_slash_Draw_0_gml_227_0"
), 0);
173
    draw_set_font(fnt_mainbig);
174
    draw_text_outline((x + 620) - (200 * _inv_ease), y + 470, string_format_zero(max_combo, 6, 0), 0);
175
    draw_set_valign(fa_top);
176
    draw_set_halign(fa_left);
177
    draw_set_font(fnt_main);
178
    draw_set_color(c_white);
179
    if (miss_timer > 0)
180
    {
181
        _col = spotlight_color[1];
182
        draw_set_blend_mode(bm_add);
183
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, x + (16 * image_xscale), _ystart - (50 * chart_ease), image_xscale, image_yscale, image_angle, _col, miss_timer / 20);
184
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, (x + camerawidth()) - (16 * image_xscale), _ystart - (50 * chart_ease), -image_xscale, image_yscale, image_angle, _col, miss_timer / 20);
185
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, x + (16 * image_xscale) + (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), image_xscale, image_yscale, image_angle, _col, miss_timer / 20);
186
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, (x + camerawidth()) - (16 * image_xscale) - (110 * _inv_ease), (_ystart + 60) - (30 * chart_ease), -image_xscale, image_yscale, image_angle, _col, miss_timer / 20);
187
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, x + (16 * image_xscale) + (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), image_xscale, image_yscale, image_angle, _col, miss_timer / 20);
188
        draw_sprite_ext(spr_rhythmgame_spotlight, 6, (x + camerawidth()) - (16 * image_xscale) - (220 * _inv_ease), (_ystart + 120) - (10 * chart_ease), -image_xscale, image_yscale, image_angle, _col, miss_timer / 20);
189
        draw_set_blend_mode(bm_normal);
190
        miss_timer--;
191
    }
192
}
193
_inv_ease = kchart_ease - 1;
194
bottomy = 240 + y + (300 * _inv_ease);
195
var _centerx = 320;
196
var _flashOnly = false;
197
var _notespeed;
198
if ((song_initialized && intro_con >= 2) || kchart_ease > 0)
199
{
200
    _notespeed = notespeed;
201
    var _whiteness = 16777215;
202
    if (invc > 0)
203
        _whiteness = merge_color(c_white, c_red, scr_rhythmgame_damage_flash());
204
    _whiteness = merge_color(c_black, c_white, brightness);
205
    scr_rhythmgame_draw_backing(_notespeed, _centerx);
206
    draw_sprite_ext(spr_rhythmgame_button, 0, _centerx - 20, bottomy, 1, 1, 0, _whiteness, 1);
207
    draw_sprite_ext(spr_rhythmgame_button, 1, _centerx + 20, bottomy, 1, 1, 0, _whiteness, 1);
208
    d3d_set_fog(true, _whiteness, 0, 1);
209
    draw_sprite_ext(spr_rhythmgame_button, 0, _centerx - 20, bottomy, 1, 1, 0, c_white, note_hit_timer[0] / 5);
210
    draw_sprite_ext(spr_rhythmgame_button, 1, _centerx + 20, bottomy, 1, 1, 0, c_white, note_hit_timer[1] / 5);
211
    d3d_set_fog(false, c_black, 0, 0);
212
    draw_set_color(c_white);
213
    var _xstart = (instrument == 2) ? 270 : 280;
214
    var _xwidth = (instrument == 2) ? 30 : 40;
215
    scr_rhythmgame_draw_combo(_centerx);
216
    scr_rhythmgame_draw_chart(_notespeed, _centerx, false);
217
    scr_rhythmgame_draw_border(_centerx);
218
    draw_set_color(c_white);
219
    if (tutorial > 0)
220
    {
221
        if (tutorial >= 4)
222
        {
223
            if (timer > 0)
224
                timer -= 0.1;
225
        }
226
        else if (tutorial >= 2)
227
        {
228
            if (timer < 1)
229
                timer += 0.1;
230
        }
231
        var _buttonalpha = clamp01(timer);
232
        if (chart_lerp < 1 && _buttonalpha > 0)
233
        {
234
            var _sin = sin((trackpos / meter) * pi * 2) * 12;
235
            draw_set_halign(fa_center);
236
            var _chart_extra = (1 - chart_lerp) * _buttonalpha;
237
            draw_set_alpha(_chart_extra);
238
            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); }
("main"));
239
            var _played = note_hit_timer[0] > 0;
240
            var _col = _played ? 65535 : 16777215;
241
            draw_set_color(_col);
242
            draw_set_halign(fa_right);
243
            draw_set_valign(fa_bottom);
244
            var _pressmsg = string_hash_to_newline(stringsetloc(
THIS IS#THE BUTTON#YOU WOULD#PRESS IN#THE REAL#SONG BUT#THIS IS#AN AUTO-#MATICALLY#PLAYING#DEMO
"THIS IS#THE BUTTON#YOU WOULD#PRESS IN#THE REAL#SONG BUT#THIS IS#AN AUTO-#MATICALLY#PLAYING#DEMO", "obj_rhythmgame_slash_Draw_0_gml_313_0"
));
245
            draw_text_transformed(_centerx - 52, bottomy - 10, _pressmsg, 1, 1, 0);
246
            draw_sprite_ext(spr_sneo_bullet_arrow, 0, _centerx - 54 - (abs(_sin) * (1 - _played)), bottomy - 2, 2, 2, 0, _col, _chart_extra);
247
            _played = note_hit_timer[1] > 0;
248
            _col = _played ? 65535 : 16777215;
249
            draw_set_color(_col);
250
            draw_set_halign(fa_left);
251
            draw_text_transformed(_centerx + 52, bottomy - 10, _pressmsg, 1, 1, 0);
252
            draw_sprite_ext(spr_sneo_bullet_arrow, 0, _centerx + 56 + (abs(_sin) * (1 - _played)), bottomy - 2, -2, 2, 0, _col, _chart_extra);
253
            _col = 16777215;
254
            draw_set_alpha(1);
255
            draw_set_halign(fa_left);
256
            draw_set_valign(fa_top);
257
        }
258
        draw_rhythm_buttons(_centerx, _whiteness, _buttonalpha);
259
        if (tutorial >= 4)
260
        {
261
            if (tutorial >= 5)
262
            {
263
                fade = 
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); } }
(fade, 0, 0.05);
264
                draw_set_color(merge_color(c_gray, c_black, fade));
265
                draw_set_blend_mode(bm_subtract);
266
                ossafe_fill_rectangle(_centerx - 40, bottomy - 200, _centerx + 40, bottomy + 50);
267
                draw_set_blend_mode(bm_normal);
268
                if (fade <= 0 || (fade % 0.25) > 0.125)
269
                    draw_sprite_ext(spr_rhythmgame_mute, 0, _centerx, bottomy - 75, 1, 1, 0, merge_color(c_black, c_white, brightness), 1);
270
            }
271
            if (fame <= 2000)
272
            {
273
                if (tutorial == 6 && fame > 0)
274
                {
275
                    if (invc <= 0)
276
                        missnotecon = 1;
277
                }
278
                else
279
                {
280
                    _flashOnly = true;
281
                    if (tutorial == 5)
282
                        invc = 0;
283
                }
284
            }
285
        }
286
    }
287
    else if (button_alpha > 0)
288
    {
289
        var _buttonalpha = 1;
290
        if (button_alpha > 0)
291
            button_alpha -= 0.05;
292
        _buttonalpha = max(0, button_alpha);
293
        draw_rhythm_buttons(_centerx, 16777215, _buttonalpha);
294
    }
295
    if (tenna_boss && speed_modifier >= 2)
296
    {
297
        var _shake = max(0, (speed_modifier - 2) * 1.5);
298
        var _sx = random_range(-1, 1) * _shake;
299
        var _sy = random_range(-1, 1) * _shake;
300
        draw_set_color(#330000);
301
        draw_text_transformed(_centerx + 50 + 2 + _sx, bottomy + 15 + 2 + _sy, string_format_auto(speed_modifier, 1) + "x", 2, 2, 0);
302
        draw_text_transformed(_centerx + 50 + 2 + _sx, bottomy + 40 + 2 + _sy, stringsetloc(
SPEED
"SPEED", "obj_rhythmgame_slash_Draw_0_gml_415_0"
), 1, 1, 0);
303
        draw_set_color(c_red);
304
        draw_text_transformed(_centerx + 50 + _sx, bottomy + 15 + _sy, string_format_auto(speed_modifier, 1) + "x", 2, 2, 0);
305
        draw_text_transformed(_centerx + 50 + _sx, bottomy + 40 + _sy, stringsetloc(
SPEED
"SPEED", "obj_rhythmgame_slash_Draw_0_gml_418_0"
), 1, 1, 0);
306
    }
307
    if (lose_con >= 1)
308
    {
309
        fade = 
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); } }
(fade, 0, 0.05);
310
        draw_set_color(merge_color(c_gray, c_black, fade));
311
        draw_set_blend_mode(bm_subtract);
312
        ossafe_fill_rectangle(_centerx - 40, bottomy - 200, _centerx + 40, bottomy + 50);
313
        draw_set_blend_mode(bm_normal);
314
        if (fade <= 0 || (fade % 0.25) > 0.125)
315
            draw_sprite_ext(spr_rhythmgame_mute, 0, _centerx, bottomy - 75, 1, 1, 0, merge_color(c_black, c_white, brightness), 0);
316
    }
317
    _inv_ease = chart_ease - 1;
318
    bottomy = 240 + y + (300 * _inv_ease);
319
    if (brightness != target_brightness)
320
        brightness = 
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); } }
(brightness, target_brightness, 0.025);
321
    with (obj_rhythmgame_chart)
322
    {
323
        if (brightness != target_brightness)
324
            brightness = 
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); } }
(brightness, target_brightness, 0.025);
325
    }
326
    if (tutorial == 3)
327
    {
328
        target_brightness = 0.5;
329
    }
330
    else if (tutorial == 4 || tutorial == 5)
331
    {
332
        with (obj_rhythmgame_chart)
333
        {
334
            if (instrument == 2)
335
                target_brightness = 0.5;
336
        }
337
        target_brightness = 1;
338
    }
339
    else if (tutorial == 6)
340
    {
341
        with (obj_rhythmgame_chart)
342
        {
343
            if (instrument == 1)
344
                target_brightness = 1;
345
            else
346
                target_brightness = 0.5;
347
        }
348
        target_brightness = 0.5;
349
    }
350
    else if (tutorial > 0)
351
    {
352
        with (obj_rhythmgame_chart)
353
            target_brightness = 1;
354
        target_brightness = 1;
355
    }
356
    with (obj_rhythmgame_chart)
357
    {
358
        bottomy = other.bottomy;
359
        trackpos = other.trackpos;
360
        
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 _name, _hoff; if (instrument == 0) { _name = _jp ? spr_ja_bnamekris : spr_bnamekris; _hoff = 21; } else if (instrument == 1) { _name = _jp ? spr_ja_bnamesusie : spr_bnamesusie; _hoff = 24; } else if (instrument == 2) { _name = _jp ? spr_ja_bnameralsei : spr_bnameralsei; _hoff = 30; } draw_sprite_ext(_name, 0, arg0 - _hoff, bottomy - 230, 1, 1, 0, draw_get_color(), 1); } ossafe_fill_rectangle(arg0 - 40, bottomy - 200, arg0 + 40, bottomy + 50, true); ossafe_fill_rectangle(arg0 - 41, bottomy - 201, arg0 + 41, bottomy + 51, true); } function scr_rhythmgame_draw_combo(arg0) { if (combo > 0) { draw_set_halign(fa_center); draw_set_font(fnt_main); var _combotext = (combo > 999) ? stringsetloc(
BIG
"BIG", "scr_rhythmgame_draw_slash_scr_rhythmgame_draw_gml_125_0"
) : combo;
draw_text_transformed_color(arg0 + 2, bottomy - 121, _combotext, (combo >= 100) ? 3.5 : 5, 5, 0, #666666, #666666, #BBBBBB, #BBBBBB, 0.25); 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);
...
(_notespeed, 170 + ((instrument - 1) * 300));
361
    }
362
}
363
with (obj_rhythmgame_chart)
364
{
365
    if (other.tutorial == 6 && other.fame <= 0)
366
        fade = 
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); } }
(fade, 0, 0.05);
367
    bottomy = other.bottomy;
368
    var _cen = 170 + ((instrument - 1) * 300);
369
    if (instrument == 1 && fade < 1 && (other.song_id <= 1 || other.tutorial > 0) && trackpos > 0)
370
    {
371
        draw_set_color(merge_color(c_gray, c_black, fade));
372
        draw_set_blend_mode(bm_subtract);
373
        ossafe_fill_rectangle(_cen - 40, bottomy - 200, _cen + 40, bottomy + 50);
374
        draw_set_blend_mode(bm_normal);
375
        if (fade <= 0 || (fade % 0.25) > 0.125)
376
            draw_sprite_ext(spr_rhythmgame_mute, 0, _cen, bottomy - 75, 1, 1, 0, merge_color(c_black, c_white, brightness), 1);
377
    }
378
    if (other.intro_con >= 2 || other.kchart_ease > 0 || other.tutorial > 0)
379
        scr_rhythmgame_draw_border(_cen);
380
}
381
_inv_ease = kchart_ease - 1;
382
bottomy = 240 + y + (300 * _inv_ease);
383
if (!song_initialized && !tutorial)
384
    exit;
385
if (tutorial > 0 && tutorial <= 3)
386
    missnotecon = 0;
387
if (missnotecon == 1 && lose_con == 0)
388
{
389
    var _susie = fixed_penalty != 0;
390
    if (invc <= 0)
391
    {
392
        if (!_flashOnly && !_susie)
393
            snd_play_x(snd_hurt1, 0.6, 0.9);
394
        if (_susie && fixed_penalty > 0)
395
        {
396
            if (fade < 1 || fame > 2000 || song_id == 1)
397
            {
398
                fame -= fixed_penalty;
399
                total_fame -= fixed_penalty;
400
            }
401
        }
402
        else if (!_flashOnly)
403
        {
404
            var _penalty = ((fame <= 2000) ? 100 : 200) * difficulty * fame_mul;
405
            if (_susie && fade == 1)
406
            {
407
                if (fame <= 2000)
408
                    _penalty = 0;
409
                else
410
                    _penalty = min(_penalty, fame - 2000);
411
            }
412
            fame -= _penalty;
413
            total_fame -= _penalty;
414
            if (fame < 0)
415
                event_user(5);
416
        }
417
    }
418
    if (!_susie)
419
        combo = 0;
420
    if (tenna_boss)
421
    {
422
    }
423
    else if (!_susie && !tenna_boss)
424
    {
425
        if (oneAtATime)
426
            mus_volume(track1_main, 1, 0);
427
        mus_volume(track2_main, 0, 0);
428
    }
429
    missnotecon = 2;
430
    missnotetimer = 0;
431
    if (_susie)
432
    {
433
        miss_timer = 10;
434
    }
435
    else if (invc <= 0 && !_flashOnly)
436
    {
437
        if (tenna_boss && i_ex(obj_tenna_zoom) && obj_tenna_zoom.con > 1)
438
        {
439
        }
440
        if (tenna_boss)
441
        {
442
            global.inv = -1;
443
            obj_tenna_enemy.minigamefailcount++;
444
            if (obj_tenna_enemy.minigamefailcount > 2 && obj_tenna_zoom.con != 2 && obj_tenna_zoom.minigameinsanity == false)
445
            {
446
                with (obj_tenna_zoom)
447
                {
448
                    con = 2;
449
                    timer = -30;
450
                }
451
            }
452
        }
453
        hurt_counter++;
454
        miss_timer = 10;
455
        if (fade == 1)
456
            hurt_flash = 12;
457
        with (performer)
458
            shakeamt = 10;
459
        if (tenna_boss || hardmode)
460
            invc = 20;
461
        else
462
            invc = tutorial ? 6 : 60;
463
    }
464
    fixed_penalty = 0;
465
}
466
else if (invc > 0)
467
{
468
    invc--;
469
    hurt_flash--;
470
}
471
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
472
{
473
    if (keyboard_check_pressed(ord("Z")))
474
        lineA = trackpos;
475
    if (keyboard_check_pressed(ord("X")))
476
        lineB = trackpos;
477
}
478
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && show_debug)
479
{
480
    if (lineA > 0)
481
    {
482
        var lineA_line = bottomy + ((trackpos - lineA) * _notespeed);
483
        ossafe_fill_rectangle(250, lineA_line - 1, 310, lineA_line + 1);
484
    }
485
    if (lineB > 0)
486
    {
487
        var lineB_line = bottomy + ((trackpos - lineB) * _notespeed);
488
        ossafe_fill_rectangle(320, lineB_line - 1, 380, lineB_line + 1);
489
    }
490
    draw_set_color(c_red);
491
    draw_text(0, 0, "track pos: " + string(trackpos) + " / " + string(track_length));
492
    draw_text(0, 30, "fame: " + string(fame) + " / 12600");
493
    draw_text(0, 60, notetime[0]);
494
    draw_text(0, 90, trackpos / meter);
495
}
496
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && global.chemg_show_val)
497
{
498
    draw_set_alpha(1);
499
    draw_set_color(c_white);
500
    if (fps < 30)
501
        draw_set_color(c_red);
502
    var cx = camerax() + 268;
503
    var cy = cameray() + 290;
504
    draw_text_outline(cx, cy, "FPS: " + string(fps));
505
    draw_text_outline(cx, cy + 12, "FPS_real: " + string(fps_real));
506
    draw_set_halign(fa_left);
507
    draw_set_valign(fa_top);
508
}