| 1 |
if (battle_start == true && flee == false) |
| 2 |
{ |
| 3 |
var enemy_dead = global.enemy_dead; |
| 4 |
var enemy_spared = global.enemy_spared; |
| 5 |
if (enemy_dead == false && enemy_spared == false) |
| 6 |
image_alpha = global.image_alpha_enemy_attacking; |
| 7 |
if (enemy_dead == true) |
| 8 |
{ |
| 9 |
x = starting_point_x; |
| 10 |
y = starting_point_y; |
| 11 |
instance_create(starting_point_x, starting_point_y, obj_decibat_dead); |
| 12 |
instance_destroy(); |
| 13 |
exit; |
| 14 |
image_alpha = 0.5; |
| 15 |
} |
| 16 |
else if (enemy_spared == true) |
| 17 |
{ |
| 18 |
sprite_index = spr_decibat_spared; |
| 19 |
x = starting_point_x; |
| 20 |
y = starting_point_y; |
| 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, obj_spare_cloud); |
| 26 |
} |
| 27 |
no_loop_create_clouds = true; |
| 28 |
} |
| 29 |
if (damage_disjoint_count > 0) |
| 30 |
damage_disjoint_count -= 1; |
| 31 |
else if (enemy_dead == false && enemy_spared == false) |
| 32 |
sprite_index = spr_decibat_body; |
| 33 |
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false) |
| 34 |
{ |
| 35 |
time_elapsed = 0; |
| 36 |
sign_modifier = -1; |
| 37 |
damage_disjoint_count = 12; |
| 38 |
no_loop_damage_disjoint_count = true; |
| 39 |
} |
| 40 |
else if (!instance_exists(obj_text_damage_count)) |
| 41 |
{ |
| 42 |
no_loop_damage_disjoint_count = false; |
| 43 |
} |
| 44 |
if (damage_disjoint_count == 12) |
| 45 |
damage_disjoint_x = -50; |
| 46 |
else if (damage_disjoint_count == 10) |
| 47 |
damage_disjoint_x = 50; |
| 48 |
else if (damage_disjoint_count == 8) |
| 49 |
damage_disjoint_x = -20; |
| 50 |
else if (damage_disjoint_count == 6) |
| 51 |
damage_disjoint_x = 20; |
| 52 |
else if (damage_disjoint_count == 4) |
| 53 |
damage_disjoint_x = -10; |
| 54 |
else if (damage_disjoint_count == 2) |
| 55 |
damage_disjoint_x = 10; |
| 56 |
else if (damage_disjoint_count == 0) |
| 57 |
damage_disjoint_x = 0; |
| 58 |
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0) |
| 59 |
sprite_index = spr_decibat_dead; |
| 60 |
x = draw_position_x + damage_disjoint_x; |
| 61 |
y = draw_position_y + damage_disjoint_y; |
| 62 |
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false) |
| 63 |
{ |
| 64 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 65 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
| 66 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise_wing)))) - sqrt(max_rise_wing), 2); |
| 67 |
wing_speed_modifier = sign_modifier * (max_rise_wing - round(game_maker_cannot_do_math)); |
| 68 |
time_elapsed += time_increase; |
| 69 |
if (time_elapsed >= time_max) |
| 70 |
{ |
| 71 |
time_elapsed = 0; |
| 72 |
sign_modifier = -sign_modifier; |
| 73 |
} |
| 74 |
y = draw_position_y + animation_disjoint_y; |
| 75 |
if (sign_modifier == 1) |
| 76 |
wing_speed_add = wing_speed_adjuster; |
| 77 |
else |
| 78 |
wing_speed_add = 0; |
| 79 |
image_speed = wing_speed_default + wing_speed_modifier + wing_speed_add; |
| 80 |
} |
| 81 |
} |
| 82 |
else if (flee == false) |
| 83 |
{ |
| 84 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 85 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
| 86 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise_wing)))) - sqrt(max_rise_wing), 2); |
| 87 |
wing_speed_modifier = sign_modifier * (max_rise_wing - round(game_maker_cannot_do_math)); |
| 88 |
time_elapsed += time_increase; |
| 89 |
if (time_elapsed >= time_max) |
| 90 |
{ |
| 91 |
time_elapsed = 0; |
| 92 |
sign_modifier = -sign_modifier; |
| 93 |
} |
| 94 |
y = draw_position_y + animation_disjoint_y; |
| 95 |
if (sign_modifier == 1) |
| 96 |
wing_speed_add = wing_speed_adjuster; |
| 97 |
else |
| 98 |
wing_speed_add = 0; |
| 99 |
image_speed = wing_speed_default + wing_speed_modifier + wing_speed_add; |
| 100 |
} |
| 101 |
if (flee == true) |
| 102 |
{ |
| 103 |
game_maker_cannot_do_math = power((time_elapsed_flee / ((time_max_flee / 2) * (1 / sqrt(max_rise_flee)))) - sqrt(max_rise_flee), 2); |
| 104 |
animation_disjoint_y_flee = sign_modifier_flee * (max_rise_flee - round(game_maker_cannot_do_math)); |
| 105 |
time_elapsed_flee += time_increase_flee; |
| 106 |
if (time_elapsed_flee >= time_max_flee) |
| 107 |
time_elapsed_flee = time_max_flee; |
| 108 |
y = draw_position_y_flee + animation_disjoint_y_flee; |
| 109 |
wing_speed_add = wing_speed_adjuster; |
| 110 |
image_speed = wing_speed_default + max_rise_wing + wing_speed_add; |
| 111 |
if (bbox_bottom <= 0) |
| 112 |
{ |
| 113 |
global.important_cutscene = false; |
| 114 |
global.enemy_sparing = true; |
| 115 |
global.enemy_spared = true; |
| 116 |
with (obj_battle_generator) |
| 117 |
audio_extend = false; |
| 118 |
audio_stop_all(); |
| 119 |
instance_create(0, 0, obj_dialogue_battle_win_pacifist); |
| 120 |
instance_destroy(); |
| 121 |
} |
| 122 |
} |