1 |
if (image_alpha < 0.99) |
2 |
{ |
3 |
image_alpha = lerp(image_alpha, 1, 0.15); |
4 |
exit; |
5 |
} |
6 |
else |
7 |
{ |
8 |
image_alpha = 1; |
9 |
} |
10 |
if (attack_stage == 1) |
11 |
{ |
12 |
gravity = 0.5; |
13 |
if (vspeed > 10) |
14 |
vspeed = 10; |
15 |
if (y >= target_y) |
16 |
{ |
17 |
y = target_y; |
18 |
gravity = 0; |
19 |
vspeed = 0; |
20 |
screenshake = true; |
21 |
attack_stage += 1; |
22 |
audio_play_sound(snd_metallic_impact, 1, 0); |
23 |
} |
24 |
} |
25 |
if (attack_stage == 2) |
26 |
{ |
27 |
if (!alarm[0]) |
28 |
alarm[0] = 40; |
29 |
} |
30 |
if (attack_stage == 3) |
31 |
{ |
32 |
swing_speed += 0.1; |
33 |
if (swing_speed > swing_speed_max) |
34 |
swing_speed = swing_speed_max; |
35 |
var dirnew = direction + swing_speed; |
36 |
if (dirnew >= 360) |
37 |
swing_speed_max += 1; |
38 |
direction = dirnew; |
39 |
image_angle = direction; |
40 |
} |
41 |
if (screenshake == true) |
42 |
{ |
43 |
__view_set(e__VW.XView, 0, 0); |
44 |
__view_set(e__VW.YView, 0, 0); |
45 |
__view_set(e__VW.XView, 0, __view_get(e__VW.XView, 0) + choose(-screenshake_max, screenshake_max)); |
46 |
__view_set(e__VW.YView, 0, __view_get(e__VW.YView, 0) + choose(-screenshake_max, screenshake_max)); |
47 |
screenshake_max -= 0.5; |
48 |
} |
49 |
if (screenshake_max <= 0 && image_index >= (image_number - 1)) |
50 |
{ |
51 |
__view_set(e__VW.XView, 0, 0); |
52 |
__view_set(e__VW.YView, 0, 0); |
53 |
} |
54 |
|
55 |
enum e__VW |
56 |
{ |
57 |
XView, |
58 |
YView, |
59 |
WView, |
60 |
HView, |
61 |
Angle, |
62 |
HBorder, |
63 |
VBorder, |
64 |
HSpeed, |
65 |
VSpeed, |
66 |
Object, |
67 |
Visible, |
68 |
XPort, |
69 |
YPort, |
70 |
WPort, |
71 |
HPort, |
72 |
Camera, |
73 |
SurfaceID |
74 |
} |