| 1 |
var enemy_dead = global.enemy_dead; |
| 2 |
var enemy_spared = global.enemy_spared; |
| 3 |
event_user(0); |
| 4 |
if (enemy_dead == true) |
| 5 |
{ |
| 6 |
x = starting_point_x; |
| 7 |
y = starting_point_y; |
| 8 |
image_xscale = starting_point_xscale; |
| 9 |
image_yscale = starting_point_yscale; |
| 10 |
instance_create(starting_point_x, starting_point_y, obj_el_bailador_dead); |
| 11 |
instance_destroy(); |
| 12 |
exit; |
| 13 |
image_alpha = 0.5; |
| 14 |
} |
| 15 |
else if (enemy_spared == true) |
| 16 |
{ |
| 17 |
sprite_index = spr_el_bailador_spared; |
| 18 |
x = starting_point_x; |
| 19 |
y = starting_point_y; |
| 20 |
image_xscale = starting_point_xscale; |
| 21 |
image_yscale = starting_point_yscale; |
| 22 |
image_speed = 0; |
| 23 |
image_index = 0; |
| 24 |
image_alpha = 0.5; |
| 25 |
if (no_loop_create_clouds == false) |
| 26 |
{ |
| 27 |
for (i = 0; i <= 11; i += 1) |
| 28 |
instance_create(x, y - 22, obj_spare_cloud); |
| 29 |
} |
| 30 |
no_loop_create_clouds = true; |
| 31 |
} |
| 32 |
if (damage_disjoint_count > 0) |
| 33 |
{ |
| 34 |
damage_disjoint_count -= 1; |
| 35 |
} |
| 36 |
else if (enemy_dead == false && enemy_spared == false) |
| 37 |
{ |
| 38 |
if (global.current_hp_enemy <= 0) |
| 39 |
sprite_index = spr_el_bailador_dead; |
| 40 |
else if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy) |
| 41 |
sprite_index = neutral_sprite; |
| 42 |
else |
| 43 |
sprite_index = neutral_sprite; |
| 44 |
} |
| 45 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
| 46 |
{ |
| 47 |
time_elapsed = 0; |
| 48 |
sign_modifier = 1; |
| 49 |
damage_disjoint_count = 12; |
| 50 |
no_loop_damage_disjoint_count = true; |
| 51 |
} |
| 52 |
else if (!instance_exists(obj_text_damage_count)) |
| 53 |
{ |
| 54 |
no_loop_damage_disjoint_count = false; |
| 55 |
} |
| 56 |
if (damage_disjoint_count == 12) |
| 57 |
damage_disjoint_x = -50; |
| 58 |
else if (damage_disjoint_count == 10) |
| 59 |
damage_disjoint_x = 50; |
| 60 |
else if (damage_disjoint_count == 8) |
| 61 |
damage_disjoint_x = -20; |
| 62 |
else if (damage_disjoint_count == 6) |
| 63 |
damage_disjoint_x = 20; |
| 64 |
else if (damage_disjoint_count == 4) |
| 65 |
damage_disjoint_x = -10; |
| 66 |
else if (damage_disjoint_count == 2) |
| 67 |
damage_disjoint_x = 10; |
| 68 |
else if (damage_disjoint_count == 0) |
| 69 |
damage_disjoint_x = 0; |
| 70 |
x = draw_position_x + damage_disjoint_x; |
| 71 |
y = draw_position_y + damage_disjoint_y; |
| 72 |
image_xscale = starting_point_xscale; |
| 73 |
image_yscale = starting_point_yscale; |
| 74 |
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false && image_alpha > 0) |
| 75 |
{ |
| 76 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 77 |
animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math); |
| 78 |
time_elapsed += time_increase; |
| 79 |
if (time_elapsed >= time_max) |
| 80 |
{ |
| 81 |
time_elapsed = 0; |
| 82 |
sign_modifier = -sign_modifier; |
| 83 |
} |
| 84 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
| 85 |
image_xscale = draw_position_xscale - (animation_disjoint_yscale * (max_rise_ext / max_rise)); |
| 86 |
animating = true; |
| 87 |
} |
| 88 |
else |
| 89 |
{ |
| 90 |
animating = false; |
| 91 |
} |