1 |
script_execute(scr_depth, 0, 0, 0, 0, 0); |
2 |
if (global.route != 3) |
3 |
{ |
4 |
if ((keyboard_multicheck_pressed(0) && 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;
}
} () == true) && waiter == 0 && !instance_exists(obj_dialogue)) |
5 |
waiter = 1; |
6 |
if (waiter == 1) |
7 |
{ |
8 |
global.cutscene = true; |
9 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
10 |
with (msg) |
11 |
{ |
12 |
if (!instance_exists(obj_dialoguebox_dummy)) |
13 |
instance_create(0, 0, obj_dialoguebox_dummy); |
14 |
portrait = false; |
15 |
sndfnt = 99; |
16 |
message[0] = "* (A fine oak chest.)"; |
17 |
message[1] = "* (Open it?)"; |
18 |
if (outcome == 1 && message_current == 1) |
19 |
obj_dalvsroom_chest.waiter = 2; |
20 |
else if (outcome == 2 && message_current == 1) |
21 |
obj_dalvsroom_chest.waiter = 4; |
22 |
if ((message_current + 1) == 1) |
23 |
{ |
24 |
ch_msg = 1; |
25 |
ch[1] = "Yes"; |
26 |
ch[2] = "No"; |
27 |
} |
28 |
} |
29 |
} |
30 |
if (waiter == 2 && !instance_exists(obj_dialogue)) |
31 |
waiter++; |
32 |
if (waiter == 3) |
33 |
{ |
34 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
35 |
with (msg) |
36 |
{ |
37 |
portrait = false; |
38 |
sndfnt = 99; |
39 |
if (global.interaction_count_dalvsroom_chest == 0) |
40 |
{ |
41 |
message[0] = "* (Wow! It's lined with high# quality satin!)"; |
42 |
global.interaction_count_dalvsroom_chest++; |
43 |
} |
44 |
else |
45 |
{ |
46 |
message[0] = "* (You check again.)"; |
47 |
message[1] = "* (It's still a cool chest.)"; |
48 |
} |
49 |
with (obj_dalvsroom_chest) |
50 |
waiter++; |
51 |
} |
52 |
} |
53 |
if (waiter == 4 && !instance_exists(obj_dialogue)) |
54 |
{ |
55 |
with (obj_dialoguebox_dummy) |
56 |
instance_destroy(); |
57 |
waiter = 0; |
58 |
global.cutscene = false; |
59 |
obj_pl.alarm[0] = 1; |
60 |
} |
61 |
} |
62 |
else |
63 |
{ |
64 |
if ((keyboard_multicheck_pressed(0) && 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;
}
} () == true) && (waiter == 0 && !instance_exists(obj_dialogue))) |
65 |
waiter = 1; |
66 |
if (waiter == 1) |
67 |
{ |
68 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
69 |
with (msg) |
70 |
{ |
71 |
portrait = false; |
72 |
sndfnt = 99; |
73 |
message[0] = "* (A fine oak chest.)"; |
74 |
} |
75 |
waiter++; |
76 |
} |
77 |
if (waiter == 2 && !instance_exists(obj_dialogue)) |
78 |
waiter++; |
79 |
if (waiter == 3) |
80 |
{ |
81 |
waiter = 0; |
82 |
obj_pl.alarm[0] = 1; |
83 |
} |
84 |
} |