1 |
if (image_alpha < 0.99) |
2 |
{ |
3 |
image_alpha = lerp(image_alpha, 1, 0.15) |
4 |
return; |
5 |
} |
6 |
else |
7 |
image_alpha = 1 |
8 |
if (attack_stage == 1) |
9 |
{ |
10 |
gravity = 0.5 |
11 |
if (vspeed > 10) |
12 |
vspeed = 10 |
13 |
if (y >= target_y) |
14 |
{ |
15 |
y = target_y |
16 |
gravity = 0 |
17 |
vspeed = 0 |
18 |
screenshake = true |
19 |
attack_stage += 1 |
20 |
audio_play_sound(snd_metallic_impact, 1, 0) |
21 |
} |
22 |
} |
23 |
if (attack_stage == 2) |
24 |
{ |
25 |
if (!alarm[0]) |
26 |
alarm[0] = 40 |
27 |
} |
28 |
if (attack_stage == 3) |
29 |
{ |
30 |
swing_speed += 0.1 |
31 |
if (swing_speed > swing_speed_max) |
32 |
swing_speed = swing_speed_max |
33 |
var dirnew = direction + swing_speed |
34 |
if (dirnew >= 360) |
35 |
swing_speed_max += 1 |
36 |
direction = dirnew |
37 |
image_angle = direction |
38 |
} |
39 |
if (screenshake == true) |
40 |
{ |
41 |
__view_set((0 << 0), 0, 0) |
42 |
__view_set((1 << 0), 0, 0) |
43 |
__view_set((0 << 0), 0, ((__view_get((0 << 0), 0)) + (choose((-screenshake_max), screenshake_max)))) |
44 |
__view_set((1 << 0), 0, ((__view_get((1 << 0), 0)) + (choose((-screenshake_max), screenshake_max)))) |
45 |
screenshake_max -= 0.5 |
46 |
} |
47 |
if (screenshake_max <= 0 && image_index >= (image_number - 1)) |
48 |
{ |
49 |
__view_set((0 << 0), 0, 0) |
50 |
__view_set((1 << 0), 0, 0) |
51 |
} |