1 |
if (scr_interactscr_interactfunction scr_interact()
{
if (distance_to_object(obj_pl) < 20 && obj_pl.state == scr_normal_state)
{
var pl_dir = obj_pl.direction;
var pl_x = 0;
var pl_y = 0;
var check_distance_x = 0;
var check_distance_y = 0;
switch (pl_dir)
{
case 0:
pl_x = obj_pl.bbox_right;
pl_y = obj_pl.bbox_top + 1;
check_distance_x = 20;
break;
case 180:
pl_x = obj_pl.bbox_left;
pl_y = obj_pl.bbox_top + 1;
check_distance_x = -20;
break;
case 90:
pl_x = obj_pl.x;
pl_y = obj_pl.bbox_top;
check_distance_y = -20;
break;
case 270:
pl_x = obj_pl.x;
pl_y = obj_pl.bbox_bottom;
check_distance_y = 20;
break;
}
if (collision_line_first(pl_x, pl_y, pl_x + check_distance_x, pl_y + check_distance_y, id, false, false))
return true;
}
} () && keyboard_multicheck_pressed(0)) |
2 |
{ |
3 |
if (global.sworks_flag[3] < 2 && global.route == 2) |
4 |
{ |
5 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
6 |
with (msg) |
7 |
message[0] = "* (The vent has a few loose# screws.)"; |
8 |
} |
9 |
else |
10 |
{ |
11 |
global.cutscene = true; |
12 |
scene = 1; |
13 |
scr_cutscene_start(); |
14 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
15 |
with (msg) |
16 |
{ |
17 |
message[0] = "* (The vent has a few loose# screws.)"; |
18 |
message[1] = "* (You finagle it open.)"; |
19 |
} |
20 |
} |
21 |
} |
22 |
if (scene == 1) |
23 |
{ |
24 |
if (global.dialogue_open) |
25 |
exit; |
26 |
if (image_speed == 0) |
27 |
{ |
28 |
audio_play_sound(snd_steamworks_13_vent, 20, 0); |
29 |
image_speed = 1/3; |
30 |
} |
31 |
if (image_index >= (image_number - 1)) |
32 |
{ |
33 |
image_speed = 0; |
34 |
image_index = image_number - 1; |
35 |
scene = 2; |
36 |
scr_audio_fade_outscr_audio_fade_outfunction scr_audio_fade_out(arg0, arg1)
{
var snd = arg0;
var fade_len = arg1;
if (!audio_is_playing(snd))
return false;
audio_sound_gain(snd, 0, fade_len);
if (instance_exists(obj_audio_fade_helper))
{
with (obj_audio_fade_helper)
{
if (audio_to_fade == snd)
return false;
}
}
with (instance_create(0, 0, obj_audio_fade_helper))
audio_to_fade = snd;
} (obj_radio.current_song, 500); |
37 |
} |
38 |
} |
39 |
if (scene == 2) |
40 |
cutscene_wait(0.5); |
41 |
if (scene == 3) |
42 |
scr_change_roomscr_change_roomfunction scr_change_room(arg0, arg1, arg2)
{
if (!instance_exists(obj_transition))
{
trn = instance_create(x, y, obj_transition);
trn.newRoom = arg0;
if (instance_exists(obj_pl))
{
trn.xx = arg1;
trn.yy = arg2;
}
}
} (162, 220, 120); |