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 |
x = starting_point_x; |
8 |
y = starting_point_y; |
9 |
instance_create(starting_point_x, starting_point_y, obj_trihecta_dead); |
10 |
instance_destroy(); |
11 |
exit; |
12 |
image_alpha = 0.5; |
13 |
} |
14 |
else if (enemy_spared == true) |
15 |
{ |
16 |
sprite_index = spr_trihecta_spared; |
17 |
x = starting_point_x; |
18 |
y = starting_point_y; |
19 |
image_speed = 0; |
20 |
image_index = 0; |
21 |
image_alpha = 0.5; |
22 |
if (no_loop_create_clouds == false) |
23 |
{ |
24 |
for (i = 0; i <= 11; i += 1) |
25 |
instance_create(x, y - 70, obj_spare_cloud); |
26 |
} |
27 |
no_loop_create_clouds = true; |
28 |
} |
29 |
if (damage_disjoint_count > 0) |
30 |
{ |
31 |
damage_disjoint_count -= 1; |
32 |
} |
33 |
else if (enemy_dead == false && enemy_spared == false) |
34 |
{ |
35 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
36 |
{ |
37 |
if (sprite_index != spr_trihecta_critical) |
38 |
{ |
39 |
sprite_index = spr_trihecta_critical; |
40 |
image_speed = 1/3; |
41 |
image_index = 0; |
42 |
} |
43 |
} |
44 |
else if (tipping_number >= 2) |
45 |
{ |
46 |
if (sprite_index != spr_trihecta_falling) |
47 |
{ |
48 |
sprite_index = spr_trihecta_falling; |
49 |
image_speed = 1/3; |
50 |
image_index = 0; |
51 |
event_user(0); |
52 |
} |
53 |
} |
54 |
else if (tipping_number == 1) |
55 |
{ |
56 |
if (sprite_index != spr_trihecta_tipping) |
57 |
{ |
58 |
sprite_index = spr_trihecta_tipping; |
59 |
image_speed = 1/3; |
60 |
image_index = 0; |
61 |
} |
62 |
} |
63 |
else if (sprite_index != spr_trihecta_balanced) |
64 |
{ |
65 |
sprite_index = spr_trihecta_balanced; |
66 |
image_speed = 1/3; |
67 |
image_index = 0; |
68 |
} |
69 |
} |
70 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
71 |
{ |
72 |
time_elapsed = 0; |
73 |
sign_modifier = -1; |
74 |
damage_disjoint_count = 12; |
75 |
no_loop_damage_disjoint_count = true; |
76 |
audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch); |
77 |
} |
78 |
else if (!instance_exists(obj_text_damage_count)) |
79 |
{ |
80 |
no_loop_damage_disjoint_count = false; |
81 |
} |
82 |
if (damage_disjoint_count == 12) |
83 |
damage_disjoint_x = -50; |
84 |
else if (damage_disjoint_count == 10) |
85 |
damage_disjoint_x = 50; |
86 |
else if (damage_disjoint_count == 8) |
87 |
damage_disjoint_x = -20; |
88 |
else if (damage_disjoint_count == 6) |
89 |
damage_disjoint_x = 20; |
90 |
else if (damage_disjoint_count == 4) |
91 |
damage_disjoint_x = -10; |
92 |
else if (damage_disjoint_count == 2) |
93 |
damage_disjoint_x = 10; |
94 |
else if (damage_disjoint_count == 0) |
95 |
damage_disjoint_x = 0; |
96 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
97 |
{ |
98 |
sprite_index = spr_trihecta_dead; |
99 |
image_speed = 0; |
100 |
image_index = 0; |
101 |
} |
102 |
x = draw_position_x + damage_disjoint_x; |
103 |
y = draw_position_y + damage_disjoint_y; |