1 |
if (instance_exists(obj_sme_yellow_rhythm_generator) && !instance_exists(obj_sme_yellow_rhythm_selection) && created_selection == false && moveable == true) |
2 |
{ |
3 |
instance_create(x, obj_dialogue_box_battle_transformation_any.bbox_top + 179, obj_sme_yellow_rhythm_selection); |
4 |
created_selection = true; |
5 |
} |
6 |
script_execute(scr_controls_battle_heart_yellow_rhythm); |
7 |
x_previous = x; |
8 |
move_x = -key_left + key_right; |
9 |
y = pos_y; |
10 |
if (move_x < 0) |
11 |
x = pos_x_left; |
12 |
else if (move_x > 0) |
13 |
x = pos_x_right; |
14 |
else |
15 |
x = pos_x_center; |
16 |
if (pos_x_previous != x) |
17 |
{ |
18 |
if (instance_exists(obj_sme_yellow_rhythm_selection)) |
19 |
{ |
20 |
obj_sme_yellow_rhythm_selection.grace_period_current = grace_period_duration; |
21 |
obj_sme_yellow_rhythm_selection.pos_x_previous_selection = pos_x_previous; |
22 |
} |
23 |
pos_x_previous = x; |
24 |
} |
25 |
obj_heart_yellow_rhythm_hitbox.x = x; |
26 |
obj_heart_yellow_rhythm_hitbox.y = y; |
27 |
if (instance_exists(obj_sme_yellow_rhythm_selection)) |
28 |
{ |
29 |
with (obj_sme_yellow_rhythm_selection) |
30 |
event_user(0); |
31 |
} |
32 |
var auto_hit_note = false; |
33 |
if (global.option_autorhythm) |
34 |
{ |
35 |
key_select = 0; |
36 |
key_revert = 0; |
37 |
with (obj_sme_yellow_rhythm_selection) |
38 |
{ |
39 |
if (place_meeting(x, y, obj_sme_yellow_rhythm_note)) |
40 |
auto_hit_note = true; |
41 |
} |
42 |
} |
43 |
if (instance_exists(obj_sme_yellow_rhythm_note)) |
44 |
{ |
45 |
if (key_select || key_revert || auto_hit_note || buffer_current > 0) |
46 |
buffer_current += 1; |
47 |
if (buffer_current >= buffer_max) |
48 |
{ |
49 |
if (instance_exists(obj_sme_yellow_rhythm_selection) && box.sc_dcurrent == 1) |
50 |
{ |
51 |
with (obj_sme_yellow_rhythm_selection) |
52 |
event_user(1); |
53 |
} |
54 |
buffer_current = 0; |
55 |
} |
56 |
} |
57 |
else |
58 |
{ |
59 |
buffer_current = 0; |
60 |
} |
61 |
if (instance_exists(obj_heart_battle_effect_glow)) |
62 |
{ |
63 |
obj_heart_battle_effect_glow.x = x; |
64 |
obj_heart_battle_effect_glow.y = y; |
65 |
} |
66 |
if (moveable == true && global.current_sp_self > 0) |
67 |
{ |
68 |
var can_trail = false; |
69 |
trail_cc_current += 1; |
70 |
if (trail_cc_current >= trail_cc_max) |
71 |
{ |
72 |
can_trail = true; |
73 |
trail_cc_current = 0; |
74 |
} |
75 |
if (can_trail == true) |
76 |
{ |
77 |
ds_list_add(x_list, x); |
78 |
ds_list_add(y_list, y); |
79 |
while (ds_list_size(x_list) > max_points_trail) |
80 |
{ |
81 |
ds_list_delete(x_list, 0); |
82 |
ds_list_delete(y_list, 0); |
83 |
} |
84 |
} |
85 |
} |
86 |
event_user(15); |