|
1
|
if ((con == 0 || con == 10) && global.interact == 0)
|
|
2
|
{
|
|
3
|
var trig = 0;
|
|
4
|
with (obj_trigger)
|
|
5
|
{
|
|
6
|
if (extflag == other.extflag)
|
|
7
|
{
|
|
8
|
if (place_meeting(x, y, obj_mainchara))
|
|
9
|
trig = 1;
|
|
10
|
}
|
|
11
|
}
|
|
12
|
if (trig)
|
|
13
|
{
|
|
14
|
con++;
|
|
15
|
timer = 0;
|
|
16
|
}
|
|
17
|
}
|
|
18
|
if (con == 1)
|
|
19
|
{
|
|
20
|
if (global.interact == 0)
|
|
21
|
{
|
|
22
|
timer++;
|
|
23
|
if (timer == 1)
|
|
24
|
{
|
|
25
|
if (!mute)
|
|
26
|
snd_play(snd_wing);
|
|
27
|
scr_lerpvar_respect("image_index", 0, 2, 4);
|
|
28
|
scr_lerpvar_respect("auraalpha", 0, 1, 6, 2, "out");
|
|
29
|
scr_lerpvar_respect("y", y, y - 40, 6, -1, "out");
|
|
30
|
}
|
|
31
|
if (timer > 6)
|
|
32
|
y += (sin(timer / 4) * 4);
|
|
33
|
if (timer > 9)
|
|
34
|
image_index += (0.75 - (0.5 * ((timer - 12) / 12)));
|
|
35
|
if (timer >= 24)
|
|
36
|
{
|
|
37
|
if (!mute)
|
|
38
|
snd_play(snd_board_mantle_dash_fast, 0.6);
|
|
39
|
con = 2;
|
|
40
|
timer = 0;
|
|
41
|
}
|
|
42
|
}
|
|
43
|
}
|
|
44
|
if (con == 2)
|
|
45
|
{
|
|
46
|
timer++;
|
|
47
|
if (global.interact == 0)
|
|
48
|
{
|
|
49
|
if (timer == 1)
|
|
50
|
direction = point_direction(x, y, (obj_mainchara.x + 20) - myxoff, (obj_mainchara.y + 40) - myyoff);
|
|
51
|
spd = lerp(spd, 25, 1 / (15 + (40 * easy)));
|
|
52
|
speed = spd;
|
|
53
|
image_index += 0.5;
|
|
54
|
var wid = 40;
|
|
55
|
var hei = 50;
|
|
56
|
var heioff = 12;
|
|
57
|
var inst = collision_rectangle((x + myxoff) - (wid / 2), ((y + myyoff) - (hei / 2)) + heioff, x + myxoff + (wid / 2), y + myyoff + (hei / 2) + heioff, obj_mainchara, false, 0);
|
|
58
|
if (i_ex(inst) && global.interact == 0)
|
|
59
|
{
|
|
60
|
with (obj_mainchara)
|
|
61
|
other.krismarker = 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, sprite_index, 2, 2, 0, image_index, undefined, undefined, undefined, undefined, 0);
|
|
62
|
with (krismarker)
|
|
63
|
{
|
|
64
|
depth = other.depth + 1;
|
|
65
|
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", 0, 1, 8);
|
|
66
|
}
|
|
67
|
con = 3;
|
|
68
|
with (obj_dw_bluebook_straight)
|
|
69
|
{
|
|
70
|
if (con > 0 && con < 3)
|
|
71
|
{
|
|
72
|
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;
}
} (self, 30);
|
|
73
|
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, 30);
|
|
74
|
}
|
|
75
|
else if (con == 0)
|
|
76
|
{
|
|
77
|
con = 10;
|
|
78
|
}
|
|
79
|
}
|
|
80
|
timer = 0;
|
|
81
|
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;
} ("auraalpha", 1, 0, 4, 2, "in");
|
|
82
|
global.interact = 1;
|
|
83
|
speed = 0;
|
|
84
|
spd = 0;
|
|
85
|
}
|
|
86
|
}
|
|
87
|
else
|
|
88
|
{
|
|
89
|
speed = 0;
|
|
90
|
}
|
|
91
|
}
|
|
92
|
if (con == 3)
|
|
93
|
{
|
|
94
|
timer++;
|
|
95
|
if (timer == 1)
|
|
96
|
{
|
|
97
|
var xtarg = (obj_mainchara.x + 120) - myxoff;
|
|
98
|
var ytarg = (obj_mainchara.y + 38) - myyoff;
|
|
99
|
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, xtarg, 16, 2, "out");
|
|
100
|
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;
} ("y", y, ytarg, 16, 2, "out");
|
|
101
|
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_index", image_index, 0, 3);
|
|
102
|
snd_play(snd_tensionhorn);
|
|
103
|
snd_play_delay(snd_tensionhorn, 10, undefined, 1.1);
|
|
104
|
}
|
|
105
|
if (timer == 4)
|
|
106
|
{
|
|
107
|
sprite_index = spr_bibliox_intro;
|
|
108
|
image_index = 0;
|
|
109
|
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_index", 0, 5, 10);
|
|
110
|
}
|
|
111
|
if (timer == 24)
|
|
112
|
{
|
|
113
|
visible = false;
|
|
114
|
var marker = 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, sprite_index, 2, 2, undefined, image_index, image_blend, 500);
|
|
115
|
global.flag[54 encounter_pointer] = encounterflag;
|
|
116
|
scr_battlescr_battle
function scr_battle(arg0, arg1, arg2, arg3, arg4)
{
global.specialbattle = arg1;
global.encounterno = arg0;
if (global.flag[9 battle_music] != 2)
{
global.flag[9 battle_music] = 1;
if (global.chapter == 4 && room != room_dw_castle_dojo)
global.batmusic[0] = snd_init("ch4_battle.ogg");
else
global.batmusic[0] = snd_init("battle.ogg");
}
instance_create(0, 0, obj_battleback);
instance_create(0, 0, obj_encounterbasic);
__enemymarker[0] = arg2;
__enemymarker[1] = arg3;
__enemymarker[2] = arg4;
for (__ien = 0; __ien < 3; __ien++)
{
if (global.monstertype[__ien] != 0(None))
{
if (!i_ex(__enemymarker[__ien]))
{
__enemymarker[__ien] = scr_dark_marker(global.monstermakex[__ien] + 300, global.monstermakey[__ien], object_get_sprite(global.monsterinstancetype[__ien]));
__enemymarker[__ien].depth = -__ien;
}
__enemymarker[__ien].__ien = __ien;
with (__enemymarker[__ien])
{
scr_move_to_point_over_time(global.monstermakex[__ien], global.monstermakey[__ien], 20);
__doom = instance_create(x, y, obj_doom);
__doom.target = id;
__doom.alarm[0] = 25;
}
}
}
} (encounterno, 0, marker);
|
|
117
|
safe_delete(krismarker);
|
|
118
|
instance_destroy();
|
|
119
|
}
|
|
120
|
}
|
|
121
|
if (con == 11)
|
|
122
|
{
|
|
123
|
if (global.interact == 0)
|
|
124
|
{
|
|
125
|
timer++;
|
|
126
|
if (timer == 1)
|
|
127
|
{
|
|
128
|
if (!mute)
|
|
129
|
snd_play(snd_wing);
|
|
130
|
}
|
|
131
|
if (timer > 6)
|
|
132
|
{
|
|
133
|
y += (sin(timer / 4) * 4);
|
|
134
|
y -= 2;
|
|
135
|
}
|
|
136
|
if (timer > 9)
|
|
137
|
image_index += (0.75 - (0.5 * ((timer - 12) / 12)));
|
|
138
|
if (timer >= 24)
|
|
139
|
{
|
|
140
|
con = 12;
|
|
141
|
timer = 0;
|
|
142
|
}
|
|
143
|
}
|
|
144
|
}
|
|
145
|
if (con == 12)
|
|
146
|
{
|
|
147
|
sprite_index = spr_bibliox_openbook;
|
|
148
|
if (bakeme)
|
|
149
|
sprite_index = spr_bibliox_openbook_bake;
|
|
150
|
image_index = min(1, floor(timer / 4));
|
|
151
|
var last_timer = timer;
|
|
152
|
if (global.interact == 0 && !(button3_p() && obj_mainchara.threebuffer < 0 && global.flag[7 disable_menu?] == 0 && obj_mainchara.battlemode == 0 && obj_mainchara.swordmode == 0))
|
|
153
|
timer++;
|
|
154
|
if (timer == 1 && timer > last_timer)
|
|
155
|
{
|
|
156
|
image_xscale = 2;
|
|
157
|
y = starty - 18;
|
|
158
|
if (obj_mainchara.x > x)
|
|
159
|
{
|
|
160
|
image_xscale = -2;
|
|
161
|
x += 100;
|
|
162
|
}
|
|
163
|
}
|
|
164
|
if (timer == 12)
|
|
165
|
snd_play(snd_board_torch);
|
|
166
|
if (timer > 8 && (timer % 4) == 0)
|
|
167
|
{
|
|
168
|
var bullet = instance_create(x + (20 * image_xscale), y + 60, obj_overworld_lanternflame);
|
|
169
|
bullet.depth = depth - 5;
|
|
170
|
bullet.image_speed = 0.25;
|
|
171
|
var xx = (obj_mainchara.x + random_range(-60, 60)) - x;
|
|
172
|
var yy = (obj_mainchara.y + random_range(-60, 60)) - y;
|
|
173
|
bullet.direction = point_direction(0, 0, xx, yy);
|
|
174
|
bullet.speed = random_range(5, 6);
|
|
175
|
}
|
|
176
|
if (timer == 24)
|
|
177
|
{
|
|
178
|
con = 13;
|
|
179
|
timer = 0;
|
|
180
|
y -= 30;
|
|
181
|
sprite_index = spr_bibliox_flyingbook;
|
|
182
|
if (bakeme)
|
|
183
|
sprite_index = spr_bibliox_flyingbook_baked;
|
|
184
|
if (image_xscale == -2)
|
|
185
|
x -= 100;
|
|
186
|
image_xscale = 2;
|
|
187
|
image_yscale = 2;
|
|
188
|
}
|
|
189
|
}
|
|
190
|
if (con == 13)
|
|
191
|
{
|
|
192
|
if (global.interact == 0)
|
|
193
|
{
|
|
194
|
timer++;
|
|
195
|
if (timer > 6)
|
|
196
|
y += (sin(timer / 4) * 4);
|
|
197
|
if (timer > 9)
|
|
198
|
image_index += 0.5;
|
|
199
|
if (timer == 80)
|
|
200
|
{
|
|
201
|
var trig = 0;
|
|
202
|
with (obj_trigger)
|
|
203
|
{
|
|
204
|
if (extflag == other.extflag)
|
|
205
|
{
|
|
206
|
if (place_meeting(x, y, obj_mainchara))
|
|
207
|
trig = 1;
|
|
208
|
}
|
|
209
|
}
|
|
210
|
if (trig)
|
|
211
|
{
|
|
212
|
con = 12;
|
|
213
|
timer = 0;
|
|
214
|
}
|
|
215
|
}
|
|
216
|
else if (timer > 80)
|
|
217
|
{
|
|
218
|
sprite_index = spr_bibliox_plantbook;
|
|
219
|
if (bakeme)
|
|
220
|
sprite_index = spr_bibliox_plantbook_bake;
|
|
221
|
image_index = 3 - clamp((y - starty) / 40, 0, 3);
|
|
222
|
y = (y + timer) - 80;
|
|
223
|
if (y >= starty)
|
|
224
|
{
|
|
225
|
y = starty;
|
|
226
|
con = 10;
|
|
227
|
timer = 0;
|
|
228
|
sprite_index = spr_bibliox_flyingbook;
|
|
229
|
if (bakeme)
|
|
230
|
sprite_index = spr_bibliox_flyingbook_baked;
|
|
231
|
image_index = 0;
|
|
232
|
}
|
|
233
|
}
|
|
234
|
}
|
|
235
|
}
|