1 |
var enemy_dead = global.enemy_dead |
2 |
var enemy_spared = global.enemy_spared |
3 |
var enemy_sparing = global.enemy_sparing |
4 |
if (enemy_dead == false && enemy_spared == false) |
5 |
image_alpha = global.image_alpha_enemy_attacking |
6 |
if (enemy_dead == true) |
7 |
{ |
8 |
x = starting_point_x |
9 |
y = starting_point_y |
10 |
image_xscale = starting_point_xscale |
11 |
image_yscale = starting_point_yscale |
12 |
instance_create(starting_point_x, starting_point_y, obj_cactony_dead) |
13 |
instance_destroy() |
14 |
return; |
15 |
} |
16 |
else if (enemy_spared == true) |
17 |
{ |
18 |
sprite_index = spr_cactony_spared |
19 |
x = starting_point_x |
20 |
y = starting_point_y |
21 |
image_xscale = starting_point_xscale |
22 |
image_yscale = starting_point_yscale |
23 |
image_speed = 0 |
24 |
image_index = 0 |
25 |
image_alpha = 0.5 |
26 |
if (no_loop_create_clouds == false) |
27 |
{ |
28 |
for (i = 0; i <= 11; i += 1) |
29 |
instance_create(x, (y - 22), obj_spare_cloud) |
30 |
} |
31 |
no_loop_create_clouds = true |
32 |
} |
33 |
if (damage_disjoint_count > 0) |
34 |
damage_disjoint_count -= 1 |
35 |
else if (enemy_dead == false && enemy_spared == false && damage_disjoint_count <= 0) |
36 |
{ |
37 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
38 |
{ |
39 |
sprite_index = spr_cactony_body_critical |
40 |
time_max = time_max_critical |
41 |
time_mult = time_mult_normal |
42 |
} |
43 |
else if (enemy_sparing == true) |
44 |
{ |
45 |
sprite_index = spr_cactony_body_loved |
46 |
time_max = time_max_normal |
47 |
time_mult = time_mult_loved |
48 |
} |
49 |
else |
50 |
{ |
51 |
sprite_index = spr_cactony_body_normal |
52 |
time_max = time_max_normal |
53 |
time_mult = time_mult_normal |
54 |
} |
55 |
} |
56 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
57 |
{ |
58 |
time_elapsed = 0 |
59 |
sign_modifier = 1 |
60 |
damage_disjoint_count = 12 |
61 |
no_loop_damage_disjoint_count = true |
62 |
audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch) |
63 |
} |
64 |
else if (!instance_exists(obj_text_damage_count)) |
65 |
no_loop_damage_disjoint_count = false |
66 |
if (damage_disjoint_count == 12) |
67 |
damage_disjoint_x = -50 |
68 |
else if (damage_disjoint_count == 10) |
69 |
damage_disjoint_x = 50 |
70 |
else if (damage_disjoint_count == 8) |
71 |
damage_disjoint_x = -20 |
72 |
else if (damage_disjoint_count == 6) |
73 |
damage_disjoint_x = 20 |
74 |
else if (damage_disjoint_count == 4) |
75 |
damage_disjoint_x = -10 |
76 |
else if (damage_disjoint_count == 2) |
77 |
damage_disjoint_x = 10 |
78 |
else if (damage_disjoint_count == 0) |
79 |
damage_disjoint_x = 0 |
80 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
81 |
sprite_index = spr_cactony_dead |
82 |
x = draw_position_x + damage_disjoint_x |
83 |
y = draw_position_y + damage_disjoint_y |
84 |
image_xscale = starting_point_xscale |
85 |
image_yscale = starting_point_yscale |
86 |
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false) |
87 |
{ |
88 |
for (i = 0; i < time_mult; i++) |
89 |
{ |
90 |
game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2) |
91 |
animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math) |
92 |
image_yscale = draw_position_yscale + animation_disjoint_yscale |
93 |
image_xscale = draw_position_xscale - animation_disjoint_yscale * (max_rise_ext / max_rise) |
94 |
time_elapsed += time_increase |
95 |
if (time_elapsed >= time_max) |
96 |
{ |
97 |
time_elapsed = 0 |
98 |
sign_modifier = (-sign_modifier) |
99 |
} |
100 |
} |
101 |
animating = true |
102 |
} |
103 |
else |
104 |
animating = false |
105 |
with (obj_cactony_body_shadow_a) |
106 |
event_user(0) |