| 1 |
if (!instance_exists(obj_heart_battle_fighting_parent)) |
| 2 |
{ |
| 3 |
instance_destroy(); |
| 4 |
exit; |
| 5 |
} |
| 6 |
if (image_alpha < 1) |
| 7 |
{ |
| 8 |
image_alpha += 0.1; |
| 9 |
if (image_alpha > 1) |
| 10 |
image_alpha = 1; |
| 11 |
} |
| 12 |
if (state == "normal") |
| 13 |
{ |
| 14 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
| 15 |
animation_disjoint_angle = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
| 16 |
time_elapsed += time_increase; |
| 17 |
if (time_elapsed >= time_max) |
| 18 |
{ |
| 19 |
time_elapsed = 0; |
| 20 |
sign_modifier = -sign_modifier; |
| 21 |
} |
| 22 |
image_angle = image_angle_n + animation_disjoint_angle; |
| 23 |
} |
| 24 |
else if (state == "detract") |
| 25 |
{ |
| 26 |
if (no_loop_t == false) |
| 27 |
{ |
| 28 |
image_angle_d = image_angle; |
| 29 |
image_angle_d_location = point_direction(x, y, obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y); |
| 30 |
image_angle_r_location = image_angle; |
| 31 |
no_loop_t = true; |
| 32 |
} |
| 33 |
image_angle_d += (image_angle_d_speed * sign(image_angle_d_location - image_angle_d)); |
| 34 |
if (abs(image_angle_d_location - image_angle_d) < image_angle_d_speed) |
| 35 |
image_angle_d = image_angle_d_location; |
| 36 |
if (image_angle_d == image_angle_d_location) |
| 37 |
{ |
| 38 |
image_angle_r = image_angle_d; |
| 39 |
state = "retract"; |
| 40 |
no_loop_t = false; |
| 41 |
} |
| 42 |
image_angle = image_angle_d; |
| 43 |
} |
| 44 |
else if (state == "retract") |
| 45 |
{ |
| 46 |
image_angle_r += (image_angle_r_speed * sign(image_angle_r_location - image_angle_r)); |
| 47 |
if (abs(image_angle_r_location - image_angle_r) < image_angle_r_speed) |
| 48 |
image_angle_r = image_angle_r_location; |
| 49 |
if (image_angle_r == image_angle_r_location) |
| 50 |
state = "normal"; |
| 51 |
image_angle = image_angle_r; |
| 52 |
} |
| 53 |
with (obj_battle_enemy_attack_frostermit_pincher_right_2) |
| 54 |
event_user(0); |
| 55 |
with (obj_battle_enemy_attack_frostermit_pincher_right_3_outer) |
| 56 |
event_user(0); |
| 57 |
with (obj_battle_enemy_attack_frostermit_pincher_right_3_inner) |
| 58 |
event_user(0); |