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