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(gml_Script_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 |
buffer_current = 0 |
59 |
if instance_exists(obj_heart_battle_effect_glow) |
60 |
{ |
61 |
obj_heart_battle_effect_glow.x = x |
62 |
obj_heart_battle_effect_glow.y = y |
63 |
} |
64 |
if (moveable == true && global.current_sp_self > 0) |
65 |
{ |
66 |
var can_trail = false |
67 |
trail_cc_current += 1 |
68 |
if (trail_cc_current >= trail_cc_max) |
69 |
{ |
70 |
can_trail = true |
71 |
trail_cc_current = 0 |
72 |
} |
73 |
if (can_trail == true) |
74 |
{ |
75 |
ds_list_add(x_list, x) |
76 |
ds_list_add(y_list, y) |
77 |
while (ds_list_size(x_list) > max_points_trail) |
78 |
{ |
79 |
ds_list_delete(x_list, 0) |
80 |
ds_list_delete(y_list, 0) |
81 |
} |
82 |
} |
83 |
} |
84 |
event_user(15) |