1 |
if (con == 0) |
2 |
{ |
3 |
if (x >= (__view_get(e__VW.XView, 0) + 40) && x <= (__view_get(e__VW.XView, 0) + 600)) |
4 |
{ |
5 |
if (obj_mainchara.x == obj_mainchara.xprevious && eggcon == 0) |
6 |
eggtimer += 1; |
7 |
if (eggtimer >= 600 && eggcon == 0) |
8 |
{ |
9 |
eggtimer = 0; |
10 |
eggcon = 1; |
11 |
} |
12 |
} |
13 |
if (eggcon == 1) |
14 |
{ |
15 |
if (image_index <= 10) |
16 |
image_index += 0.1; |
17 |
} |
18 |
if ((obj_mainchara.x + 10) >= (x - 150) && (obj_mainchara.x + 10) <= (x + 150)) |
19 |
{ |
20 |
con = 1; |
21 |
sprite_index = spr_ch2_gimmick_wallplug_attack; |
22 |
if (obj_mainchara.x < x) |
23 |
image_yscale = -2; |
24 |
image_speed = 0.2; |
25 |
eggtimer = 0; |
26 |
eggcon = 0; |
27 |
image_index = 0; |
28 |
image_angle = point_direction(x, y, obj_mainchara.x + 10, obj_mainchara.y + 20); |
29 |
direction = image_angle; |
30 |
speed = 4; |
31 |
timer = 0; |
32 |
lerped = 0; |
33 |
} |
34 |
} |
35 |
if (con == 1) |
36 |
{ |
37 |
timer += 1; |
38 |
if (timer < 13) |
39 |
{ |
40 |
if (timer == 1) |
41 |
snd_play(snd_wallclaw); |
42 |
speed += 2; |
43 |
} |
44 |
if (timer >= 13) |
45 |
{ |
46 |
speed = 0; |
47 |
curx = x; |
48 |
cury = y; |
49 |
} |
50 |
if (timer >= 16) |
51 |
{ |
52 |
lerped = lerped + (lerped / 10) + 0.02; |
53 |
x = lerp(curx, basex, lerped); |
54 |
y = lerp(cury, basey, lerped); |
55 |
if (lerped >= 1) |
56 |
{ |
57 |
x = basex; |
58 |
y = basey; |
59 |
image_index = 0; |
60 |
image_speed = 0; |
61 |
con = 0; |
62 |
image_yscale = 2; |
63 |
if ((obj_mainchara.x + 10) >= (x - 150) && (obj_mainchara.x + 10) <= (x + 150)) |
64 |
{ |
65 |
con = 1; |
66 |
sprite_index = spr_ch2_gimmick_wallplug_attack; |
67 |
if (obj_mainchara.x < x) |
68 |
image_yscale = -2; |
69 |
image_speed = 0.5; |
70 |
eggtimer = 0; |
71 |
eggcon = 0; |
72 |
image_index = 0; |
73 |
image_angle = point_direction(x, y, obj_mainchara.x + 20, obj_mainchara.y + 35); |
74 |
direction = image_angle; |
75 |
speed = 4; |
76 |
timer = 0; |
77 |
lerped = 0; |
78 |
} |
79 |
else |
80 |
{ |
81 |
sprite_index = spr_ch2_gimmick_wallplug; |
82 |
} |
83 |
eggtimer = 0; |
84 |
eggcon = 0; |
85 |
} |
86 |
} |
87 |
} |
88 |
|
89 |
enum e__VW |
90 |
{ |
91 |
XView, |
92 |
YView, |
93 |
WView, |
94 |
HView, |
95 |
Angle, |
96 |
HBorder, |
97 |
VBorder, |
98 |
HSpeed, |
99 |
VSpeed, |
100 |
Object, |
101 |
Visible, |
102 |
XPort, |
103 |
YPort, |
104 |
WPort, |
105 |
HPort, |
106 |
Camera, |
107 |
SurfaceID |
108 |
} |