|
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
|
instrument = 524;
|
|
3
|
buffer--;
|
|
4
|
if (con == 0.1)
|
|
5
|
{
|
|
6
|
con = 99;
|
|
7
|
global.interact = 1;
|
|
8
|
kris.cutscene = true;
|
|
9
|
kr = -4;
|
|
10
|
su = -4;
|
|
11
|
ra = -4;
|
|
12
|
global.facing = 2;
|
|
13
|
actor_count = 0;
|
|
14
|
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;
} ();
|
|
15
|
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;
}
}
}
} ();
|
|
16
|
var targ = "a";
|
|
17
|
var walkspeed = 6;
|
|
18
|
var krpos = 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", "a");
|
|
19
|
var krdist = scr_returnwait_instancescr_returnwait_instance
function scr_returnwait_instance(arg0, arg1, arg2)
{
if (!instance_exists(arg0))
{
debug_print("Argument 1 does not exist");
return 1;
}
if (!instance_exists(arg1))
{
debug_print("Argument 2 does not exist");
return 1;
}
var dist = max(1, round(point_distance(arg0.x, arg0.y, arg1.x, arg1.y) / arg2));
return dist;
} (kr_actor, krpos[2], walkspeed);
|
|
20
|
var supos = 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;
} ("susie", "");
|
|
21
|
var sudist = scr_returnwait_instancescr_returnwait_instance
function scr_returnwait_instance(arg0, arg1, arg2)
{
if (!instance_exists(arg0))
{
debug_print("Argument 1 does not exist");
return 1;
}
if (!instance_exists(arg1))
{
debug_print("Argument 2 does not exist");
return 1;
}
var dist = max(1, round(point_distance(arg0.x, arg0.y, arg1.x, arg1.y) / arg2));
return dist;
} (su_actor, supos[2], walkspeed);
|
|
22
|
var rapos = 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;
} ("ralsei", "");
|
|
23
|
var radist = scr_returnwait_instancescr_returnwait_instance
function scr_returnwait_instance(arg0, arg1, arg2)
{
if (!instance_exists(arg0))
{
debug_print("Argument 1 does not exist");
return 1;
}
if (!instance_exists(arg1))
{
debug_print("Argument 2 does not exist");
return 1;
}
var dist = max(1, round(point_distance(arg0.x, arg0.y, arg1.x, arg1.y) / arg2));
return dist;
} (ra_actor, rapos[2], walkspeed);
|
|
24
|
c_selc_sel
function c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
} (kr);
|
|
25
|
if (krdist > 1)
|
|
26
|
{
|
|
27
|
c_walkdirectc_walkdirect
function c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
} (krpos[0], krpos[1], krdist);
|
|
28
|
c_delayfacingc_delayfacing
function c_delayfacing(arg0, arg1)
{
c_cmd_x("delaycmd", arg0, "facing", arg1, 0, 0, 0);
} (krdist + 1, "u");
|
|
29
|
}
|
|
30
|
else
|
|
31
|
{
|
|
32
|
c_setxyc_setxy
function c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
} (krpos[0], krpos[1]);
|
|
33
|
c_facingc_facing
function c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
} ("u");
|
|
34
|
}
|
|
35
|
c_selc_sel
function c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
} (ra);
|
|
36
|
if (radist > 1)
|
|
37
|
{
|
|
38
|
c_walkdirectc_walkdirect
function c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
} (rapos[0], rapos[1], radist);
|
|
39
|
c_delayfacingc_delayfacing
function c_delayfacing(arg0, arg1)
{
c_cmd_x("delaycmd", arg0, "facing", arg1, 0, 0, 0);
} (radist + 1, "u");
|
|
40
|
}
|
|
41
|
else
|
|
42
|
{
|
|
43
|
c_setxyc_setxy
function c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
} (rapos[0], rapos[1]);
|
|
44
|
c_facingc_facing
function c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
} ("u");
|
|
45
|
}
|
|
46
|
c_selc_sel
function c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
} (su);
|
|
47
|
if (sudist > 1)
|
|
48
|
{
|
|
49
|
c_walkdirectc_walkdirect
function c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
} (supos[0], supos[1], sudist);
|
|
50
|
c_delayfacingc_delayfacing
function c_delayfacing(arg0, arg1)
{
c_cmd_x("delaycmd", arg0, "facing", arg1, 0, 0, 0);
} (sudist + 1, "u");
|
|
51
|
}
|
|
52
|
else
|
|
53
|
{
|
|
54
|
c_setxyc_setxy
function c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
} (supos[0], supos[1]);
|
|
55
|
c_facingc_facing
function c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
} ("u");
|
|
56
|
}
|
|
57
|
c_waitc_wait
function c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
} (max(sudist, radist, krdist) + 2);
|
|
58
|
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);
|
|
59
|
c_actortokrisc_actortokris
function c_actortokris()
{
c_cmd("actortokris", 0, 0, 0, 0);
} ();
|
|
60
|
c_actortocaterpillarc_actortocaterpillar
function c_actortocaterpillar()
{
c_cmd("actortocaterpillar", 0, 0, 0, 0);
} ();
|
|
61
|
c_customfuncc_customfunc
function c_customfunc(arg0, arg1 = -1)
{
if (instance_exists(obj_cutscene_master))
{
with (obj_cutscene_master)
array_push(customfuncs, arg0);
c_cmd("customfunc", arg1, 0, 0, 0);
}
}
function c_delay_customfunc(arg0, arg1, arg2 = -1)
{
if (instance_exists(obj_cutscene_master))
c_cmd_x("delaycmd", arg0, "customfunc", arg2, arg1, 0, 0);
} (function()
|
|
62
|
{
|
|
63
|
global.facing = 2;
|
|
64
|
if (catafollow)
|
|
65
|
{
|
|
66
|
with (obj_caterpillarchara)
|
|
67
|
{
|
|
68
|
x = scr_evenscr_even
function scr_even(arg0)
{
return round(arg0 / 2) * 2;
} (x);
|
|
69
|
y = scr_evenscr_even
function scr_even(arg0)
{
return round(arg0 / 2) * 2;
} (y);
|
|
70
|
for (var i = 0; i < 75; i += 1)
|
|
71
|
facing[i] = 2;
|
|
72
|
}
|
|
73
|
}
|
|
74
|
});
|
|
75
|
c_terminatekillactorsc_terminatekillactors
function c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
} ();
|
|
76
|
}
|
|
77
|
if (con == 0.2 && !i_ex(cutscene_master))
|
|
78
|
{
|
|
79
|
global.interact = 0;
|
|
80
|
global.facing = 2;
|
|
81
|
obj_mainchara.freeze = true;
|
|
82
|
global.flag[7 disable_menu?] = 1;
|
|
83
|
con = 1;
|
|
84
|
engaged = true;
|
|
85
|
}
|
|
86
|
if (con == 1)
|
|
87
|
{
|
|
88
|
if (button2_h())
|
|
89
|
canceltimer++;
|
|
90
|
else
|
|
91
|
canceltimer = 0;
|
|
92
|
if (canceltimer > canceltime || forceend)
|
|
93
|
{
|
|
94
|
forceend = 0;
|
|
95
|
var skipcamreset = false;
|
|
96
|
if (camerax() == 0 || camerax() == (room_width - 640))
|
|
97
|
skipcamreset = true;
|
|
98
|
global.flag[7 disable_menu?] = 0;
|
|
99
|
if (skipcamreset == false)
|
|
100
|
{
|
|
101
|
if (memvolume != -1)
|
|
102
|
snd_volume(global.currentsong[1], memvolume, 15);
|
|
103
|
con = 3;
|
|
104
|
var desx = camerax();
|
|
105
|
var desy = cameray();
|
|
106
|
with (obj_mainchara)
|
|
107
|
{
|
|
108
|
var roomw = room_width;
|
|
109
|
var roomh = room_height;
|
|
110
|
var vieww = view_wport[0];
|
|
111
|
var viewh = view_hport[0];
|
|
112
|
desx = clamp((x - floor((vieww / 2) - (initwd / 2))) + nudgex, 0, roomw - vieww);
|
|
113
|
desy = clamp((y - floor((viewh / 2) - (initht / 2))) + nudgey, 0, roomh - viewh);
|
|
114
|
}
|
|
115
|
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;
} ("camxoverride", camerax(), desx, 4);
|
|
116
|
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;
} ("camyoverride", cameray(), desy, 4);
|
|
117
|
scr_delay_var("con", 4, 8);
|
|
118
|
}
|
|
119
|
else
|
|
120
|
{
|
|
121
|
con = 4;
|
|
122
|
if (memvolume != -1)
|
|
123
|
snd_volume(global.currentsong[1], memvolume, 5);
|
|
124
|
}
|
|
125
|
}
|
|
126
|
soundtoplay = -1;
|
|
127
|
if (!left_h() && !down_h() && !right_h() && !up_h())
|
|
128
|
soundtoplay = 0;
|
|
129
|
if (left_h())
|
|
130
|
soundtoplay = 1;
|
|
131
|
if (down_h())
|
|
132
|
soundtoplay = 3;
|
|
133
|
if (right_h())
|
|
134
|
soundtoplay = 5;
|
|
135
|
if (up_h())
|
|
136
|
soundtoplay = 7;
|
|
137
|
var soundplayed = 0;
|
|
138
|
if (button1_p() && soundtoplay != -1)
|
|
139
|
{
|
|
140
|
var mypitch = scr_piano_determinepitchscr_piano_determinepitch
function scr_piano_determinepitch(arg0 = 0, arg1 = 1)
{
var pitcher = 1;
if (arg1 == 1)
{
switch (arg0)
{
case 0:
pitcher = 1;
break;
case 1:
pitcher = 1.12;
break;
case 3:
pitcher = 1.19;
break;
case 5:
pitcher = 0.8928571428571428;
break;
case 7:
pitcher = 0.5;
break;
}
}
if (arg1 == 2)
{
switch (arg0)
{
case 0:
pitcher = 1;
break;
case 1:
pitcher = 1.12;
break;
case 2:
pitcher = 1.155;
break;
case 3:
pitcher = 1.19;
break;
case 4:
pitcher = 1.0414285714285714;
break;
case 5:
pitcher = 0.8928571428571428;
break;
case 6:
pitcher = 0.6964285714285714;
break;
case 7:
pitcher = 0.5;
break;
case 8:
pitcher = 0.3035714286;
break;
}
}
return pitcher;
} (soundtoplay);
|
|
141
|
snd_play_pitch(instrument, mypitch);
|
|
142
|
soundplayed = 1;
|
|
143
|
notesplayed = true;
|
|
144
|
buffer = 0;
|
|
145
|
}
|
|
146
|
var skipupdate = false;
|
|
147
|
if (scr_debugscr_debug
function scr_debug()
{
if (global.debug == 1)
return 1;
} ())
|
|
148
|
{
|
|
149
|
if (keyboard_check_pressed(vk_f5))
|
|
150
|
{
|
|
151
|
debug_print("solved puzzle");
|
|
152
|
skipupdate = true;
|
|
153
|
soundplayed = true;
|
|
154
|
progress = solution;
|
|
155
|
}
|
|
156
|
}
|
|
157
|
if (soundplayed)
|
|
158
|
{
|
|
159
|
if (!solved)
|
|
160
|
{
|
|
161
|
if (!skipupdate)
|
|
162
|
{
|
|
163
|
var newnote = string(soundtoplay + index);
|
|
164
|
progress += newnote;
|
|
165
|
if (string_length(progress) > string_length(solution))
|
|
166
|
progress = string_delete(progress, 1, 1);
|
|
167
|
}
|
|
168
|
if (progress == solution)
|
|
169
|
{
|
|
170
|
debug_print("yes!");
|
|
171
|
solved = 1;
|
|
172
|
progress = "";
|
|
173
|
global.interact = 1;
|
|
174
|
con = 99;
|
|
175
|
kris.freeze = false;
|
|
176
|
kris.fun = 0;
|
|
177
|
kris.cutscene = false;
|
|
178
|
with (obj_caterpillarchara)
|
|
179
|
follow = true;
|
|
180
|
}
|
|
181
|
}
|
|
182
|
}
|
|
183
|
}
|
|
184
|
if (con == 99)
|
|
185
|
{
|
|
186
|
}
|
|
187
|
if (con == 4)
|
|
188
|
{
|
|
189
|
con = 0;
|
|
190
|
timer = 0;
|
|
191
|
buffer = 6;
|
|
192
|
canceltimer = 0;
|
|
193
|
kris.freeze = false;
|
|
194
|
kris.fun = 0;
|
|
195
|
kris.cutscene = false;
|
|
196
|
with (obj_caterpillarchara)
|
|
197
|
follow = true;
|
|
198
|
global.facing = 0;
|
|
199
|
camcon = 0;
|
|
200
|
}
|
|
201
|
if (camcon == 1)
|
|
202
|
{
|
|
203
|
kris.cutscene = true;
|
|
204
|
camxoverride = camerax();
|
|
205
|
camyoverride = cameray();
|
|
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;
} ("camxoverride", camerax(), camx, 15);
|
|
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;
} ("camyoverride", cameray(), camy, 15);
|
|
208
|
camcon = 2;
|
|
209
|
}
|
|
210
|
if (camcon == 2)
|
|
211
|
{
|
|
212
|
kris.cutscene = true;
|
|
213
|
camera_set_view_pos(view_camera[0], round(camxoverride), round(camyoverride));
|
|
214
|
}
|