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 |
x = starting_point_x |
13 |
y = starting_point_y |
14 |
image_alpha = 0.5 |
15 |
if (no_loop_create_clouds == false) |
16 |
{ |
17 |
for (i = 0; i <= 11; i += 1) |
18 |
instance_create((x - 20), y, obj_spare_cloud) |
19 |
} |
20 |
no_loop_create_clouds = true |
21 |
instance_destroy() |
22 |
return; |
23 |
} |
24 |
if (damage_disjoint_count > 0) |
25 |
damage_disjoint_count -= 1 |
26 |
else if (enemy_dead == false && enemy_spared == false) |
27 |
{ |
28 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
29 |
sprite_index = spr_penilla_head_critical |
30 |
else |
31 |
sprite_index = spr_penilla_head |
32 |
} |
33 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
34 |
{ |
35 |
time_elapsed_x = 0 |
36 |
time_elapsed_y = 0 |
37 |
sign_modifier = -1 |
38 |
damage_disjoint_count = 12 |
39 |
no_loop_damage_disjoint_count = true |
40 |
} |
41 |
else if (!instance_exists(obj_text_damage_count)) |
42 |
no_loop_damage_disjoint_count = false |
43 |
if (damage_disjoint_count == 12) |
44 |
damage_disjoint_x = -50 |
45 |
else if (damage_disjoint_count == 10) |
46 |
damage_disjoint_x = 50 |
47 |
else if (damage_disjoint_count == 8) |
48 |
damage_disjoint_x = -20 |
49 |
else if (damage_disjoint_count == 6) |
50 |
damage_disjoint_x = 20 |
51 |
else if (damage_disjoint_count == 4) |
52 |
damage_disjoint_x = -10 |
53 |
else if (damage_disjoint_count == 2) |
54 |
damage_disjoint_x = 10 |
55 |
else if (damage_disjoint_count == 0) |
56 |
damage_disjoint_x = 0 |
57 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
58 |
image_alpha = 0 |
59 |
x = draw_position_x + damage_disjoint_x |
60 |
y = draw_position_y + damage_disjoint_y |
61 |
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false) |
62 |
{ |
63 |
if (sprite_index == spr_penilla_head) |
64 |
{ |
65 |
game_maker_cannot_do_math = power((time_elapsed_x / (time_max_x / 2 * (1 / sqrt(max_rise_x))) - sqrt(max_rise_x)), 2) |
66 |
animation_disjoint_x = sign_modifier_x * (max_rise_x - round(game_maker_cannot_do_math)) |
67 |
time_elapsed_x += time_increase_x |
68 |
if (time_elapsed_x >= time_max_x) |
69 |
{ |
70 |
time_elapsed_x = 0 |
71 |
sign_modifier_x = (-sign_modifier_x) |
72 |
} |
73 |
x = draw_position_x + animation_disjoint_x |
74 |
} |
75 |
game_maker_cannot_do_math = power((time_elapsed_y / (time_max_y / 2 * (1 / sqrt(max_rise_y))) - sqrt(max_rise_y)), 2) |
76 |
animation_disjoint_y = sign_modifier_y * (max_rise_y - round(game_maker_cannot_do_math)) |
77 |
time_elapsed_y += time_increase_y |
78 |
if (time_elapsed_y >= time_max_y) |
79 |
{ |
80 |
time_elapsed_y = 0 |
81 |
sign_modifier_y = (-sign_modifier_y) |
82 |
} |
83 |
y = draw_position_y + animation_disjoint_y |
84 |
image_angle = max_angle * ((draw_position_x - x) / max_rise_x) |
85 |
} |
86 |
else |
87 |
image_angle = 0 |