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 = xstart; |
9 |
y = ystart; |
10 |
instance_create_depth(starting_point_x, starting_point_y, depth - 1, obj_slither_dead); |
11 |
instance_destroy(); |
12 |
exit; |
13 |
image_alpha = 0.5; |
14 |
} |
15 |
else if (enemy_spared == true) |
16 |
{ |
17 |
sprite_index = spr_sir_slither_hurt; |
18 |
x = xstart; |
19 |
y = ystart; |
20 |
image_speed = 0; |
21 |
image_index = 0; |
22 |
image_alpha = 0.5; |
23 |
if (no_loop_create_clouds == false) |
24 |
{ |
25 |
for (i = 0; i <= 11; i += 1) |
26 |
instance_create(x, y - 22, obj_spare_cloud); |
27 |
} |
28 |
no_loop_create_clouds = true; |
29 |
} |
30 |
if (damage_disjoint_count > 0) |
31 |
{ |
32 |
damage_disjoint_count -= 1; |
33 |
} |
34 |
else if (enemy_dead == false && enemy_spared == false && damage_disjoint_count <= 0) |
35 |
{ |
36 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
37 |
{ |
38 |
if (low_hp_noloop == false) |
39 |
{ |
40 |
layer_sequence_destroy(idle_seq); |
41 |
layer_sequence_create("sequence_layer", x, y, 15); |
42 |
low_hp_noloop = true; |
43 |
} |
44 |
sprite_index = -4; |
45 |
} |
46 |
else |
47 |
{ |
48 |
sprite_index = -4; |
49 |
} |
50 |
} |
51 |
else if (enemy_spared == true) |
52 |
{ |
53 |
sprite_index = spr_sir_slither_spared; |
54 |
} |
55 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
56 |
{ |
57 |
sprite_index = spr_sir_slither_hurt; |
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 |
{ |
66 |
no_loop_damage_disjoint_count = false; |
67 |
} |
68 |
if (damage_disjoint_count == 12) |
69 |
damage_disjoint_x = -50; |
70 |
else if (damage_disjoint_count == 10) |
71 |
damage_disjoint_x = 50; |
72 |
else if (damage_disjoint_count == 8) |
73 |
damage_disjoint_x = -20; |
74 |
else if (damage_disjoint_count == 6) |
75 |
damage_disjoint_x = 20; |
76 |
else if (damage_disjoint_count == 4) |
77 |
damage_disjoint_x = -10; |
78 |
else if (damage_disjoint_count == 2) |
79 |
damage_disjoint_x = 10; |
80 |
else if (damage_disjoint_count == 0) |
81 |
damage_disjoint_x = 0; |
82 |
x = xstart + damage_disjoint_x; |
83 |
if (global.current_hp_enemy <= 0) |
84 |
sprite_index = spr_sir_slither_hurt; |