|
1
|
scr_populatecharsscr_populatechars
function scr_populatechars()
{
if (!variable_instance_exists(id, "kris"))
kris = 0;
if (!variable_instance_exists(id, "ralsei"))
ralsei = 0;
if (!variable_instance_exists(id, "susie"))
susie = 0;
if (!variable_instance_exists(id, "noelle"))
noelle = 0;
if (kris == 0)
{
with (obj_mainchara)
other.kris = id;
}
if (susie == 0)
{
with (obj_caterpillarchara)
{
if (name == "susie")
other.susie = id;
}
}
if (ralsei == 0)
{
with (obj_caterpillarchara)
{
if (name == "ralsei")
other.ralsei = id;
}
}
if (noelle == 0)
{
with (obj_caterpillarchara)
{
if (name == "noelle")
other.noelle = id;
}
}
} ();
|
|
2
|
var shelfx = 0;
|
|
3
|
var shelfy = 0;
|
|
4
|
if (i_ex(myshelf[mpos]))
|
|
5
|
{
|
|
6
|
shelfx = (myshelf[mpos].x + 40) - 320;
|
|
7
|
shelfy = (myshelf[mpos].y + 80) - 240;
|
|
8
|
var inst = -4;
|
|
9
|
with (myshelf[mpos])
|
|
10
|
inst = instance_place(x, y, obj_camera_clamper);
|
|
11
|
var _xmin = 0;
|
|
12
|
var _xmax = room_width - 640;
|
|
13
|
var _ymin = 0;
|
|
14
|
var _ymax = room_height - 480;
|
|
15
|
with (inst)
|
|
16
|
{
|
|
17
|
if (xmin != -4)
|
|
18
|
_xmin = xmin;
|
|
19
|
if (ymin != -4)
|
|
20
|
_ymin = ymin;
|
|
21
|
if (xmax != -4)
|
|
22
|
_xmax = xmax;
|
|
23
|
if (ymax != -4)
|
|
24
|
_ymax = ymax;
|
|
25
|
}
|
|
26
|
shelfx = clamp(shelfx, _xmin, _xmax);
|
|
27
|
shelfy = clamp(shelfy, _ymin, _ymax);
|
|
28
|
}
|
|
29
|
buffer--;
|
|
30
|
if (engaged)
|
|
31
|
{
|
|
32
|
ubuff--;
|
|
33
|
rbuff--;
|
|
34
|
lbuff--;
|
|
35
|
dbuff--;
|
|
36
|
xbuff--;
|
|
37
|
zbuff--;
|
|
38
|
if (up_h())
|
|
39
|
ubuff = 3;
|
|
40
|
if (down_h())
|
|
41
|
dbuff = 3;
|
|
42
|
if (left_h())
|
|
43
|
lbuff = 3;
|
|
44
|
if (right_h())
|
|
45
|
rbuff = 3;
|
|
46
|
if (button2_h())
|
|
47
|
xbuff = 3;
|
|
48
|
if (button1_p())
|
|
49
|
zbuff = 8;
|
|
50
|
if (con == 0.1)
|
|
51
|
{
|
|
52
|
con = 99;
|
|
53
|
global.interact = 1;
|
|
54
|
kris.cutscene = true;
|
|
55
|
if (audio_is_playing(global.currentsong[1]))
|
|
56
|
{
|
|
57
|
memvolume = audio_sound_get_gain(global.currentsong[1]);
|
|
58
|
debug_message(memvolume);
|
|
59
|
snd_volume(global.currentsong[1], memvolume * 0.125, 15);
|
|
60
|
}
|
|
61
|
else
|
|
62
|
{
|
|
63
|
memvolume = -1;
|
|
64
|
}
|
|
65
|
cutscene_master = scr_cutscene_makescr_cutscene_make
function scr_cutscene_make()
{
_cutscene_master = instance_create(0, 0, obj_cutscene_master);
_cutscene_master.master_object = id;
return _cutscene_master;
} ();
|
|
66
|
var makecaterpillaractors = false;
|
|
67
|
if (makecaterpillaractors)
|
|
68
|
{
|
|
69
|
scr_maincharacters_actorsscr_maincharacters_actors
function scr_maincharacters_actors()
{
actor_count = 0;
kr = 0;
kr_actor = instance_create(obj_mainchara.x, obj_mainchara.y, obj_actor);
scr_actor_setup(kr, kr_actor, "kris");
kr_actor.sprite_index = obj_mainchara.sprite_index;
kr_actor.depth = obj_mainchara.depth;
with (obj_mainchara)
visible = 0;
for (__jj = 0; __jj < array_length_1d(global.cinstance); __jj++)
{
if (i_ex(global.cinstance[__jj]))
{
if (global.cinstance[__jj].name == "susie")
{
actor_count++;
su = __jj + 1;
su_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(su, su_actor, "susie");
su_actor.sprite_index = global.cinstance[__jj].sprite_index;
su_actor.depth = global.cinstance[__jj].depth;
with (global.cinstance[__jj])
visible = 0;
}
if (global.cinstance[__jj].name == "ralsei")
{
actor_count++;
ra = __jj + 1;
ra_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(ra, ra_actor, "ralsei");
ra_actor.sprite_index = global.cinstance[__jj].sprite_index;
ra_actor.depth = global.cinstance[__jj].depth;
with (global.cinstance[__jj])
visible = 0;
}
if (global.cinstance[__jj].name == "noelle")
{
actor_count++;
no = __jj + 1;
no_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(no, no_actor, "noelle");
no_actor.sprite_index = global.cinstance[__jj].sprite_index;
no_actor.depth = global.cinstance[__jj].depth;
with (global.cinstance[__jj])
visible = 0;
}
}
}
} ();
|
|
70
|
}
|
|
71
|
else
|
|
72
|
{
|
|
73
|
actor_count = 0;
|
|
74
|
kr = 0;
|
|
75
|
kr_actor = instance_create(obj_mainchara.x, obj_mainchara.y, obj_actor);
|
|
76
|
scr_actor_setupscr_actor_setup
function scr_actor_setup(arg0, arg1, arg2)
{
_actorid = arg0;
_actorinstance = arg1;
_actorname = arg2;
obj_cutscene_master.actor_id[_actorid] = _actorinstance;
obj_cutscene_master.actor_name[_actorid] = _actorname;
with (_actorinstance)
{
number = arg0;
scr_set_facing_sprites(arg2);
}
} (kr, kr_actor, "kris");
|
|
77
|
kr_actor.sprite_index = obj_mainchara.sprite_index;
|
|
78
|
kr_actor.depth = obj_mainchara.depth;
|
|
79
|
with (obj_mainchara)
|
|
80
|
visible = 0;
|
|
81
|
}
|
|
82
|
if (makecaterpillaractors)
|
|
83
|
{
|
|
84
|
var realsusie = -4;
|
|
85
|
var realralsei = -4;
|
|
86
|
with (obj_caterpillarchara)
|
|
87
|
{
|
|
88
|
if (name == "susie")
|
|
89
|
realsusie = id;
|
|
90
|
}
|
|
91
|
with (obj_caterpillarchara)
|
|
92
|
{
|
|
93
|
if (name == "ralsei")
|
|
94
|
realralsei = id;
|
|
95
|
}
|
|
96
|
if (i_ex(realsusie))
|
|
97
|
{
|
|
98
|
with (obj_light_following)
|
|
99
|
{
|
|
100
|
if (target == realsusie)
|
|
101
|
target = other.su_actor;
|
|
102
|
}
|
|
103
|
}
|
|
104
|
if (i_ex(realralsei))
|
|
105
|
{
|
|
106
|
with (obj_light_following)
|
|
107
|
{
|
|
108
|
if (target == realralsei)
|
|
109
|
target = other.ra_actor;
|
|
110
|
}
|
|
111
|
}
|
|
112
|
}
|
|
113
|
var krx = x + 12;
|
|
114
|
var kry = y + 4;
|
|
115
|
with (obj_krmarker)
|
|
116
|
{
|
|
117
|
if (extflag == other.extflag)
|
|
118
|
{
|
|
119
|
krx = x;
|
|
120
|
kry = y;
|
|
121
|
}
|
|
122
|
}
|
|
123
|
if (array_length(myshelf) > 1)
|
|
124
|
{
|
|
125
|
if (mpos == 0)
|
|
126
|
{
|
|
127
|
var pos = scr_heromarkerscr_heromarker
function scr_heromarker(arg0 = "", arg1 = "")
{
var ____foundmarker = -4;
var xpos = -1;
var ypos = -1;
var objindextocheck = 1365;
if (string_pos("kr", arg0) != 0)
objindextocheck = 544;
if (string_pos("su", arg0) != 0)
objindextocheck = 522;
if (string_pos("ra", arg0) != 0)
objindextocheck = 75;
if (string_pos("no", arg0) != 0)
objindextocheck = 933;
if (string_pos("gen", arg0) != 0)
objindextocheck = 1365;
with (objindextocheck)
{
if (variable_instance_exists(id, "extflag"))
{
if (extflag == arg1)
____foundmarker = id;
}
}
if (instance_exists(____foundmarker))
{
xpos = ____foundmarker.x;
ypos = ____foundmarker.y;
}
if (____foundmarker == -4)
{
debug_message("scr_heromarker(" + arg0 + "," + arg1 + ") Object Not Found");
return [-4, -4, -4];
}
return [xpos, ypos, ____foundmarker];
}
function scr_genmarker(arg0 = "")
{
var marker = -4;
with (obj_genmarker)
{
if (extflag == arg0)
marker = id;
}
return marker;
} ("kris", extflag + "a");
|
|
128
|
krx = pos[0];
|
|
129
|
kry = pos[1];
|
|
130
|
}
|
|
131
|
if (mpos == 1)
|
|
132
|
{
|
|
133
|
var pos = scr_heromarkerscr_heromarker
function scr_heromarker(arg0 = "", arg1 = "")
{
var ____foundmarker = -4;
var xpos = -1;
var ypos = -1;
var objindextocheck = 1365;
if (string_pos("kr", arg0) != 0)
objindextocheck = 544;
if (string_pos("su", arg0) != 0)
objindextocheck = 522;
if (string_pos("ra", arg0) != 0)
objindextocheck = 75;
if (string_pos("no", arg0) != 0)
objindextocheck = 933;
if (string_pos("gen", arg0) != 0)
objindextocheck = 1365;
with (objindextocheck)
{
if (variable_instance_exists(id, "extflag"))
{
if (extflag == arg1)
____foundmarker = id;
}
}
if (instance_exists(____foundmarker))
{
xpos = ____foundmarker.x;
ypos = ____foundmarker.y;
}
if (____foundmarker == -4)
{
debug_message("scr_heromarker(" + arg0 + "," + arg1 + ") Object Not Found");
return [-4, -4, -4];
}
return [xpos, ypos, ____foundmarker];
}
function scr_genmarker(arg0 = "")
{
var marker = -4;
with (obj_genmarker)
{
if (extflag == arg0)
marker = id;
}
return marker;
} ("kris", extflag + "b");
|
|
134
|
krx = pos[0];
|
|
135
|
kry = pos[1];
|
|
136
|
}
|
|
137
|
}
|
|
138
|
c_selc_sel
function c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
} (kr);
|
|
139
|
var dist = max(round(point_distance(obj_mainchara.x, obj_mainchara.y, krx, kry) / 4), 1);
|
|
140
|
c_walkdirectc_walkdirect
function c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
} (krx, kry, dist);
|
|
141
|
if (makecaterpillaractors)
|
|
142
|
{
|
|
143
|
if (i_ex(ralsei))
|
|
144
|
{
|
|
145
|
c_selc_sel
function c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
} (ra);
|
|
146
|
var rax = kr_x - 27 - 8;
|
|
147
|
var ray = kr_y + 30 + 2 + 1;
|
|
148
|
with (obj_ramarker)
|
|
149
|
{
|
|
150
|
if (extflag == other.extflag)
|
|
151
|
{
|
|
152
|
rax = x;
|
|
153
|
ray = y;
|
|
154
|
}
|
|
155
|
}
|
|
156
|
c_walkdirectc_walkdirect
function c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
} (rax, ray, dist);
|
|
157
|
}
|
|
158
|
if (i_ex(susie))
|
|
159
|
{
|
|
160
|
c_selc_sel
function c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
} (su);
|
|
161
|
var sux = kr_x + 30;
|
|
162
|
var suy = kr_y + 30;
|
|
163
|
with (obj_sumarker)
|
|
164
|
{
|
|
165
|
if (extflag == other.extflag)
|
|
166
|
{
|
|
167
|
sux = x;
|
|
168
|
suy = y;
|
|
169
|
}
|
|
170
|
}
|
|
171
|
c_walkdirectc_walkdirect
function c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
} (sux, suy, dist);
|
|
172
|
}
|
|
173
|
}
|
|
174
|
c_waitc_wait
function c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
} (dist);
|
|
175
|
c_var_instancec_var_instance
function c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
} (id, "resetlight", 1);
|
|
176
|
c_waitc_wait
function c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
} (1);
|
|
177
|
c_var_instancec_var_instance
function c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
} (id, "con", 0.2);
|
|
178
|
c_actortokrisc_actortokris
function c_actortokris()
{
c_cmd("actortokris", 0, 0, 0, 0);
} ();
|
|
179
|
c_actortocaterpillarc_actortocaterpillar
function c_actortocaterpillar()
{
c_cmd("actortocaterpillar", 0, 0, 0, 0);
} ();
|
|
180
|
c_terminatekillactorsc_terminatekillactors
function c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
} ();
|
|
181
|
}
|
|
182
|
if (con == 0.2 && !i_ex(cutscene_master))
|
|
183
|
{
|
|
184
|
con = 1;
|
|
185
|
timer = 0;
|
|
186
|
}
|
|
187
|
if (con == 1)
|
|
188
|
{
|
|
189
|
with (obj_dw_church_bookshelfpuzzle)
|
|
190
|
flooractive = 1;
|
|
191
|
with (obj_dw_church_pianopiece_right)
|
|
192
|
flooractive = 1;
|
|
193
|
timer++;
|
|
194
|
if (timer == 1)
|
|
195
|
{
|
|
196
|
showtut = true;
|
|
197
|
global.interact = 1;
|
|
198
|
camcont = true;
|
|
199
|
obj_mainchara.cutscene = 1;
|
|
200
|
global.facing = 2;
|
|
201
|
obj_mainchara.ignoredepth = true;
|
|
202
|
desiredx = camerax();
|
|
203
|
desiredy = cameray();
|
|
204
|
if (!followshelf)
|
|
205
|
{
|
|
206
|
scr_lerpvarscr_lerpvar
function scr_lerpvar()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar;
}
function scr_lerpvar_respect()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true;
return ___lerpvar;
} ("desiredx", camerax(), clamp(camx, 0, room_width - 640), 15, 2, "out");
|
|
207
|
scr_lerpvarscr_lerpvar
function scr_lerpvar()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar;
}
function scr_lerpvar_respect()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true;
return ___lerpvar;
} ("desiredy", cameray(), clamp(camy, 0, room_height - 480), 15, 2, "out");
|
|
208
|
}
|
|
209
|
else
|
|
210
|
{
|
|
211
|
scr_lerpvarscr_lerpvar
function scr_lerpvar()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar;
}
function scr_lerpvar_respect()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true;
return ___lerpvar;
} ("desiredx", camerax(), clamp(shelfx, 0, room_width - 640), 15, 2, "out");
|
|
212
|
scr_lerpvarscr_lerpvar
function scr_lerpvar()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar;
}
function scr_lerpvar_respect()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true;
return ___lerpvar;
} ("desiredy", cameray(), clamp(shelfy, 0, room_height - 480), 15, 2, "out");
|
|
213
|
}
|
|
214
|
}
|
|
215
|
if (timer == 15)
|
|
216
|
{
|
|
217
|
con = 2;
|
|
218
|
timer = 0;
|
|
219
|
}
|
|
220
|
}
|
|
221
|
if (con == 2)
|
|
222
|
{
|
|
223
|
if (xbuff)
|
|
224
|
{
|
|
225
|
dbuff = 0;
|
|
226
|
rbuff = 0;
|
|
227
|
ubuff = 0;
|
|
228
|
lbuff = 0;
|
|
229
|
zbuff = 0;
|
|
230
|
}
|
|
231
|
if (button2_h() && myshelf[mpos].con == 0)
|
|
232
|
endtimer++;
|
|
233
|
else
|
|
234
|
endtimer = 0;
|
|
235
|
if (endtimer >= endtime)
|
|
236
|
{
|
|
237
|
timer = 0;
|
|
238
|
con = 98;
|
|
239
|
}
|
|
240
|
if (buffer <= 0 && myshelf[mpos].con == 0)
|
|
241
|
{
|
|
242
|
var move = 0;
|
|
243
|
if (array_length(myshelf) > 1)
|
|
244
|
{
|
|
245
|
if (button3_p())
|
|
246
|
{
|
|
247
|
move = -1;
|
|
248
|
mpos++;
|
|
249
|
if (mpos > (array_length(myshelf) - 1))
|
|
250
|
mpos = 0;
|
|
251
|
var krx = kris.x;
|
|
252
|
krx = kris.y;
|
|
253
|
var kry;
|
|
254
|
if (mpos == 0)
|
|
255
|
{
|
|
256
|
var pos = scr_heromarkerscr_heromarker
function scr_heromarker(arg0 = "", arg1 = "")
{
var ____foundmarker = -4;
var xpos = -1;
var ypos = -1;
var objindextocheck = 1365;
if (string_pos("kr", arg0) != 0)
objindextocheck = 544;
if (string_pos("su", arg0) != 0)
objindextocheck = 522;
if (string_pos("ra", arg0) != 0)
objindextocheck = 75;
if (string_pos("no", arg0) != 0)
objindextocheck = 933;
if (string_pos("gen", arg0) != 0)
objindextocheck = 1365;
with (objindextocheck)
{
if (variable_instance_exists(id, "extflag"))
{
if (extflag == arg1)
____foundmarker = id;
}
}
if (instance_exists(____foundmarker))
{
xpos = ____foundmarker.x;
ypos = ____foundmarker.y;
}
if (____foundmarker == -4)
{
debug_message("scr_heromarker(" + arg0 + "," + arg1 + ") Object Not Found");
return [-4, -4, -4];
}
return [xpos, ypos, ____foundmarker];
}
function scr_genmarker(arg0 = "")
{
var marker = -4;
with (obj_genmarker)
{
if (extflag == arg0)
marker = id;
}
return marker;
} ("kris", extflag + "a");
|
|
257
|
krx = pos[0];
|
|
258
|
kry = pos[1];
|
|
259
|
}
|
|
260
|
if (mpos == 1)
|
|
261
|
{
|
|
262
|
var pos = scr_heromarkerscr_heromarker
function scr_heromarker(arg0 = "", arg1 = "")
{
var ____foundmarker = -4;
var xpos = -1;
var ypos = -1;
var objindextocheck = 1365;
if (string_pos("kr", arg0) != 0)
objindextocheck = 544;
if (string_pos("su", arg0) != 0)
objindextocheck = 522;
if (string_pos("ra", arg0) != 0)
objindextocheck = 75;
if (string_pos("no", arg0) != 0)
objindextocheck = 933;
if (string_pos("gen", arg0) != 0)
objindextocheck = 1365;
with (objindextocheck)
{
if (variable_instance_exists(id, "extflag"))
{
if (extflag == arg1)
____foundmarker = id;
}
}
if (instance_exists(____foundmarker))
{
xpos = ____foundmarker.x;
ypos = ____foundmarker.y;
}
if (____foundmarker == -4)
{
debug_message("scr_heromarker(" + arg0 + "," + arg1 + ") Object Not Found");
return [-4, -4, -4];
}
return [xpos, ypos, ____foundmarker];
}
function scr_genmarker(arg0 = "")
{
var marker = -4;
with (obj_genmarker)
{
if (extflag == arg0)
marker = id;
}
return marker;
} ("kris", extflag + "b");
|
|
263
|
krx = pos[0];
|
|
264
|
kry = pos[1];
|
|
265
|
}
|
|
266
|
var dist = max(1, round(point_distance(krx, kry, kris.x, kris.y) / 8));
|
|
267
|
with (kris)
|
|
268
|
scr_lerpvarscr_lerpvar
function scr_lerpvar()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar;
}
function scr_lerpvar_respect()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true;
return ___lerpvar;
} ("x", x, krx, dist, 2, "out");
|
|
269
|
con = -999;
|
|
270
|
var movetime = dist;
|
|
271
|
scr_delay_var("con", 2, movetime + 1);
|
|
272
|
ubuff = 0;
|
|
273
|
dbuff = 0;
|
|
274
|
rbuff = 0;
|
|
275
|
lbuff = 0;
|
|
276
|
cbuff = 0;
|
|
277
|
buffer = 1;
|
|
278
|
}
|
|
279
|
}
|
|
280
|
else if (button3_h())
|
|
281
|
{
|
|
282
|
var doreset = true;
|
|
283
|
with (myshelf[mpos])
|
|
284
|
{
|
|
285
|
if (x == xstart && y == ystart)
|
|
286
|
doreset = false;
|
|
287
|
if (place_meeting(xstart, ystart, object_index))
|
|
288
|
doreset = false;
|
|
289
|
}
|
|
290
|
if (doreset)
|
|
291
|
{
|
|
292
|
shelfresettimer++;
|
|
293
|
ubuff = 0;
|
|
294
|
dbuff = 0;
|
|
295
|
rbuff = 0;
|
|
296
|
lbuff = 0;
|
|
297
|
cbuff = 0;
|
|
298
|
buffer = 1;
|
|
299
|
}
|
|
300
|
if (shelfresettimer >= shelfresettime)
|
|
301
|
{
|
|
302
|
move = -1;
|
|
303
|
with (myshelf[mpos])
|
|
304
|
resetpos = 1;
|
|
305
|
shelfresettimer = 0;
|
|
306
|
}
|
|
307
|
}
|
|
308
|
else
|
|
309
|
{
|
|
310
|
shelfresettimer = 0;
|
|
311
|
}
|
|
312
|
var dodir = -1;
|
|
313
|
if (dbuff > 0 && dbuff > ubuff && dbuff > rbuff && dbuff > lbuff)
|
|
314
|
dodir = 0;
|
|
315
|
if (rbuff > 0 && rbuff > ubuff && rbuff > dbuff && rbuff > lbuff)
|
|
316
|
dodir = 1;
|
|
317
|
if (ubuff > 0 && ubuff > dbuff && ubuff > rbuff && ubuff > lbuff)
|
|
318
|
dodir = 2;
|
|
319
|
if (lbuff > 0 && lbuff > dbuff && lbuff > rbuff && lbuff > ubuff)
|
|
320
|
dodir = 3;
|
|
321
|
var sndtoplay = -1;
|
|
322
|
var pitcher = 0;
|
|
323
|
var mysnd = 524;
|
|
324
|
switch (sprite_index)
|
|
325
|
{
|
|
326
|
case spr_dw_church_remotepiano_blue:
|
|
327
|
mysnd = 587;
|
|
328
|
break;
|
|
329
|
case spr_dw_church_remotepiano_red:
|
|
330
|
mysnd = 338;
|
|
331
|
break;
|
|
332
|
case spr_dw_church_remotepiano_green:
|
|
333
|
mysnd = 52;
|
|
334
|
break;
|
|
335
|
case spr_dw_church_remotepiano_pink:
|
|
336
|
mysnd = 60;
|
|
337
|
break;
|
|
338
|
case spr_dw_church_remotepiano_twotone:
|
|
339
|
if (mpos == 0)
|
|
340
|
mysnd = 524;
|
|
341
|
else
|
|
342
|
mysnd = 586;
|
|
343
|
break;
|
|
344
|
}
|
|
345
|
if (dodir > -1 && zbuff > 0)
|
|
346
|
{
|
|
347
|
if (dodir > -1)
|
|
348
|
{
|
|
349
|
with (myshelf[mpos])
|
|
350
|
{
|
|
351
|
dir = dodir;
|
|
352
|
move = 1;
|
|
353
|
}
|
|
354
|
switch (dodir)
|
|
355
|
{
|
|
356
|
case 0:
|
|
357
|
pitcher = 1;
|
|
358
|
break;
|
|
359
|
case 1:
|
|
360
|
pitcher = 1.12;
|
|
361
|
break;
|
|
362
|
case 2:
|
|
363
|
pitcher = 1.19;
|
|
364
|
break;
|
|
365
|
case 3:
|
|
366
|
pitcher = 0.8928571428571428;
|
|
367
|
break;
|
|
368
|
}
|
|
369
|
}
|
|
370
|
}
|
|
371
|
if (pitcher != 0)
|
|
372
|
snd_play(mysnd, 0.7, pitcher);
|
|
373
|
ubuff = 0;
|
|
374
|
rbuff = 0;
|
|
375
|
lbuff = 0;
|
|
376
|
dbuff = 0;
|
|
377
|
xbuff = 0;
|
|
378
|
zbuff = 0;
|
|
379
|
if (move == 1)
|
|
380
|
{
|
|
381
|
with (myshelf[mpos])
|
|
382
|
{
|
|
383
|
con = 1;
|
|
384
|
timer = 0;
|
|
385
|
}
|
|
386
|
buffer = 6;
|
|
387
|
}
|
|
388
|
}
|
|
389
|
with (obj_bookshelf_moveable2x2)
|
|
390
|
active = false;
|
|
391
|
with (myshelf[mpos])
|
|
392
|
active = true;
|
|
393
|
if (followshelf)
|
|
394
|
{
|
|
395
|
desiredx = lerp(desiredx, shelfx, 0.25);
|
|
396
|
desiredy = lerp(desiredy, shelfy, 0.25);
|
|
397
|
}
|
|
398
|
}
|
|
399
|
if (con == 98)
|
|
400
|
{
|
|
401
|
timer++;
|
|
402
|
if (timer == 1)
|
|
403
|
{
|
|
404
|
with (obj_bookshelf_moveable2x2)
|
|
405
|
active = false;
|
|
406
|
showtut = false;
|
|
407
|
var plx = (obj_mainchara.x - 320) + 19;
|
|
408
|
var ply = (obj_mainchara.y - 240) + 38;
|
|
409
|
var inst = -4;
|
|
410
|
with (obj_mainchara)
|
|
411
|
inst = instance_place(x, y, obj_camera_clamper);
|
|
412
|
var _xmin = 0;
|
|
413
|
var _xmax = room_width - 640;
|
|
414
|
var _ymin = 0;
|
|
415
|
var _ymax = room_height - 480;
|
|
416
|
with (inst)
|
|
417
|
{
|
|
418
|
if (xmin != -4)
|
|
419
|
_xmin = xmin;
|
|
420
|
if (ymin != -4)
|
|
421
|
_ymin = ymin;
|
|
422
|
if (xmax != -4)
|
|
423
|
_xmax = xmax;
|
|
424
|
if (ymax != -4)
|
|
425
|
_ymax = ymax;
|
|
426
|
}
|
|
427
|
plx = clamp(plx, _xmin, _xmax);
|
|
428
|
ply = clamp(ply, _ymin, _ymax);
|
|
429
|
scr_lerpvarscr_lerpvar
function scr_lerpvar()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar;
}
function scr_lerpvar_respect()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true;
return ___lerpvar;
} ("desiredx", desiredx, clamp(plx, 0, room_width - 640), 15, 2, "out");
|
|
430
|
scr_lerpvarscr_lerpvar
function scr_lerpvar()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar;
}
function scr_lerpvar_respect()
{
if (argument_count < 6)
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else
___lerpvar = scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true;
return ___lerpvar;
} ("desiredy", desiredy, clamp(ply, 0, room_height - 480), 15, 2, "out");
|
|
431
|
if (memvolume != -1)
|
|
432
|
snd_volume(global.currentsong[1], memvolume, 15);
|
|
433
|
if (room == room_dw_church_bookshelfpuzzle1)
|
|
434
|
{
|
|
435
|
global.flag[863] = myshelf[0].x;
|
|
436
|
global.flag[864] = myshelf[0].y;
|
|
437
|
global.flag[865] = myshelf[1].x;
|
|
438
|
global.flag[866] = myshelf[1].y;
|
|
439
|
}
|
|
440
|
}
|
|
441
|
if (timer == 16)
|
|
442
|
{
|
|
443
|
with (obj_dw_church_bookshelfpuzzle)
|
|
444
|
flooractive = 2;
|
|
445
|
with (obj_dw_church_pianopiece_right)
|
|
446
|
flooractive = 2;
|
|
447
|
obj_mainchara.cutscene = 0;
|
|
448
|
global.facing = 0;
|
|
449
|
obj_mainchara.ignoredepth = false;
|
|
450
|
camcont = false;
|
|
451
|
con = 0;
|
|
452
|
engaged = false;
|
|
453
|
buffer = 6;
|
|
454
|
global.facing = 0;
|
|
455
|
global.interact = 0;
|
|
456
|
endtimer = 0;
|
|
457
|
}
|
|
458
|
}
|
|
459
|
}
|