1 |
if (global.current_hp_enemy_draw <= 0 && damage_disjoint_x == 0) |
2 |
{ |
3 |
if (!global.enemy_dead) |
4 |
{ |
5 |
global.enemy_dead = true; |
6 |
instance_create(402, 68, obj_quote_bubble_battle_yellow_2); |
7 |
instance_create_depth(0, 0, -1000, obj_quote_battle_guardener_death); |
8 |
} |
9 |
} |
10 |
if (global.enemy_dead == true && !instance_exists(obj_quote_battle_guardener_death)) |
11 |
{ |
12 |
sprite_index = -4; |
13 |
if (death_noloop == true) |
14 |
layer_sequence_destroy(idle_sequence); |
15 |
if (!death_noloop) |
16 |
{ |
17 |
layer_sequence_create("sequence_layer", x, y, 4); |
18 |
alarm[0] = 60; |
19 |
death_noloop = true; |
20 |
} |
21 |
exit; |
22 |
} |
23 |
var enemy_dead = global.enemy_dead; |
24 |
var enemy_spared = global.enemy_spared; |
25 |
var enemy_sparing = global.enemy_sparing; |
26 |
if (enemy_dead == false && enemy_spared == false) |
27 |
image_alpha = global.image_alpha_enemy_attacking; |
28 |
if (enemy_spared == true) |
29 |
{ |
30 |
sprite_index = spr_guardener_hurt; |
31 |
x = xstart; |
32 |
y = ystart; |
33 |
image_speed = 0; |
34 |
image_index = 0; |
35 |
image_alpha = 0.5; |
36 |
if (no_loop_create_clouds == false) |
37 |
{ |
38 |
for (i = 0; i <= 11; i += 1) |
39 |
instance_create(x, y - 22, obj_spare_cloud); |
40 |
} |
41 |
no_loop_create_clouds = true; |
42 |
} |
43 |
if (damage_disjoint_count > 0 && damage_disjoint_timer <= 0) |
44 |
{ |
45 |
damage_disjoint_count -= 1; |
46 |
} |
47 |
else if (enemy_dead == false && enemy_spared == false && damage_disjoint_count <= 0) |
48 |
{ |
49 |
if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
50 |
{ |
51 |
if (low_hp_noloop == false) |
52 |
low_hp_noloop = true; |
53 |
sprite_index = -4; |
54 |
} |
55 |
else |
56 |
{ |
57 |
sprite_index = -4; |
58 |
} |
59 |
} |
60 |
else if (enemy_spared == true) |
61 |
{ |
62 |
sprite_index = spr_guardener_hurt; |
63 |
} |
64 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
65 |
{ |
66 |
sprite_index = spr_guardener_hurt; |
67 |
time_elapsed = 0; |
68 |
sign_modifier = 1; |
69 |
damage_disjoint_count = 12; |
70 |
no_loop_damage_disjoint_count = true; |
71 |
} |
72 |
else if (!instance_exists(obj_text_damage_count)) |
73 |
{ |
74 |
no_loop_damage_disjoint_count = false; |
75 |
} |
76 |
if (damage_disjoint_timer <= 0) |
77 |
{ |
78 |
damage_disjoint_timer = damage_disjoint_timer_max; |
79 |
if (damage_disjoint_count == 12) |
80 |
damage_disjoint_x = -50; |
81 |
else if (damage_disjoint_count == 10) |
82 |
damage_disjoint_x = 50; |
83 |
else if (damage_disjoint_count == 8) |
84 |
damage_disjoint_x = -20; |
85 |
else if (damage_disjoint_count == 6) |
86 |
damage_disjoint_x = 20; |
87 |
else if (damage_disjoint_count == 4) |
88 |
damage_disjoint_x = -10; |
89 |
else if (damage_disjoint_count == 2) |
90 |
damage_disjoint_x = 10; |
91 |
else if (damage_disjoint_count == 0) |
92 |
damage_disjoint_x = 0; |
93 |
} |
94 |
else |
95 |
{ |
96 |
damage_disjoint_timer -= 1; |
97 |
} |
98 |
x = xstart + damage_disjoint_x; |
99 |
if (guardener_stop_animating == true) |
100 |
{ |
101 |
if (layer_sequence_get_headpos(2) >= (layer_sequence_get_length(2) - 1)) |
102 |
layer_sequence_pause(2); |
103 |
} |