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 |
return; |
9 |
} |
10 |
else if (enemy_spared == true) |
11 |
{ |
12 |
instance_destroy() |
13 |
return; |
14 |
} |
15 |
if (damage_disjoint_count > 0) |
16 |
damage_disjoint_count -= 1 |
17 |
else if (enemy_dead == false && enemy_spared == false) |
18 |
{ |
19 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
20 |
sprite_index = spr_penilla_tail_critical |
21 |
else |
22 |
sprite_index = spr_penilla_tail |
23 |
} |
24 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
25 |
{ |
26 |
time_elapsed = 0 |
27 |
sign_modifier = -1 |
28 |
damage_disjoint_count = 12 |
29 |
no_loop_damage_disjoint_count = true |
30 |
} |
31 |
else if (!instance_exists(obj_text_damage_count)) |
32 |
no_loop_damage_disjoint_count = false |
33 |
if (damage_disjoint_count == 12) |
34 |
damage_disjoint_x = -50 |
35 |
else if (damage_disjoint_count == 10) |
36 |
damage_disjoint_x = 50 |
37 |
else if (damage_disjoint_count == 8) |
38 |
damage_disjoint_x = -20 |
39 |
else if (damage_disjoint_count == 6) |
40 |
damage_disjoint_x = 20 |
41 |
else if (damage_disjoint_count == 4) |
42 |
damage_disjoint_x = -10 |
43 |
else if (damage_disjoint_count == 2) |
44 |
damage_disjoint_x = 10 |
45 |
else if (damage_disjoint_count == 0) |
46 |
damage_disjoint_x = 0 |
47 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
48 |
image_alpha = 0 |
49 |
x = draw_position_x + damage_disjoint_x |
50 |
y = draw_position_y + damage_disjoint_y |
51 |
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && sprite_index == spr_penilla_tail && enemy_dead == false && enemy_spared == false) |
52 |
{ |
53 |
game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2) |
54 |
animation_disjoint = sign_modifier * (max_rise - round(game_maker_cannot_do_math)) |
55 |
time_elapsed += time_increase |
56 |
if (time_elapsed >= time_max) |
57 |
{ |
58 |
time_elapsed = 0 |
59 |
sign_modifier = (-sign_modifier) |
60 |
} |
61 |
image_angle = animation_disjoint - max_rise |
62 |
} |
63 |
else |
64 |
image_angle = 0 |