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_dalv_dead); |
10 |
instance_destroy(); |
11 |
exit; |
12 |
image_alpha = 0.5; |
13 |
} |
14 |
else if (enemy_spared == true) |
15 |
{ |
16 |
sprite_index = spr_dalv_spared; |
17 |
x = starting_point_x; |
18 |
y = starting_point_y; |
19 |
image_xscale = starting_point_xscale; |
20 |
image_yscale = starting_point_yscale; |
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 - 100, obj_spare_cloud); |
26 |
} |
27 |
no_loop_create_clouds = true; |
28 |
} |
29 |
obj_feisty_four_ed_head.image_alpha = image_alpha; |
30 |
obj_feisty_four_ed_body.image_alpha = image_alpha; |
31 |
obj_feisty_four_ed_hand_left.image_alpha = image_alpha; |
32 |
obj_feisty_four_ed_hand_right.image_alpha = image_alpha; |
33 |
if (damage_disjoint_count > 0) |
34 |
{ |
35 |
damage_disjoint_count -= 1; |
36 |
} |
37 |
else if (enemy_dead == false && enemy_spared == false) |
38 |
{ |
39 |
if (global.current_hp_enemy <= 0) |
40 |
sprite_index = spr_feisty_four_ed_legs; |
41 |
else |
42 |
sprite_index = spr_feisty_four_ed_legs; |
43 |
} |
44 |
if (instance_exists(obj_text_damage_count) && ((global.fight_number == 1 && global.enemy_count == 1) || (global.fight_number == 2 && global.enemy_count == 2)) && no_loop_damage_disjoint_count == false) |
45 |
{ |
46 |
time_elapsed = 0; |
47 |
sign_modifier = 1; |
48 |
damage_disjoint_count = 12; |
49 |
no_loop_damage_disjoint_count = true; |
50 |
} |
51 |
else if (!instance_exists(obj_text_damage_count)) |
52 |
{ |
53 |
no_loop_damage_disjoint_count = false; |
54 |
} |
55 |
if (damage_disjoint_count == 12) |
56 |
damage_disjoint_x = -50; |
57 |
else if (damage_disjoint_count == 10) |
58 |
damage_disjoint_x = 50; |
59 |
else if (damage_disjoint_count == 8) |
60 |
damage_disjoint_x = -20; |
61 |
else if (damage_disjoint_count == 6) |
62 |
damage_disjoint_x = 20; |
63 |
else if (damage_disjoint_count == 4) |
64 |
damage_disjoint_x = -10; |
65 |
else if (damage_disjoint_count == 2) |
66 |
damage_disjoint_x = 10; |
67 |
else if (damage_disjoint_count == 0) |
68 |
damage_disjoint_x = 0; |
69 |
if (damage_disjoint_count > 0) |
70 |
{ |
71 |
if (global.current_hp_enemy <= 0) |
72 |
sprite_index = spr_feisty_four_ed_legs; |
73 |
else |
74 |
sprite_index = hurt_sprite; |
75 |
image_xscale = starting_point_xscale; |
76 |
image_yscale = starting_point_yscale; |
77 |
} |
78 |
else if (sprite_index == hurt_sprite) |
79 |
{ |
80 |
sprite_index = spr_feisty_four_ed_legs; |
81 |
} |
82 |
if (global.current_hp_enemy <= 0) |
83 |
{ |
84 |
time_elapsed = 0; |
85 |
sign_modifier = 1; |
86 |
} |
87 |
x = draw_position_x + damage_disjoint_x; |
88 |
y = draw_position_y + damage_disjoint_y; |
89 |
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false) |
90 |
{ |
91 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
92 |
animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math); |
93 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
94 |
image_xscale = draw_position_xscale - (animation_disjoint_yscale * (max_rise_ext / max_rise)); |
95 |
var image_yscale_store = image_yscale; |
96 |
var time_elapsed_head = time_elapsed - time_elapsed_decrease_head; |
97 |
if (time_elapsed_head < 0) |
98 |
{ |
99 |
time_elapsed_head += time_max; |
100 |
sign_modifier_head = -sign_modifier; |
101 |
} |
102 |
else |
103 |
{ |
104 |
sign_modifier_head = sign_modifier; |
105 |
} |
106 |
game_maker_cannot_do_math = power((time_elapsed_head / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
107 |
animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math); |
108 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
109 |
head_displacement_y = bbox_top + (sprite_height * head_displacement_y_multiplier); |
110 |
image_yscale = image_yscale_store; |
111 |
var time_elapsed_body = time_elapsed - time_elapsed_decrease_body; |
112 |
if (time_elapsed_body < 0) |
113 |
{ |
114 |
time_elapsed_body += time_max; |
115 |
sign_modifier_body = -sign_modifier; |
116 |
} |
117 |
else |
118 |
{ |
119 |
sign_modifier_body = sign_modifier; |
120 |
} |
121 |
game_maker_cannot_do_math = power((time_elapsed_body / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
122 |
animation_disjoint_yscale = sign_modifier_body * (max_rise - game_maker_cannot_do_math); |
123 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
124 |
body_displacement_y = bbox_top + (sprite_height * body_displacement_y_multiplier); |
125 |
image_yscale = image_yscale_store; |
126 |
var time_elapsed_hand_left = time_elapsed - time_elapsed_decrease_hand_left; |
127 |
if (time_elapsed_hand_left < 0) |
128 |
{ |
129 |
time_elapsed_hand_left += time_max; |
130 |
sign_modifier_hand_left = -sign_modifier; |
131 |
} |
132 |
else |
133 |
{ |
134 |
sign_modifier_hand_left = sign_modifier; |
135 |
} |
136 |
game_maker_cannot_do_math = power((time_elapsed_hand_left / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
137 |
animation_disjoint_yscale = sign_modifier_hand_left * (max_rise - game_maker_cannot_do_math); |
138 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
139 |
hand_left_displacement_y = bbox_top + (sprite_height * hand_left_displacement_y_multiplier); |
140 |
image_yscale = image_yscale_store; |
141 |
var time_elapsed_hand_right = time_elapsed - time_elapsed_decrease_hand_right; |
142 |
if (time_elapsed_hand_right < 0) |
143 |
{ |
144 |
time_elapsed_hand_right += time_max; |
145 |
sign_modifier_hand_right = -sign_modifier; |
146 |
} |
147 |
else |
148 |
{ |
149 |
sign_modifier_hand_right = sign_modifier; |
150 |
} |
151 |
game_maker_cannot_do_math = power((time_elapsed_hand_right / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
152 |
animation_disjoint_yscale = sign_modifier_hand_right * (max_rise - game_maker_cannot_do_math); |
153 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
154 |
hand_right_displacement_y = bbox_top + (sprite_height * hand_right_displacement_y_multiplier); |
155 |
image_yscale = image_yscale_store; |
156 |
time_elapsed += time_increase; |
157 |
if (time_elapsed >= time_max) |
158 |
{ |
159 |
time_elapsed = 0; |
160 |
sign_modifier = -sign_modifier; |
161 |
} |
162 |
animating = true; |
163 |
} |
164 |
else |
165 |
{ |
166 |
animating = false; |
167 |
} |
168 |
if (vanish == true) |
169 |
{ |
170 |
if (vanish_state == 1) |
171 |
{ |
172 |
game_maker_cannot_do_math = power((time_elapsed_move / (((time_max_move * 0.5) / 2) * (1 / sqrt(max_rise_move * 0.15)))) - sqrt(max_rise_move * 0.15), 2); |
173 |
animation_disjoint_x_move = -sign_modifier_move * ((max_rise_move * 0.15) - game_maker_cannot_do_math); |
174 |
x = draw_position_x + animation_disjoint_x_move; |
175 |
time_elapsed_move += time_increase_move; |
176 |
if (time_elapsed_move > ((time_max_move * 0.5) / 2)) |
177 |
{ |
178 |
time_elapsed_move = 0; |
179 |
vanish_state = 2; |
180 |
} |
181 |
} |
182 |
if (vanish_state == 2) |
183 |
{ |
184 |
game_maker_cannot_do_math = power((time_elapsed_move / ((time_max_move / 2) * (1 / sqrt(max_rise_move)))) - sqrt(max_rise_move), 2); |
185 |
animation_disjoint_x_move = sign_modifier_move * (max_rise_move - game_maker_cannot_do_math); |
186 |
x = draw_position_x + animation_disjoint_x_move; |
187 |
time_elapsed_move += time_increase_move; |
188 |
if (time_elapsed_move > (time_max_move / 2)) |
189 |
instance_destroy(); |
190 |
} |
191 |
} |
192 |
if (instance_exists(obj_feisty_four_ed_head)) |
193 |
{ |
194 |
with (obj_feisty_four_ed_head) |
195 |
event_user(0); |
196 |
} |
197 |
if (instance_exists(obj_feisty_four_ed_body)) |
198 |
{ |
199 |
with (obj_feisty_four_ed_body) |
200 |
event_user(0); |
201 |
} |
202 |
if (instance_exists(obj_feisty_four_ed_hand_left)) |
203 |
{ |
204 |
with (obj_feisty_four_ed_hand_left) |
205 |
event_user(0); |
206 |
} |
207 |
if (instance_exists(obj_feisty_four_ed_hand_right)) |
208 |
{ |
209 |
with (obj_feisty_four_ed_hand_right) |
210 |
event_user(0); |
211 |
} |