1 |
if (state == 0) |
2 |
{ |
3 |
if (image_alpha < 1 && can_fade_in == true) |
4 |
{ |
5 |
image_alpha += 0.1 |
6 |
if (image_alpha > 1) |
7 |
image_alpha = 1 |
8 |
} |
9 |
} |
10 |
if (state == 1) |
11 |
{ |
12 |
var can_trail = false |
13 |
trail_cc_current += 1 |
14 |
if (trail_cc_current >= trail_cc_max) |
15 |
{ |
16 |
can_trail = true |
17 |
trail_cc_current = 0 |
18 |
} |
19 |
if (can_trail == true) |
20 |
{ |
21 |
ds_list_add(x_list, x) |
22 |
ds_list_add(y_list, y) |
23 |
ds_list_add(angle_list, image_angle) |
24 |
while (ds_list_size(x_list) > max_points_trail) |
25 |
{ |
26 |
ds_list_delete(x_list, 0) |
27 |
ds_list_delete(y_list, 0) |
28 |
ds_list_delete(angle_list, 0) |
29 |
} |
30 |
} |
31 |
var spin_radius_speed_last = spin_radius_speed |
32 |
game_maker_cannot_do_math = power((time_elapsed_spin / (time_max_spin / 2 * (1 / sqrt(max_rise_spin))) - sqrt(max_rise_spin)), 2) |
33 |
spin_radius_speed = sign_modifier_spin * (max_rise_spin - round(game_maker_cannot_do_math)) |
34 |
time_elapsed_spin += time_increase_spin |
35 |
if (time_elapsed_spin >= time_max_spin) |
36 |
{ |
37 |
time_elapsed_spin = 0 |
38 |
sign_modifier_spin = (-sign_modifier_spin) |
39 |
} |
40 |
spin_angle_speed = spin_radius_speed_multiplier * (spin_radius_speed - spin_radius_speed_last) |
41 |
image_angle += spin_angle_speed |
42 |
x = spin_default_x + (lengthdir_x(spin_radius_speed, spin_direction)) |
43 |
y = spin_default_y + (lengthdir_y(spin_radius_speed, spin_direction)) |
44 |
if (time_elapsed_spin >= (time_max_spin / 2)) |
45 |
event_user(2) |
46 |
} |
47 |
else if (state == 2) |
48 |
{ |
49 |
if (ds_list_size(x_list) > 0) |
50 |
{ |
51 |
ds_list_delete(x_list, 0) |
52 |
ds_list_delete(y_list, 0) |
53 |
ds_list_delete(angle_list, 0) |
54 |
} |
55 |
if (image_angle != angle_destination) |
56 |
image_angle += (target_speed * target_direction) |
57 |
var angle_diff = angle_difference(image_angle, angle_destination) |
58 |
if ((angle_diff * target_direction) < 0) |
59 |
image_angle = angle_destination |
60 |
if (image_angle == angle_destination && no_loop_target == false) |
61 |
{ |
62 |
image_speed = 0.5 |
63 |
alarm[1] = 15alarm[1]image_speed = 0
image_index = 0
state = 3 |
64 |
no_loop_target = true |
65 |
} |
66 |
} |
67 |
else if (state == 3) |
68 |
{ |
69 |
can_trail = false |
70 |
trail_cc_current += 1 |
71 |
if (trail_cc_current >= trail_cc_max) |
72 |
{ |
73 |
can_trail = true |
74 |
trail_cc_current = 0 |
75 |
} |
76 |
if (can_trail == true) |
77 |
{ |
78 |
ds_list_add(x_list, x) |
79 |
ds_list_add(y_list, y) |
80 |
ds_list_add(angle_list, image_angle) |
81 |
while (ds_list_size(x_list) > max_points_trail) |
82 |
{ |
83 |
ds_list_delete(x_list, 0) |
84 |
ds_list_delete(y_list, 0) |
85 |
ds_list_delete(angle_list, 0) |
86 |
} |
87 |
} |
88 |
x += lengthdir_x(attack_speed, image_angle) |
89 |
y += lengthdir_y(attack_speed, image_angle) |
90 |
if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == false) |
91 |
in_box = true |
92 |
if ((!(place_meeting(x, y, obj_dialogue_box_battle_transformation_any))) && in_box == true) |
93 |
{ |
94 |
if (image_alpha > 0) |
95 |
{ |
96 |
image_alpha -= 0.1 |
97 |
if (image_alpha < 0) |
98 |
image_alpha = 0 |
99 |
if (image_alpha == 0) |
100 |
instance_destroy() |
101 |
} |
102 |
} |
103 |
if (!instance_exists(obj_martlet_body)) |
104 |
{ |
105 |
if (distance_to_point(id_target.x, id_target.y) <= (attack_speed / 2 + 1)) |
106 |
{ |
107 |
instance_create(id_target.x, id_target.y, obj_battle_enemy_attack_martlet_genocide_feather_ext_checker) |
108 |
instance_destroy() |
109 |
} |
110 |
} |
111 |
} |