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 |
show_debug_message("Flier died") |
8 |
x = starting_point_x |
9 |
y = starting_point_y |
10 |
instance_create(starting_point_x, starting_point_y, obj_flier_dead) |
11 |
instance_destroy() |
12 |
return; |
13 |
} |
14 |
else if (enemy_spared == true) |
15 |
{ |
16 |
sprite_index = spr_flier_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 |
damage_disjoint_count -= 1 |
29 |
else if (enemy_dead == false && enemy_spared == false) |
30 |
{ |
31 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
32 |
sprite_index = spr_flier_critical |
33 |
else |
34 |
sprite_index = spr_flier |
35 |
image_speed = 0.5 |
36 |
} |
37 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
38 |
{ |
39 |
time_elapsed = 0 |
40 |
sign_modifier = -1 |
41 |
damage_disjoint_count = 12 |
42 |
no_loop_damage_disjoint_count = true |
43 |
audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch) |
44 |
} |
45 |
else if (!instance_exists(obj_text_damage_count)) |
46 |
no_loop_damage_disjoint_count = false |
47 |
if (damage_disjoint_count == 12) |
48 |
damage_disjoint_x = -50 |
49 |
else if (damage_disjoint_count == 10) |
50 |
damage_disjoint_x = 50 |
51 |
else if (damage_disjoint_count == 8) |
52 |
damage_disjoint_x = -20 |
53 |
else if (damage_disjoint_count == 6) |
54 |
damage_disjoint_x = 20 |
55 |
else if (damage_disjoint_count == 4) |
56 |
damage_disjoint_x = -10 |
57 |
else if (damage_disjoint_count == 2) |
58 |
damage_disjoint_x = 10 |
59 |
else if (damage_disjoint_count == 0) |
60 |
damage_disjoint_x = 0 |
61 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
62 |
sprite_index = spr_flier_dead |
63 |
x = draw_position_x + damage_disjoint_x |
64 |
y = draw_position_y + damage_disjoint_y |
65 |
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false) |
66 |
{ |
67 |
game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2) |
68 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)) |
69 |
time_elapsed += time_increase |
70 |
if (time_elapsed >= time_max) |
71 |
{ |
72 |
time_elapsed = 0 |
73 |
sign_modifier = (-sign_modifier) |
74 |
} |
75 |
y = draw_position_y + animation_disjoint_y |
76 |
} |