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 (npc_flag == 0) |
4 |
{ |
5 |
npc_flag = 1; |
6 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
7 |
with (msg) |
8 |
{ |
9 |
message[0] = "* (The topmost paper is a# handwritten letter.)\t"; |
10 |
message[1] = "* To: King ASGORE.\t"; |
11 |
message[2] = "* This project, while exciting,# will be quite the undertaking.\t"; |
12 |
message[3] = "* We will need Mining Co. to# work overtime to provide the# necessary materials.\t"; |
13 |
message[4] = "* Furthermore, a meeting was# conducted at the Factory.\t"; |
14 |
message[5] = "* I'm happy to report that# everyone is on board!\t"; |
15 |
message[6] = "* There already are many great# robot ideas floating about.\t"; |
16 |
message[7] = "* Cooking, cleaning, recreation;# the motivation is through the# roof!\t"; |
17 |
message[8] = "* Though... one engineer# suggested we take this further# with a \"protection bot.\"\t"; |
18 |
message[9] = "* I am quite unsure about that# proposition but you have the# final say.\t"; |
19 |
message[10] = "* In any case, we will see this# completed.\t"; |
20 |
message[11] = "* - Prof. Z."; |
21 |
} |
22 |
} |
23 |
else |
24 |
{ |
25 |
npc_flag = 0; |
26 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
27 |
with (msg) |
28 |
{ |
29 |
message[0] = "* (The paper underneath reads:)\t"; |
30 |
message[1] = "* Project: Metal & Magic:\t"; |
31 |
message[2] = "* Effective immediately, cease# home utility production at the# Factory-\t"; |
32 |
message[3] = "* (The rest of the page is# redacted.)"; |
33 |
} |
34 |
} |
35 |
} |
36 |
event_inherited(); |