1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
if (!instance_exists(obj_heart_battle_fighting_parent)) |
4 |
{ |
5 |
instance_destroy(); |
6 |
exit; |
7 |
} |
8 |
if (state == 0) |
9 |
{ |
10 |
if (image_alpha < 1) |
11 |
{ |
12 |
image_alpha += 0.1; |
13 |
if (image_alpha > 1) |
14 |
image_alpha = 1; |
15 |
} |
16 |
if (can_move == true) |
17 |
{ |
18 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
19 |
animation_disjoint_x = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
20 |
time_elapsed += time_increase; |
21 |
if (time_elapsed >= time_max) |
22 |
{ |
23 |
time_elapsed = 0; |
24 |
sign_modifier = -sign_modifier; |
25 |
} |
26 |
var time_elapsed_fall = time_elapsed + time_elapsed_increase_fall; |
27 |
if (time_elapsed_fall > time_max) |
28 |
{ |
29 |
time_elapsed_fall -= time_max; |
30 |
sign_modifier_fall = -sign_modifier; |
31 |
} |
32 |
else |
33 |
{ |
34 |
sign_modifier_fall = sign_modifier; |
35 |
} |
36 |
game_maker_cannot_do_math = power((time_elapsed_fall / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
37 |
animation_disjoint_fall = sign_modifier_fall * (max_rise - game_maker_cannot_do_math); |
38 |
x_point_fall = starting_position_x + animation_disjoint_fall; |
39 |
x_point = starting_position_x + animation_disjoint_x; |
40 |
animation_disjoint_y += (fall_speed * (1 - abs((x_point_fall - starting_position_x) / max_rise))); |
41 |
y_point = round(starting_position_y + animation_disjoint_y); |
42 |
} |
43 |
position_factor = (x_point - starting_position_x) / max_rise; |
44 |
angle_pos = angle_pos_default + (angle_pos_max * position_factor); |
45 |
x = x_point + (angle_radius * cos(angle_pos * 0.008726646259971648)); |
46 |
y = y_point - (angle_radius * sin(angle_pos * 0.008726646259971648)); |
47 |
image_angle = angle_pos + 90; |
48 |
} |
49 |
else if (state == 1) |
50 |
{ |
51 |
if (image_angle != angle_destination) |
52 |
image_angle += (spin_speed * spin_direction); |
53 |
var angle_diff = angle_difference(image_angle, angle_destination); |
54 |
if ((angle_diff * spin_direction) < 0) |
55 |
image_angle = angle_destination; |
56 |
if (image_angle == angle_destination && no_loop_spin == false) |
57 |
{ |
58 |
image_speed = 0.5; |
59 |
alarm[1] = 15; |
60 |
no_loop_spin = true; |
61 |
} |
62 |
} |
63 |
else if (state == 2) |
64 |
{ |
65 |
var can_trail = false; |
66 |
trail_cc_current += 1; |
67 |
if (trail_cc_current >= trail_cc_max) |
68 |
{ |
69 |
can_trail = true; |
70 |
trail_cc_current = 0; |
71 |
} |
72 |
if (can_trail == true) |
73 |
{ |
74 |
ds_list_add(x_list, x); |
75 |
ds_list_add(y_list, y); |
76 |
ds_list_add(angle_list, image_angle); |
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 |
ds_list_delete(angle_list, 0); |
82 |
} |
83 |
} |
84 |
x += lengthdir_x(attack_speed, image_angle); |
85 |
y += lengthdir_y(attack_speed, image_angle); |
86 |
if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == false) |
87 |
in_box = true; |
88 |
if (!place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == true) |
89 |
{ |
90 |
if (image_alpha > 0) |
91 |
{ |
92 |
image_alpha -= 0.1; |
93 |
if (image_alpha < 0) |
94 |
image_alpha = 0; |
95 |
if (image_alpha == 0) |
96 |
instance_destroy(); |
97 |
} |
98 |
} |
99 |
if (!instance_exists(obj_martlet_body)) |
100 |
{ |
101 |
if (distance_to_point(id_target.x, id_target.y) <= ((attack_speed / 2) + 1)) |
102 |
{ |
103 |
id_feather_explosion = instance_create(x, y, obj_battle_enemy_attack_martlet_feather_ext_checker_final); |
104 |
id_feather_explosion.fcreate_angle_diff = explosion_angle; |
105 |
id_feather_explosion.feather_speed = 5; |
106 |
instance_destroy(); |
107 |
} |
108 |
} |
109 |
} |
110 |
scr_enemy_attack_bullet_hitscr_enemy_attack_bullet_hitfunction scr_enemy_attack_bullet_hit()
{
if (live_call())
return global.live_result;
if (variable_instance_exists(id, "bullet_hit_draw_timer"))
{
if (bullet_hit_draw_timer > 0)
bullet_hit_draw_timer -= 1;
}
var collider_id = instance_place(x, y, obj_heart_yellow_shot);
if (collider_id != -4)
{
var collider_object_index = collider_id.object_index;
instance_create_depth(collider_id.x, collider_id.bbox_top, -999, obj_heart_yellow_shot_destroy);
if (collider_object_index == 690)
{
if (object_index == obj_ceroba_phase_2_bell)
instance_destroy(collider_id);
if (variable_instance_exists(id, "collider_id_last") && collider_id_last == collider_id)
exit;
if (collider_object_index == 690)
collider_id_last = collider_id;
}
else if (collider_object_index == 2561)
{
if (variable_instance_exists(id, "collider_id_last") && collider_id_last == collider_id)
exit;
collider_id_last = collider_id;
}
else if (!variable_instance_exists(id, "collider_id_last") || collider_id != collider_id_last)
{
collider_id.alarm[0] = 1;
collider_id.image_alpha = 0;
collider_id_last = collider_id;
}
audio_play_sound(snd_arc_hit, 0.1, 0);
if (variable_instance_exists(id, "bullet_hit_points"))
{
bullet_hit_draw_timer = 5;
if (collider_object_index == 690)
bullet_hit_points -= 3;
else
bullet_hit_points -= 1;
if (bullet_hit_points <= 0)
bullet_destroy_self = true;
}
return true;
}
} (); |
111 |
if (bullet_destroy_self) |
112 |
{ |
113 |
id_feather_explosion = instance_create(x, y, obj_battle_enemy_attack_martlet_feather_ext_checker_final); |
114 |
explosion_angle = 45; |
115 |
id_feather_explosion.fcreate_angle_diff = explosion_angle; |
116 |
id_feather_explosion.feather_speed = 5; |
117 |
instance_destroy(); |
118 |
} |