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