| 1 |
if (live_call()) |
| 2 |
return global.live_result; |
| 3 |
if (cloak_direction == 0) |
| 4 |
{ |
| 5 |
var enemy_dead = global.enemy_dead; |
| 6 |
var enemy_spared = global.enemy_spared; |
| 7 |
if (enemy_dead == false && enemy_spared == false) |
| 8 |
image_alpha = global.image_alpha_enemy_attacking; |
| 9 |
if (enemy_dead == true) |
| 10 |
{ |
| 11 |
x = starting_point_x; |
| 12 |
y = starting_point_y; |
| 13 |
instance_create(starting_point_x, starting_point_y, obj_dalv_dead); |
| 14 |
instance_destroy(); |
| 15 |
exit; |
| 16 |
image_alpha = 0.5; |
| 17 |
} |
| 18 |
else if (enemy_spared == true) |
| 19 |
{ |
| 20 |
sprite_index = spr_dalv_spared; |
| 21 |
x = starting_point_x; |
| 22 |
y = starting_point_y; |
| 23 |
image_xscale = starting_point_xscale; |
| 24 |
image_yscale = starting_point_yscale; |
| 25 |
image_alpha = 0.5; |
| 26 |
if (no_loop_create_clouds == false) |
| 27 |
{ |
| 28 |
for (i = 0; i <= 11; i += 1) |
| 29 |
instance_create(x, y - 100, obj_spare_cloud); |
| 30 |
} |
| 31 |
no_loop_create_clouds = true; |
| 32 |
} |
| 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_dalv_body_critical; |
| 41 |
else |
| 42 |
sprite_index = spr_dalv_body; |
| 43 |
} |
| 44 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && 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_dalv_hit_2; |
| 73 |
else |
| 74 |
sprite_index = spr_dalv_hit; |
| 75 |
image_xscale = starting_point_xscale; |
| 76 |
image_yscale = starting_point_yscale; |
| 77 |
} |
| 78 |
if (global.current_hp_enemy <= 0) |
| 79 |
{ |
| 80 |
time_elapsed = 0; |
| 81 |
sign_modifier = 1; |
| 82 |
} |
| 83 |
x = draw_position_x + damage_disjoint_x; |
| 84 |
y = draw_position_y + damage_disjoint_y; |
| 85 |
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false) |
| 86 |
{ |
| 87 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 88 |
animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math); |
| 89 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
| 90 |
image_xscale = draw_position_xscale - (animation_disjoint_yscale * (max_rise_ext / max_rise)); |
| 91 |
var image_yscale_store = image_yscale; |
| 92 |
var time_elapsed_head = time_elapsed - time_elapsed_decrease_head; |
| 93 |
if (time_elapsed_head < 0) |
| 94 |
{ |
| 95 |
time_elapsed_head += time_max; |
| 96 |
sign_modifier_head = -sign_modifier; |
| 97 |
} |
| 98 |
else |
| 99 |
{ |
| 100 |
sign_modifier_head = sign_modifier; |
| 101 |
} |
| 102 |
game_maker_cannot_do_math = power((time_elapsed_head / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 103 |
animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math); |
| 104 |
image_yscale = draw_position_yscale + animation_disjoint_yscale; |
| 105 |
head_displacement_y = bbox_top + (sprite_height * head_displacement_y_multiplier); |
| 106 |
image_yscale = image_yscale_store; |
| 107 |
time_elapsed += time_increase; |
| 108 |
if (time_elapsed >= time_max) |
| 109 |
{ |
| 110 |
time_elapsed = 0; |
| 111 |
sign_modifier = -sign_modifier; |
| 112 |
} |
| 113 |
animating = true; |
| 114 |
} |
| 115 |
else |
| 116 |
{ |
| 117 |
animating = false; |
| 118 |
} |
| 119 |
} |
| 120 |
else if (cloak_direction == 1 && sprite_index != spr_dalv_body_open) |
| 121 |
{ |
| 122 |
sprite_index = spr_dalv_body_open; |
| 123 |
image_speed = 1; |
| 124 |
image_index = 0; |
| 125 |
image_xscale = 1; |
| 126 |
image_yscale = 1; |
| 127 |
time_elapsed = 0; |
| 128 |
sign_modifier = 1; |
| 129 |
head_displacement_y = bbox_top + (sprite_height * head_displacement_y_multiplier); |
| 130 |
with (obj_background_battle_parent) |
| 131 |
{ |
| 132 |
custom_fade_direction = "out"; |
| 133 |
custom_fade_alpha = 0; |
| 134 |
custom_fade_rate = 0.05; |
| 135 |
} |
| 136 |
animating = true; |
| 137 |
} |
| 138 |
else if (cloak_direction == 2 && sprite_index != spr_dalv_body_close) |
| 139 |
{ |
| 140 |
sprite_index = spr_dalv_body_close; |
| 141 |
image_speed = 1; |
| 142 |
image_index = 0; |
| 143 |
cloak_out = false; |
| 144 |
animating = true; |
| 145 |
} |
| 146 |
else |
| 147 |
{ |
| 148 |
animating = false; |
| 149 |
} |