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