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

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

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