1 |
if (!instance_exists(obj_heart_battle_fighting_parent)) |
2 |
{ |
3 |
instance_destroy(); |
4 |
exit; |
5 |
} |
6 |
if (state == 0) |
7 |
{ |
8 |
if (image_alpha < 1 && can_move == false) |
9 |
{ |
10 |
image_alpha += 0.1; |
11 |
if (image_alpha > 1) |
12 |
image_alpha = 1; |
13 |
if (image_alpha == 1) |
14 |
{ |
15 |
can_move = true; |
16 |
alarm[0] = 30 + (irandom_range(0, 3) * 10);gml_Object_obj_battle_enemy_attack_martlet_feather_fall_feather_Alarm_0.gmlx_destination = obj_heart_battle_fighting_parent.x;
y_destination = obj_heart_battle_fighting_parent.y;
angle_destination = point_direction(x, y, obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y);
if (angle_difference(image_angle, angle_destination) > 0)
spin_direction = 1;
else
spin_direction = -1;
obj_battle_enemy_attack_martlet_feather_fall_checker.x_store = x_destination;
obj_battle_enemy_attack_martlet_feather_fall_checker.y_store = y_destination;
obj_battle_enemy_attack_martlet_feather_fall_checker.angle_store = angle_destination;
global.id_store = id;
with (instance_create(x_destination, y_destination, obj_battle_enemy_attack_martlet_feather_fall_target_1_axis))
geno_target_angle = other.explosion_angle;
id_target = global.id_store;
state = 1;
switch (sprite_index)
{
case spr_battle_enemy_attack_martlet_feather_1:
audio_play_sound(snd_mart_feather_atk3, 20, 0);
break;
case spr_battle_enemy_attack_martlet_feather_2:
case spr_battle_enemy_attack_martlet_feather_3:
audio_play_sound(snd_mart_feather_atk1, 20, 0);
break;
case spr_battle_enemy_attack_martlet_feather_4:
case spr_battle_enemy_attack_martlet_feather_5:
audio_play_sound(snd_mart_feather_atk2, 20, 0);
break;
default:
audio_play_sound(snd_mart_feather_atk1, 20, 0);
} |
17 |
} |
18 |
} |
19 |
if (can_move == true) |
20 |
{ |
21 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
22 |
animation_disjoint_x = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
23 |
time_elapsed += time_increase; |
24 |
if (time_elapsed >= time_max) |
25 |
{ |
26 |
time_elapsed = 0; |
27 |
sign_modifier = -sign_modifier; |
28 |
} |
29 |
var time_elapsed_fall = time_elapsed + time_elapsed_increase_fall; |
30 |
if (time_elapsed_fall > time_max) |
31 |
{ |
32 |
time_elapsed_fall -= time_max; |
33 |
sign_modifier_fall = -sign_modifier; |
34 |
} |
35 |
else |
36 |
{ |
37 |
sign_modifier_fall = sign_modifier; |
38 |
} |
39 |
game_maker_cannot_do_math = power((time_elapsed_fall / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
40 |
animation_disjoint_fall = sign_modifier_fall * (max_rise - game_maker_cannot_do_math); |
41 |
x_point_fall = starting_position_x + animation_disjoint_fall; |
42 |
x_point = starting_position_x + animation_disjoint_x; |
43 |
animation_disjoint_y += (fall_speed * (1 - abs((x_point_fall - starting_position_x) / max_rise))); |
44 |
y_point = round(starting_position_y + animation_disjoint_y); |
45 |
} |
46 |
position_factor = (x_point - starting_position_x) / max_rise; |
47 |
angle_pos = angle_pos_default + (angle_pos_max * position_factor); |
48 |
x = x_point + (angle_radius * cos(angle_pos * 0.008726646259971648)); |
49 |
y = y_point - (angle_radius * sin(angle_pos * 0.008726646259971648)); |
50 |
image_angle = angle_pos + 90; |
51 |
} |
52 |
else if (state == 1) |
53 |
{ |
54 |
if (image_angle != angle_destination) |
55 |
image_angle += (spin_speed * spin_direction); |
56 |
var angle_diff = angle_difference(image_angle, angle_destination); |
57 |
if ((angle_diff * spin_direction) < 0) |
58 |
image_angle = angle_destination; |
59 |
if (image_angle == angle_destination && no_loop_spin == false) |
60 |
{ |
61 |
image_speed = 0.5; |
62 |
alarm[1] = 15; |
63 |
no_loop_spin = true; |
64 |
} |
65 |
} |
66 |
else if (state == 2) |
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 |
ds_list_add(angle_list, image_angle); |
80 |
while (ds_list_size(x_list) > max_points_trail) |
81 |
{ |
82 |
ds_list_delete(x_list, 0); |
83 |
ds_list_delete(y_list, 0); |
84 |
ds_list_delete(angle_list, 0); |
85 |
} |
86 |
} |
87 |
x += lengthdir_x(attack_speed, image_angle); |
88 |
y += lengthdir_y(attack_speed, image_angle); |
89 |
if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == false) |
90 |
in_box = true; |
91 |
if (!place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == true) |
92 |
{ |
93 |
if (image_alpha > 0) |
94 |
{ |
95 |
image_alpha -= 0.1; |
96 |
if (image_alpha < 0) |
97 |
image_alpha = 0; |
98 |
if (image_alpha == 0) |
99 |
instance_destroy(); |
100 |
} |
101 |
} |
102 |
if (!instance_exists(obj_martlet_body)) |
103 |
{ |
104 |
if (distance_to_point(id_target.x, id_target.y) <= ((attack_speed / 2) + 1)) |
105 |
{ |
106 |
id_feather_explosion = instance_create(id_target.x, id_target.y, obj_battle_enemy_attack_martlet_genocide_feather_ext_checker); |
107 |
id_feather_explosion.fcreate_angle_diff = explosion_angle; |
108 |
instance_destroy(); |
109 |
} |
110 |
} |
111 |
} |