1 |
if (instance_exists(obj_waterboardpuzzle1)) |
2 |
{ |
3 |
if (myinteract == 1 && using == 0 && obj_waterboardpuzzle1.waterboard == 0) |
4 |
{ |
5 |
if (snd_isplaying(snd_movemenu) == 0) |
6 |
snd_play(snd_movemenu); |
7 |
using = 1; |
8 |
obj_waterboardpuzzle1.waterboard = 1; |
9 |
myinteract = 0; |
10 |
solid = 0; |
11 |
} |
12 |
else if (myinteract == 1 && using == 0) |
13 |
{ |
14 |
myinteract = 0; |
15 |
} |
16 |
} |
17 |
if (myinteract == 1 && using == 1) |
18 |
{ |
19 |
x -= 40; |
20 |
with (obj_mainchara) |
21 |
{ |
22 |
if (global.facing == 2) |
23 |
{ |
24 |
if (collision_rectangle(x + 4, (y + sprite_height) - 5, (x + sprite_width) - 4, y + 5, obj_interactable, 0, 1)) |
25 |
{ |
26 |
interactedobject = collision_rectangle(x + 4, (y + sprite_height) - 5, (x + sprite_width) - 4, y + 8, obj_interactable, 0, 1); |
27 |
if (interactedobject != -4) |
28 |
{ |
29 |
with (interactedobject) |
30 |
facing = 0; |
31 |
with (interactedobject) |
32 |
script_execute(scr_interact); |
33 |
} |
34 |
} |
35 |
} |
36 |
} |
37 |
myinteract = 0; |
38 |
x += 40; |
39 |
} |
40 |
if (using == 1) |
41 |
{ |
42 |
global.encounter = 0; |
43 |
x = obj_mainchara.x; |
44 |
y = obj_mainchara.y - 10; |
45 |
depth = obj_mainchara.depth - 2; |
46 |
if (global.interact == 0) |
47 |
{ |
48 |
if (control_check_pressed(0) == 1) |
49 |
{ |
50 |
if (global.facing == 0) |
51 |
{ |
52 |
j = instance_position(obj_mainchara.x + 10, obj_mainchara.y + 40, obj_npc_marker); |
53 |
h = instance_position(obj_mainchara.x + 10, obj_mainchara.y + 40, obj_waterboard); |
54 |
g = instance_position(obj_mainchara.x + 10, obj_mainchara.y + 40, obj_waterspot); |
55 |
if (h == -4 && j == -4) |
56 |
{ |
57 |
if (g != -4) |
58 |
{ |
59 |
y = obj_mainchara.y + 30; |
60 |
move_snap(20, 20); |
61 |
using = 2; |
62 |
dir = 0; |
63 |
} |
64 |
} |
65 |
} |
66 |
if (global.facing == 2) |
67 |
{ |
68 |
g = instance_position(obj_mainchara.x + 10, obj_mainchara.y, obj_waterspot); |
69 |
if (g != -4) |
70 |
{ |
71 |
if (!collision_point(obj_mainchara.x + 10, obj_mainchara.y, obj_waterboard, 0, 1)) |
72 |
{ |
73 |
y = obj_mainchara.y; |
74 |
move_snap(20, 20); |
75 |
using = 2; |
76 |
dir = 2; |
77 |
} |
78 |
} |
79 |
} |
80 |
if (global.facing == 1) |
81 |
{ |
82 |
j = instance_position(obj_mainchara.x + 30, obj_mainchara.y + 20, obj_npc_marker); |
83 |
h = instance_position(obj_mainchara.x + 30, obj_mainchara.y + 20, obj_waterboard); |
84 |
g = instance_position(obj_mainchara.x + 30, obj_mainchara.y + 20, obj_waterspot); |
85 |
if (j == -4) |
86 |
{ |
87 |
if (h == -4) |
88 |
{ |
89 |
if (g != -4) |
90 |
{ |
91 |
y = obj_mainchara.y + 10; |
92 |
x = obj_mainchara.x + 20; |
93 |
move_snap(20, 20); |
94 |
using = 2; |
95 |
dir = 1; |
96 |
} |
97 |
} |
98 |
} |
99 |
} |
100 |
if (global.facing == 3) |
101 |
{ |
102 |
j = instance_position(obj_mainchara.x - 10, obj_mainchara.y + 20, obj_npc_marker); |
103 |
h = instance_position(obj_mainchara.x - 10, obj_mainchara.y + 20, obj_waterboard); |
104 |
g = instance_position(obj_mainchara.x - 10, obj_mainchara.y + 20, obj_waterspot); |
105 |
if (j == -4) |
106 |
{ |
107 |
if (h == -4) |
108 |
{ |
109 |
if (g != -4) |
110 |
{ |
111 |
y = obj_mainchara.y + 10; |
112 |
x = obj_mainchara.x - 20; |
113 |
move_snap(20, 20); |
114 |
using = 2; |
115 |
dir = 3; |
116 |
} |
117 |
} |
118 |
} |
119 |
} |
120 |
if (using == 2) |
121 |
obj_waterboardpuzzle1.waterboard = 0; |
122 |
} |
123 |
} |
124 |
} |
125 |
if (using == 2) |
126 |
{ |
127 |
depth = 900000; |
128 |
if (dir == 2) |
129 |
{ |
130 |
y -= 2; |
131 |
if (instance_position(x + 10, y - 2, obj_npc_marker) != -4) |
132 |
using = 3; |
133 |
if (instance_position(x + 10, y - 2, obj_waterstop) != -4) |
134 |
using = 3; |
135 |
if (instance_position(x + 10, y - 2, obj_waterboard) != -4) |
136 |
using = 3; |
137 |
} |
138 |
if (dir == 1) |
139 |
{ |
140 |
x += 2; |
141 |
if (instance_position(x + 20, y + 10, obj_npc_marker) != -4) |
142 |
using = 3; |
143 |
if (instance_position(x + 20, y + 10, obj_waterstop) != -4) |
144 |
using = 3; |
145 |
if (instance_position(x + 20, y + 10, obj_waterboard) != -4) |
146 |
using = 3; |
147 |
} |
148 |
if (dir == 0) |
149 |
{ |
150 |
y += 2; |
151 |
if (instance_position(x + 10, y + 22, obj_npc_marker) != -4) |
152 |
using = 3; |
153 |
if (instance_position(x + 10, y + 22, obj_waterstop) != -4) |
154 |
using = 3; |
155 |
if (instance_position(x + 10, y + 22, obj_waterboard) != -4) |
156 |
using = 3; |
157 |
} |
158 |
if (dir == 3) |
159 |
{ |
160 |
x -= 2; |
161 |
if (instance_position(x - 2, y + 10, obj_npc_marker) != -4) |
162 |
using = 3; |
163 |
if (instance_position(x - 2, y + 10, obj_waterstop) != -4) |
164 |
using = 3; |
165 |
if (instance_position(x - 2, y + 10, obj_waterboard) != -4) |
166 |
using = 3; |
167 |
} |
168 |
if (using == 3) |
169 |
move_snap(20, 20); |
170 |
} |
171 |
if (using == 5) |
172 |
{ |
173 |
image_speed = 0.17; |
174 |
alarm[2] = 30;gml_Object_obj_waterboard_Alarm_2.gmlusing = 7;
move_snap(20, 20);
block = instance_position(x + 10, y + 10, obj_solidparent);
if (block != -4)
{
if (instance_exists(obj_bellblossom))
{
obj_bellblossom.block2 = block;
with (obj_bellblossom)
event_user(0);
}
block.x = 0;
block.y = 0;
}
using = 99;
image_speed = 0;
image_index = 6;
depth = 800000; |
175 |
using = 6; |
176 |
} |