|
1
|
if (!init)
|
|
2
|
{
|
|
3
|
var flagset;
|
|
4
|
if (flagno != -1)
|
|
5
|
{
|
|
6
|
flagset = global.flag[flagno] == 1;
|
|
7
|
if (flagbit > 0)
|
|
8
|
flagset = global.flag[flagno] & (1 << (flagbit - 1));
|
|
9
|
debug_print(string(flagset));
|
|
10
|
if (extflag == "treasure" && flagset)
|
|
11
|
{
|
|
12
|
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;
} (undefined, "treasureloc");
|
|
13
|
with (instance_create(pos[0], pos[1], obj_treasure_room))
|
|
14
|
{
|
|
15
|
itemtype = "item";
|
|
16
|
itemidchest = 2;
|
|
17
|
itemflag = 1540;
|
|
18
|
}
|
|
19
|
}
|
|
20
|
}
|
|
21
|
if (flagno != -1 && flagset)
|
|
22
|
{
|
|
23
|
var thisID = floor((x / 80) + (y / 80));
|
|
24
|
with (instance_create(x, y + 80, obj_marker))
|
|
25
|
{
|
|
26
|
sprite_index = spr_bookshelf_debris;
|
|
27
|
image_index = thisID % 5;
|
|
28
|
image_speed = 0;
|
|
29
|
depth = 999999;
|
|
30
|
}
|
|
31
|
if (special == 2)
|
|
32
|
{
|
|
33
|
with (obj_floorTrigger)
|
|
34
|
instance_destroy();
|
|
35
|
with (obj_solid_temp)
|
|
36
|
{
|
|
37
|
if (extflag == "FLOOR1TEMP")
|
|
38
|
active = 1;
|
|
39
|
else
|
|
40
|
active = 0;
|
|
41
|
}
|
|
42
|
with (obj_bookshelf_destructable)
|
|
43
|
{
|
|
44
|
if (special == 1)
|
|
45
|
{
|
|
46
|
special = 0;
|
|
47
|
with (mysolid)
|
|
48
|
instance_destroy();
|
|
49
|
mysolid = instance_create(x, y + 80, obj_solidblocksized);
|
|
50
|
mysolid.extflag = "breakable";
|
|
51
|
scr_sizescr_size
function scr_size(arg0 = image_xscale, arg1 = image_yscale, arg2 = id)
{
with (arg2)
{
image_xscale = arg0;
image_yscale = arg1;
}
} (2, 2, mysolid);
|
|
52
|
}
|
|
53
|
}
|
|
54
|
with (obj_dw_churchb_library)
|
|
55
|
{
|
|
56
|
flooractive = 3;
|
|
57
|
npc2.y = npc2.y + 1000;
|
|
58
|
}
|
|
59
|
}
|
|
60
|
with (mysolid)
|
|
61
|
instance_destroy();
|
|
62
|
instance_destroy();
|
|
63
|
exit;
|
|
64
|
}
|
|
65
|
init = 1;
|
|
66
|
}
|
|
67
|
if (con == 0)
|
|
68
|
{
|
|
69
|
var tx = x + 20;
|
|
70
|
var ty = y + 80 + 20;
|
|
71
|
var wid = 40;
|
|
72
|
var hei = 40;
|
|
73
|
if (i_ex(collision_rectangle(tx, ty, tx + wid, ty + hei, obj_dw_church_remotepianomove, 0, 0)))
|
|
74
|
{
|
|
75
|
if (obj_dw_church_remotepianomove.con != 4)
|
|
76
|
{
|
|
77
|
snd_play(snd_impact);
|
|
78
|
with (obj_dw_church_remotepianomove)
|
|
79
|
{
|
|
80
|
myhspeed *= 0.7;
|
|
81
|
myvspeed *= 0.7;
|
|
82
|
}
|
|
83
|
con = 1;
|
|
84
|
}
|
|
85
|
}
|
|
86
|
}
|
|
87
|
if (con == 1)
|
|
88
|
{
|
|
89
|
with (scr_marker_extscr_marker_ext
function scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{
var thismarker = instance_create(arg0, arg1, obj_marker);
with (thismarker)
{
depth = arg8;
sprite_index = arg2;
image_speed = arg5;
image_xscale = arg3;
image_yscale = arg4;
image_index = arg6;
image_blend = arg7;
image_alpha = arg11;
if (arg9)
scr_depth_alt();
}
if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker;
}
function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false)
{
if (is_undefined(arg0))
{
debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist");
return -4;
}
var sprite = layer_sprite_get_sprite(arg0);
var index = layer_sprite_get_index(arg0);
var imagespeed = layer_sprite_get_speed(arg0);
var xscale = layer_sprite_get_xscale(arg0);
var yscale = layer_sprite_get_yscale(arg0);
var angle = layer_sprite_get_angle(arg0);
var blend = layer_sprite_get_blend(arg0);
var alpha = layer_sprite_get_alpha(arg0);
var xloc = layer_sprite_get_x(arg0);
var yloc = layer_sprite_get_y(arg0);
var thismarker = instance_create_depth(xloc, yloc, arg1, obj_marker);
with (thismarker)
{
sprite_index = sprite;
image_index = index;
image_speed = imagespeed;
image_xscale = xscale;
image_yscale = yscale;
image_angle = angle;
image_blend = blend;
image_alpha = alpha;
if (arg2)
scr_depth_alt(id, arg2);
}
return thismarker;
}
function scr_assetgetinfo(arg0)
{
var sprite = layer_sprite_get_sprite(arg0);
var index = layer_sprite_get_index(arg0);
var xloc = layer_sprite_get_x(arg0);
var yloc = layer_sprite_get_y(arg0);
var xscale = layer_sprite_get_xscale(arg0);
var yscale = layer_sprite_get_yscale(arg0);
var angle = layer_sprite_get_angle(arg0);
var blend = layer_sprite_get_blend(arg0);
var alpha = layer_sprite_get_alpha(arg0);
var imagespeed = layer_sprite_get_speed(arg0);
return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed];
} (x - 10, y + 40, spr_explosion_round, 2, 2, 0, undefined, undefined, depth))
|
|
90
|
{
|
|
91
|
image_speed = 0.6;
|
|
92
|
depth = 49600;
|
|
93
|
scr_doomscr_doom
function scr_doom(arg0 = id, arg1)
{
with (instance_create_depth(0, 0, 0, obj_doom))
{
alarm[0]
target = arg0;
persistent = arg0.persistent;
}
} (id, 15);
|
|
94
|
}
|
|
95
|
if (special == 3)
|
|
96
|
{
|
|
97
|
var debris_x = [-6, -3, 4, 11, 20, 43, 31, 42, 48, 58, 69];
|
|
98
|
var debris_y = [52, 40, 34, 36, 8, 25, 71, 48, 59, 60, 36];
|
|
99
|
var debris_hspeeds = [-2, -1.5, -1.2, -1.1, -0.5, 1.2, 0.2, 0.6, 1.35, 1.45, 2];
|
|
100
|
var debris_vspeeds = [-2, -2.5, -2.8, -2.9, -3.5, -2.7, -1.5, -2.2, -2, -1.9, -2.1];
|
|
101
|
for (var i = 0; i < 11; i++)
|
|
102
|
{
|
|
103
|
with (instance_create(x + 20 + (debris_x[i] * 0.5), y + (debris_y[i] * 2), obj_marker))
|
|
104
|
{
|
|
105
|
sprite_index = spr_musicgate_debris;
|
|
106
|
image_index = i;
|
|
107
|
image_speed = 0;
|
|
108
|
image_xscale = 2;
|
|
109
|
image_yscale = 2;
|
|
110
|
depth = 100;
|
|
111
|
hspeed = debris_hspeeds[i] * 3;
|
|
112
|
vspeed = debris_vspeeds[i] * 3;
|
|
113
|
gravity = 1;
|
|
114
|
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;
} ("image_alpha", 1, 0, 60, 1, "out");
|
|
115
|
scr_doomscr_doom
function scr_doom(arg0 = id, arg1)
{
with (instance_create_depth(0, 0, 0, obj_doom))
{
alarm[0]
target = arg0;
persistent = arg0.persistent;
}
} (id, 60);
|
|
116
|
}
|
|
117
|
}
|
|
118
|
}
|
|
119
|
else
|
|
120
|
{
|
|
121
|
var thisID = floor((x / 80) + (y / 80));
|
|
122
|
var scatter = 791;
|
|
123
|
if ((thisID % 2) == 1)
|
|
124
|
scatter = 4201;
|
|
125
|
with (scr_marker_extscr_marker_ext
function scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{
var thismarker = instance_create(arg0, arg1, obj_marker);
with (thismarker)
{
depth = arg8;
sprite_index = arg2;
image_speed = arg5;
image_xscale = arg3;
image_yscale = arg4;
image_index = arg6;
image_blend = arg7;
image_alpha = arg11;
if (arg9)
scr_depth_alt();
}
if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker;
}
function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false)
{
if (is_undefined(arg0))
{
debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist");
return -4;
}
var sprite = layer_sprite_get_sprite(arg0);
var index = layer_sprite_get_index(arg0);
var imagespeed = layer_sprite_get_speed(arg0);
var xscale = layer_sprite_get_xscale(arg0);
var yscale = layer_sprite_get_yscale(arg0);
var angle = layer_sprite_get_angle(arg0);
var blend = layer_sprite_get_blend(arg0);
var alpha = layer_sprite_get_alpha(arg0);
var xloc = layer_sprite_get_x(arg0);
var yloc = layer_sprite_get_y(arg0);
var thismarker = instance_create_depth(xloc, yloc, arg1, obj_marker);
with (thismarker)
{
sprite_index = sprite;
image_index = index;
image_speed = imagespeed;
image_xscale = xscale;
image_yscale = yscale;
image_angle = angle;
image_blend = blend;
image_alpha = alpha;
if (arg2)
scr_depth_alt(id, arg2);
}
return thismarker;
}
function scr_assetgetinfo(arg0)
{
var sprite = layer_sprite_get_sprite(arg0);
var index = layer_sprite_get_index(arg0);
var xloc = layer_sprite_get_x(arg0);
var yloc = layer_sprite_get_y(arg0);
var xscale = layer_sprite_get_xscale(arg0);
var yscale = layer_sprite_get_yscale(arg0);
var angle = layer_sprite_get_angle(arg0);
var blend = layer_sprite_get_blend(arg0);
var alpha = layer_sprite_get_alpha(arg0);
var imagespeed = layer_sprite_get_speed(arg0);
return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed];
} (x, y + 80, scatter))
|
|
126
|
{
|
|
127
|
image_speed = 0.3;
|
|
128
|
depth = 49600;
|
|
129
|
scr_doomscr_doom
function scr_doom(arg0 = id, arg1)
{
with (instance_create_depth(0, 0, 0, obj_doom))
{
alarm[0]
target = arg0;
persistent = arg0.persistent;
}
} (id, 20);
|
|
130
|
}
|
|
131
|
with (instance_create(x, y + 80, obj_marker))
|
|
132
|
{
|
|
133
|
sprite_index = spr_bookshelf_debris;
|
|
134
|
image_index = thisID % 5;
|
|
135
|
image_speed = 0;
|
|
136
|
depth = 999999;
|
|
137
|
}
|
|
138
|
if (extflag == "treasure")
|
|
139
|
{
|
|
140
|
with (instance_create(x + 20, y + 60, obj_treasure_room))
|
|
141
|
{
|
|
142
|
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;
} (undefined, "treasureloc");
|
|
143
|
var jumptime = 20;
|
|
144
|
scr_jump_to_pointscr_jump_to_point
function scr_jump_to_point(arg0, arg1, arg2, arg3, arg4 = 0)
{
var ___jump = scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0);
with (___jump)
{
trackalpha = arg4;
trackblend = arg4;
trackindex = arg4;
tracksprite = arg4;
trackangle = arg4;
}
return ___jump;
} (pos[0], pos[1], 24, jumptime);
|
|
145
|
snd_play(snd_won);
|
|
146
|
snd_play_delay(snd_noise, jumptime, 1, 1);
|
|
147
|
}
|
|
148
|
}
|
|
149
|
if (special == 2)
|
|
150
|
{
|
|
151
|
with (obj_floorTrigger)
|
|
152
|
instance_destroy();
|
|
153
|
with (obj_solid_temp)
|
|
154
|
{
|
|
155
|
if (extflag == "FLOOR1TEMP")
|
|
156
|
active = 1;
|
|
157
|
else
|
|
158
|
active = 0;
|
|
159
|
}
|
|
160
|
with (obj_bookshelf_destructable)
|
|
161
|
{
|
|
162
|
if (special == 1)
|
|
163
|
{
|
|
164
|
special = 0;
|
|
165
|
with (mysolid)
|
|
166
|
instance_destroy();
|
|
167
|
mysolid = instance_create(x, y + 80, obj_solidblocksized);
|
|
168
|
mysolid.extflag = "breakable";
|
|
169
|
scr_sizescr_size
function scr_size(arg0 = image_xscale, arg1 = image_yscale, arg2 = id)
{
with (arg2)
{
image_xscale = arg0;
image_yscale = arg1;
}
} (2, 2, mysolid);
|
|
170
|
}
|
|
171
|
}
|
|
172
|
with (obj_dw_churchb_library)
|
|
173
|
{
|
|
174
|
flooractive = 3;
|
|
175
|
npc2.y = npc2.y + 1000;
|
|
176
|
}
|
|
177
|
}
|
|
178
|
x += 20;
|
|
179
|
y += 20;
|
|
180
|
scr_afterimage_cutscr_afterimage_cut
function scr_afterimage_cut()
{
afterimage = instance_create(x, y, obj_afterimage_cut);
afterimage.sprite_index = sprite_index;
afterimage.image_index = image_index;
afterimage.image_blend = image_blend;
afterimage.image_speed = 0;
afterimage.depth = depth;
afterimage.image_xscale = image_xscale;
afterimage.image_yscale = image_yscale;
afterimage.image_angle = image_angle;
with (afterimage)
event_user(0);
return afterimage;
} ();
|
|
181
|
}
|
|
182
|
if (flagno != -1)
|
|
183
|
{
|
|
184
|
if (flagbit > 0)
|
|
185
|
global.flag[flagno] = global.flag[flagno] | (1 << (flagbit - 1));
|
|
186
|
else
|
|
187
|
global.flag[flagno] = 1;
|
|
188
|
}
|
|
189
|
with (mysolid)
|
|
190
|
instance_destroy();
|
|
191
|
instance_destroy();
|
|
192
|
}
|