1 |
if live_call() |
2 |
return global.live_result; |
3 |
if (!instance_exists(obj_heart_battle_fighting_parent)) |
4 |
{ |
5 |
instance_destroy() |
6 |
return; |
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 |
sign_modifier_fall = sign_modifier |
34 |
game_maker_cannot_do_math = power((time_elapsed_fall / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2) |
35 |
animation_disjoint_fall = sign_modifier_fall * (max_rise - game_maker_cannot_do_math) |
36 |
x_point_fall = starting_position_x + animation_disjoint_fall |
37 |
x_point = starting_position_x + animation_disjoint_x |
38 |
animation_disjoint_y += (fall_speed * (1 - (abs((x_point_fall - starting_position_x) / max_rise)))) |
39 |
y_point = round(starting_position_y + animation_disjoint_y) |
40 |
} |
41 |
position_factor = (x_point - starting_position_x) / max_rise |
42 |
angle_pos = angle_pos_default + angle_pos_max * position_factor |
43 |
x = x_point + angle_radius * (cos(angle_pos * 0.008726646259971648)) |
44 |
y = y_point - angle_radius * (sin(angle_pos * 0.008726646259971648)) |
45 |
image_angle = angle_pos + 90 |
46 |
} |
47 |
else if (state == 1) |
48 |
{ |
49 |
if (image_angle != angle_destination) |
50 |
image_angle += (spin_speed * spin_direction) |
51 |
var angle_diff = angle_difference(image_angle, angle_destination) |
52 |
if ((angle_diff * spin_direction) < 0) |
53 |
image_angle = angle_destination |
54 |
if (image_angle == angle_destination && no_loop_spin == false) |
55 |
{ |
56 |
image_speed = 0.5 |
57 |
alarm[1] = 15alarm[1]if live_call()
return global.live_result;
image_speed = 0
image_index = 0
state = 2 |
58 |
no_loop_spin = true |
59 |
} |
60 |
} |
61 |
else if (state == 2) |
62 |
{ |
63 |
var can_trail = false |
64 |
trail_cc_current += 1 |
65 |
if (trail_cc_current >= trail_cc_max) |
66 |
{ |
67 |
can_trail = true |
68 |
trail_cc_current = 0 |
69 |
} |
70 |
if (can_trail == true) |
71 |
{ |
72 |
ds_list_add(x_list, x) |
73 |
ds_list_add(y_list, y) |
74 |
ds_list_add(angle_list, image_angle) |
75 |
while (ds_list_size(x_list) > max_points_trail) |
76 |
{ |
77 |
ds_list_delete(x_list, 0) |
78 |
ds_list_delete(y_list, 0) |
79 |
ds_list_delete(angle_list, 0) |
80 |
} |
81 |
} |
82 |
x += lengthdir_x(attack_speed, image_angle) |
83 |
y += lengthdir_y(attack_speed, image_angle) |
84 |
if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == false) |
85 |
in_box = true |
86 |
if ((!(place_meeting(x, y, obj_dialogue_box_battle_transformation_any))) && in_box == true) |
87 |
{ |
88 |
if (image_alpha > 0) |
89 |
{ |
90 |
image_alpha -= 0.1 |
91 |
if (image_alpha < 0) |
92 |
image_alpha = 0 |
93 |
if (image_alpha == 0) |
94 |
instance_destroy() |
95 |
} |
96 |
} |
97 |
if (!instance_exists(obj_martlet_body)) |
98 |
{ |
99 |
if (distance_to_point(id_target.x, id_target.y) <= (attack_speed / 2 + 1)) |
100 |
{ |
101 |
id_feather_explosion = instance_create(x, y, obj_battle_enemy_attack_martlet_feather_ext_checker_final) |
102 |
id_feather_explosion.fcreate_angle_diff = explosion_angle |
103 |
id_feather_explosion.feather_speed = 5 |
104 |
instance_destroy() |
105 |
} |
106 |
} |
107 |
} |
108 |
scr_enemy_attack_bullet_hitscr_enemy_attack_bullet_hitfunction scr_enemy_attack_bullet_hit() //gml_Script_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 != noone)
{
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)
return;
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)
return;
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;
}
} () |
109 |
if bullet_destroy_self |
110 |
{ |
111 |
id_feather_explosion = instance_create(x, y, obj_battle_enemy_attack_martlet_feather_ext_checker_final) |
112 |
explosion_angle = 45 |
113 |
id_feather_explosion.fcreate_angle_diff = explosion_angle |
114 |
id_feather_explosion.feather_speed = 5 |
115 |
instance_destroy() |
116 |
} |