|
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
|
if (!init)
|
|
3
|
{
|
|
4
|
if (instance_exists(obj_dw_churchc_encounter2))
|
|
5
|
{
|
|
6
|
con = -1;
|
|
7
|
delaytime = 1;
|
|
8
|
maxspd = 6;
|
|
9
|
darkroom = true;
|
|
10
|
accl = 0.16666666666666666;
|
|
11
|
touchsize = 30;
|
|
12
|
if (global.flag[encounterflag] != 0)
|
|
13
|
{
|
|
14
|
touchsize = 24;
|
|
15
|
accl = 1/15;
|
|
16
|
maxspeed = 2;
|
|
17
|
if (scr_trigcheck_ext("chaseb", id))
|
|
18
|
instance_destroy();
|
|
19
|
}
|
|
20
|
}
|
|
21
|
init = 1;
|
|
22
|
}
|
|
23
|
scr_depthscr_depth
function scr_depth(arg0 = id, arg1 = 0)
{
with (arg0)
depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10));
} ();
|
|
24
|
if (darkroom && global.interact == 0)
|
|
25
|
{
|
|
26
|
if (con == -1)
|
|
27
|
{
|
|
28
|
if (!scr_checklocationscr_checklocation
function scr_checklocation(arg0 = id, arg1, arg2, arg3 = 0)
{
if (!i_ex(arg0))
{
debug_message("target instance does not exist");
return false;
}
if (abs(arg0.x - arg1) <= arg3 && abs(arg0.y - arg2) <= arg3)
return true;
else
return false;
} (id, xstart, ystart, 8))
|
|
29
|
{
|
|
30
|
retimer--;
|
|
31
|
if (retimer <= 0)
|
|
32
|
{
|
|
33
|
dir = point_direction(x, y, xstart, ystart);
|
|
34
|
x += lengthdir_x(4, dir);
|
|
35
|
y += lengthdir_y(4, dir);
|
|
36
|
animindex += 0.125;
|
|
37
|
facing = 0;
|
|
38
|
if (dir < 90 || dir > 270)
|
|
39
|
facing = 1;
|
|
40
|
}
|
|
41
|
}
|
|
42
|
if (scr_trigcheckscr_trigcheck
function scr_trigcheck(arg0)
{
var ____trig = 0;
if (is_string(arg0))
{
with (obj_trigger)
{
if (extflag == arg0)
{
if (place_meeting(x, y, obj_mainchara))
____trig++;
}
}
}
return ____trig;
}
function scr_trigcheck_ext(arg0, arg1 = id)
{
var ____trig = 0;
if (is_string(arg0))
{
with (obj_trigger)
{
if (extflag == arg0)
{
if (place_meeting(x, y, arg1))
____trig++;
}
}
}
return ____trig;
} (extflag) && !scr_trigcheckscr_trigcheck
function scr_trigcheck(arg0)
{
var ____trig = 0;
if (is_string(arg0))
{
with (obj_trigger)
{
if (extflag == arg0)
{
if (place_meeting(x, y, obj_mainchara))
____trig++;
}
}
}
return ____trig;
}
function scr_trigcheck_ext(arg0, arg1 = id)
{
var ____trig = 0;
if (is_string(arg0))
{
with (obj_trigger)
{
if (extflag == arg0)
{
if (place_meeting(x, y, arg1))
____trig++;
}
}
}
return ____trig;
} ("notouching"))
|
|
43
|
{
|
|
44
|
var doomtime = 20;
|
|
45
|
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 + 20 + 14, (y - 20) + 8, spr_exc, 2, 2, undefined, undefined, undefined, depth - 1, undefined, doomtime))
|
|
46
|
{
|
|
47
|
vspeed = -3;
|
|
48
|
gravity = 0.7;
|
|
49
|
scr_limitval_upper(id, "y", y);
|
|
50
|
snd_play(snd_b);
|
|
51
|
}
|
|
52
|
timer = 0;
|
|
53
|
con = 1;
|
|
54
|
}
|
|
55
|
}
|
|
56
|
if (con == 0 || con == 1)
|
|
57
|
{
|
|
58
|
if (scr_trigcheckscr_trigcheck
function scr_trigcheck(arg0)
{
var ____trig = 0;
if (is_string(arg0))
{
with (obj_trigger)
{
if (extflag == arg0)
{
if (place_meeting(x, y, obj_mainchara))
____trig++;
}
}
}
return ____trig;
}
function scr_trigcheck_ext(arg0, arg1 = id)
{
var ____trig = 0;
if (is_string(arg0))
{
with (obj_trigger)
{
if (extflag == arg0)
{
if (place_meeting(x, y, arg1))
____trig++;
}
}
}
return ____trig;
} ("notouching"))
|
|
59
|
{
|
|
60
|
spd = 0;
|
|
61
|
animspeed = 0;
|
|
62
|
animindex = 0;
|
|
63
|
con = -1;
|
|
64
|
retimer = choose(30, 30, 40, 60, 120, 30);
|
|
65
|
with (obj_lerpvar)
|
|
66
|
{
|
|
67
|
if (target == other.id)
|
|
68
|
instance_destroy();
|
|
69
|
}
|
|
70
|
}
|
|
71
|
}
|
|
72
|
}
|
|
73
|
if (con == 0)
|
|
74
|
{
|
|
75
|
timer++;
|
|
76
|
if (timer == 1)
|
|
77
|
{
|
|
78
|
var doomtime = 20;
|
|
79
|
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 + 20 + 14, (y - 20) + 8, spr_exc, 2, 2, undefined, undefined, undefined, depth - 1, undefined, doomtime))
|
|
80
|
{
|
|
81
|
vspeed = -3;
|
|
82
|
gravity = 0.7;
|
|
83
|
scr_limitval_upper(id, "y", y);
|
|
84
|
}
|
|
85
|
if (!darkroom)
|
|
86
|
{
|
|
87
|
drawaura = true;
|
|
88
|
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;
} ("auraalph", 0, 1, delaytime);
|
|
89
|
}
|
|
90
|
snd_play(snd_b);
|
|
91
|
}
|
|
92
|
if (timer == delaytime)
|
|
93
|
{
|
|
94
|
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;
} ("animspeed", 0, 0.5, 15, 2, "in");
|
|
95
|
timer = 0;
|
|
96
|
con = 1;
|
|
97
|
}
|
|
98
|
}
|
|
99
|
if (con == 1)
|
|
100
|
{
|
|
101
|
if (global.interact == 0)
|
|
102
|
{
|
|
103
|
dir = direction_to_object_bbox(undefined, 1049);
|
|
104
|
facing = 0;
|
|
105
|
if (dir < 90 || dir > 270)
|
|
106
|
facing = 1;
|
|
107
|
spd = lerp(spd, maxspd, accl);
|
|
108
|
x += lengthdir_x(spd, dir);
|
|
109
|
y += lengthdir_y(spd, dir);
|
|
110
|
if (i_ex(collision_circle(x + 40, y + 70 + 20, touchsize, obj_mainchara, true, true)))
|
|
111
|
{
|
|
112
|
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 - 18, y - 14, spr_dw_churchb_organikenemy_marker, 2, 2, undefined, undefined, undefined, 5000);
|
|
113
|
global.interact = 1;
|
|
114
|
con = 2;
|
|
115
|
timer = 0;
|
|
116
|
drawaura = false;
|
|
117
|
}
|
|
118
|
}
|
|
119
|
}
|
|
120
|
if (con == 2)
|
|
121
|
{
|
|
122
|
timer++;
|
|
123
|
if (timer == 1)
|
|
124
|
{
|
|
125
|
with (marker)
|
|
126
|
{
|
|
127
|
if (instance_exists(obj_dw_churchc_encounter2))
|
|
128
|
{
|
|
129
|
debug_print("black");
|
|
130
|
image_blend = c_black;
|
|
131
|
scr_lerp_imageblendscr_lerp_imageblend
function scr_lerp_imageblend()
{
var lerpblend = instance_create(x, y, obj_lerpimageblend);
lerpblend.target = argument0;
lerpblend.color1 = argument1;
lerpblend.color2 = argument2;
var ___time = argument3;
if (argument_count > 4)
{
var _style = argument4;
var _ease = argument5;
lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time, _style, _ease);
}
else
{
lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time);
}
with (lerpblend)
alarm_set(0, ___time + 1);
return lerpblend;
} (id, c_black, c_white, 8);
|
|
132
|
}
|
|
133
|
}
|
|
134
|
snd_play(snd_tensionhorn);
|
|
135
|
snd_play_delay(snd_tensionhorn, 10, undefined, 1.1);
|
|
136
|
animspeed = 0;
|
|
137
|
}
|
|
138
|
if (timer == 25)
|
|
139
|
{
|
|
140
|
var slot = 0;
|
|
141
|
if (instance_exists(obj_dw_churchb_moneyfountain))
|
|
142
|
slot = 1;
|
|
143
|
global.flag[54 encounter_pointer] = encounterflag;
|
|
144
|
if (slot == 0)
|
|
145
|
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, false, marker);
|
|
146
|
if (slot == 1)
|
|
147
|
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, false, undefined, marker);
|
|
148
|
if (clearall)
|
|
149
|
{
|
|
150
|
with (object_index)
|
|
151
|
instance_destroy();
|
|
152
|
}
|
|
153
|
else
|
|
154
|
{
|
|
155
|
instance_destroy();
|
|
156
|
}
|
|
157
|
}
|
|
158
|
}
|