1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
var particles_spawn = false; |
4 |
if (sprite_index == spr_martlet_p_full_fly_begin || sprite_index == spr_martlet_g_full_fly_begin) |
5 |
{ |
6 |
if (floor(image_index) == 6 && no_loop_sound == false) |
7 |
{ |
8 |
audio_play_sound(snd_mart_wings_out, 20, 0); |
9 |
no_loop_sound = true; |
10 |
} |
11 |
else if (floor(image_index) > 6) |
12 |
{ |
13 |
no_loop_sound = false; |
14 |
} |
15 |
} |
16 |
else if (sprite_index == spr_martlet_p_full_fly_during || sprite_index == spr_martlet_g_full_fly_during) |
17 |
{ |
18 |
if (fly_state == 0) |
19 |
{ |
20 |
if (y > (default_y - max_y)) |
21 |
{ |
22 |
if (floor(image_index) >= 2 && floor(image_index) <= 4) |
23 |
y -= speed_y; |
24 |
if (y <= (default_y - max_y)) |
25 |
{ |
26 |
y = default_y - max_y; |
27 |
fly_state = 1; |
28 |
if (!audio_is_playing(snd_mart_wind)) |
29 |
audio_play_sound(snd_mart_wind, 20, 1); |
30 |
} |
31 |
} |
32 |
} |
33 |
if (fly_state == 1) |
34 |
{ |
35 |
if (floor(image_index) >= 1 && floor(image_index) <= 3) |
36 |
{ |
37 |
with (obj_heart_battle_fighting_parent) |
38 |
vsp_factor = round(4.8); |
39 |
} |
40 |
else |
41 |
{ |
42 |
with (obj_heart_battle_fighting_parent) |
43 |
vsp_factor = 0; |
44 |
} |
45 |
if (atk_counter_current == 0) |
46 |
event_user(0); |
47 |
if (atk_alarm_no_loop == false) |
48 |
{ |
49 |
alarm[0] = atk_alarm; |
50 |
atk_alarm_no_loop = true; |
51 |
} |
52 |
} |
53 |
if (fly_state == 2) |
54 |
{ |
55 |
if (!instance_exists(obj_battle_enemy_attack_martlet_wing_gust_junk)) |
56 |
event_user(1); |
57 |
} |
58 |
if (fly_state == 3) |
59 |
{ |
60 |
if (floor(image_index) == image_index_during_e) |
61 |
{ |
62 |
image_index = 0; |
63 |
image_speed = 0; |
64 |
fly_state = 4; |
65 |
} |
66 |
} |
67 |
if (fly_state == 4) |
68 |
{ |
69 |
game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2); |
70 |
animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math)); |
71 |
time_elapsed += time_increase; |
72 |
if (time_elapsed >= (time_max + 1)) |
73 |
{ |
74 |
if (sprite_index == spr_martlet_p_full_fly_during) |
75 |
{ |
76 |
audio_play_sound(snd_mart_pacifistland, 20, 0); |
77 |
sprite_index = spr_martlet_p_full_fly_end; |
78 |
} |
79 |
else |
80 |
{ |
81 |
audio_play_sound(snd_mart_genoland, 20, 0); |
82 |
sprite_index = spr_martlet_g_full_fly_end; |
83 |
} |
84 |
image_speed = image_speed_end; |
85 |
image_index = image_index_end; |
86 |
} |
87 |
y = default_y + animation_disjoint_y; |
88 |
} |
89 |
if (fly_state < 4) |
90 |
{ |
91 |
if (floor(image_index) == 2 && no_loop_sound == false) |
92 |
{ |
93 |
particles_spawn = true; |
94 |
audio_play_sound(snd_mart_flap, 20, 0); |
95 |
no_loop_sound = true; |
96 |
} |
97 |
else if (floor(image_index) != 2) |
98 |
{ |
99 |
no_loop_sound = false; |
100 |
} |
101 |
} |
102 |
} |
103 |
if (particles_spawn) |
104 |
{ |
105 |
var inc = 22.857142857142858; |
106 |
for (var i = 0; i < 7; i++) |
107 |
{ |
108 |
var xx = 250 + (i * inc); |
109 |
var yy = 270 + (sign(i % 2) * 20) + random_range(-10, 10); |
110 |
part_particles_create(global.ps, xx, yy, global.pt_Effect1, 1); |
111 |
part_particles_create(global.ps, xx, (yy - 60) + random_range(-10, 10), global.pt_Effect1, 1); |
112 |
} |
113 |
} |