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