1 |
var enemy_dead = global.enemy_dead; |
2 |
var enemy_spared = global.enemy_spared; |
3 |
if (enemy_dead == false && enemy_spared == false) |
4 |
image_alpha = global.image_alpha_enemy_attacking; |
5 |
if (enemy_dead == true) |
6 |
{ |
7 |
x = starting_point_x; |
8 |
y = starting_point_y; |
9 |
instance_create(starting_point_x, starting_point_y, obj_know_cone_dead); |
10 |
instance_destroy(); |
11 |
exit; |
12 |
image_alpha = 0.5; |
13 |
} |
14 |
else if (enemy_spared == true) |
15 |
{ |
16 |
sprite_index = spr_know_cone_spared; |
17 |
x = starting_point_x; |
18 |
y = starting_point_y; |
19 |
image_alpha = 0.5; |
20 |
if (no_loop_create_clouds == false) |
21 |
{ |
22 |
for (i = 0; i <= 11; i += 1) |
23 |
instance_create(x, y, obj_spare_cloud); |
24 |
} |
25 |
no_loop_create_clouds = true; |
26 |
} |
27 |
if (damage_disjoint_count > 0) |
28 |
{ |
29 |
damage_disjoint_count -= 1; |
30 |
} |
31 |
else if (enemy_dead == false && enemy_spared == false) |
32 |
{ |
33 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
34 |
sprite_index = spr_know_cone_body_critical; |
35 |
else |
36 |
sprite_index = spr_know_cone_body; |
37 |
} |
38 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
39 |
{ |
40 |
time_elapsed = 0; |
41 |
sign_modifier = -1; |
42 |
damage_disjoint_count = 12; |
43 |
no_loop_damage_disjoint_count = true; |
44 |
audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch); |
45 |
} |
46 |
else if (!instance_exists(obj_text_damage_count)) |
47 |
{ |
48 |
no_loop_damage_disjoint_count = false; |
49 |
} |
50 |
if (damage_disjoint_count == 12) |
51 |
damage_disjoint_x = -50; |
52 |
else if (damage_disjoint_count == 10) |
53 |
damage_disjoint_x = 50; |
54 |
else if (damage_disjoint_count == 8) |
55 |
damage_disjoint_x = -20; |
56 |
else if (damage_disjoint_count == 6) |
57 |
damage_disjoint_x = 20; |
58 |
else if (damage_disjoint_count == 4) |
59 |
damage_disjoint_x = -10; |
60 |
else if (damage_disjoint_count == 2) |
61 |
damage_disjoint_x = 10; |
62 |
else if (damage_disjoint_count == 0) |
63 |
damage_disjoint_x = 0; |
64 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
65 |
sprite_index = spr_know_cone_dead; |
66 |
x = draw_position_x + damage_disjoint_x; |
67 |
y = draw_position_y + damage_disjoint_y; |
68 |
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false) |
69 |
{ |
70 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
71 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
72 |
y = draw_position_y + animation_disjoint_y; |
73 |
var y_store = y; |
74 |
var time_elapsed_ball = time_elapsed - time_elapsed_decrease_ball; |
75 |
if (time_elapsed_ball < 0) |
76 |
{ |
77 |
time_elapsed_ball += time_max; |
78 |
sign_modifier_ball = -sign_modifier; |
79 |
} |
80 |
else |
81 |
{ |
82 |
sign_modifier_ball = sign_modifier; |
83 |
} |
84 |
game_maker_cannot_do_math = power((time_elapsed_ball / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
85 |
animation_disjoint_y = sign_modifier_ball * (max_rise - game_maker_cannot_do_math); |
86 |
y = draw_position_y + animation_disjoint_y; |
87 |
ball_displacement_y = y - ball_displacement_y_value; |
88 |
y = y_store; |
89 |
time_elapsed += time_increase; |
90 |
if (time_elapsed >= time_max) |
91 |
{ |
92 |
time_elapsed = 0; |
93 |
sign_modifier = -sign_modifier; |
94 |
} |
95 |
animating = true; |
96 |
} |
97 |
else |
98 |
{ |
99 |
animating = false; |
100 |
} |