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 |
instance_destroy(); |
8 |
exit; |
9 |
image_alpha = 0.5; |
10 |
} |
11 |
else if (enemy_spared == true) |
12 |
{ |
13 |
x = starting_point_x; |
14 |
y = starting_point_y; |
15 |
image_alpha = 0.5; |
16 |
if (no_loop_create_clouds == false) |
17 |
{ |
18 |
for (i = 0; i <= 11; i += 1) |
19 |
instance_create(x, y - 60, obj_spare_cloud); |
20 |
} |
21 |
no_loop_create_clouds = true; |
22 |
instance_destroy(); |
23 |
exit; |
24 |
} |
25 |
if (damage_disjoint_count > 0) |
26 |
{ |
27 |
damage_disjoint_count -= 1; |
28 |
} |
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_sweet_corn_cob_critical; |
33 |
else |
34 |
sprite_index = spr_sweet_corn_cob; |
35 |
} |
36 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
37 |
{ |
38 |
time_elapsed_x = 0; |
39 |
time_elapsed_y = 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 |
{ |
47 |
no_loop_damage_disjoint_count = false; |
48 |
} |
49 |
if (damage_disjoint_count == 12) |
50 |
damage_disjoint_x = -50; |
51 |
else if (damage_disjoint_count == 10) |
52 |
damage_disjoint_x = 50; |
53 |
else if (damage_disjoint_count == 8) |
54 |
damage_disjoint_x = -20; |
55 |
else if (damage_disjoint_count == 6) |
56 |
damage_disjoint_x = 20; |
57 |
else if (damage_disjoint_count == 4) |
58 |
damage_disjoint_x = -10; |
59 |
else if (damage_disjoint_count == 2) |
60 |
damage_disjoint_x = 10; |
61 |
else if (damage_disjoint_count == 0) |
62 |
damage_disjoint_x = 0; |
63 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
64 |
image_alpha = 0; |
65 |
x = draw_position_x + damage_disjoint_x; |
66 |
y = draw_position_y + damage_disjoint_y; |
67 |
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false) |
68 |
{ |
69 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
70 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
71 |
time_elapsed += time_increase; |
72 |
if (time_elapsed >= time_max) |
73 |
time_elapsed = 0; |
74 |
y = draw_position_y + animation_disjoint_y; |
75 |
} |
76 |
else |
77 |
{ |
78 |
time_elapsed = 11; |
79 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
80 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
81 |
y = draw_position_y + animation_disjoint_y; |
82 |
} |