Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_npc_miner_red_Step_0

(view raw script w/o annotations or w/e)
1
image_speed = 0.2;
2
if (fade_out == true)
3
{
4
    can_walk = false;
5
    image_speed = 0;
6
    image_index = 0;
7
    if (image_alpha > 0)
8
        image_alpha -= 0.1;
9
    else
10
        instance_destroy();
11
    exit;
12
}
13
event_inherited();
14
if (scr_interact
scr_interact

function 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))
15
{
16
    switch (obj_pl.direction)
17
    {
18
        case 0:
19
            npc_direction = "left";
20
            break;
21
        case 90:
22
            npc_direction = "down";
23
            break;
24
        case 180:
25
            npc_direction = "right";
26
            break;
27
        case 270:
28
            npc_direction = "up";
29
            break;
30
    }
31
    interact = true;
32
    can_walk = false;
33
    waiter = 1;
34
}
35
if (waiter == 1)
36
{
37
    image_speed = 0;
38
    image_index = 0;
39
    scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
40
    if (global.dunes_flag[12] == 1)
41
    {
42
        with (msg)
43
        {
44
            if (global.route != 3)
45
            {
46
                message[0] = "* Watch it!";
47
                message[1] = "* I have places to be!";
48
                message[2] = "* Got a call about a job in#  Snowdin.";
49
                message[3] = "* I was supposed to be there#  yesterday, but the walk is#  really far.";
50
                message[4] = "* Wasn't feeling up to it.";
51
                message[5] = "* Oh well. On I go!";
52
            }
53
            else
54
            {
55
                message[0] = "* Watch i- ";
56
                message[1] = "* Um...";
57
                message[2] = "* Sorry, didn't mean to block#  the path.";
58
                message[3] = "* You... take care, I guess.";
59
                message[4] = "* (Yeesh...)";
60
            }
61
        }
62
    }
63
    else
64
    {
65
        with (msg)
66
        {
67
            if (global.route != 3)
68
                message[0] = "* Can't talk right now.";
69
            else
70
                message[0] = "* I uh... gotta go.";
71
        }
72
    }
73
    if (!global.dialogue_open)
74
    {
75
        waiter = 0;
76
        if (global.dunes_flag[12] == 1)
77
            global.dunes_flag[12] = 2;
78
    }
79
    exit;
80
}
81
if (npc_arrived == 1)
82
    fade_out = true;
83
if (place_meeting(x - 20, y, obj_pl))
84
{
85
    image_speed = 0;
86
    image_index = 0;
87
    can_walk = false;
88
}
89
else if (!global.dialogue_open)
90
{
91
    can_walk = true;
92
}
93
while (place_meeting(x, y, obj_pl))
94
    obj_pl.y -= 1;
95
if (x < (__view_get(e__VW.XView, 0) + __view_get(e__VW.WView, 0)) && global.dunes_flag[12] == 0)
96
    global.dunes_flag[12] = 1;
97
98
enum e__VW
99
{
100
    XView,
101
    YView,
102
    WView,
103
    HView,
104
    Angle,
105
    HBorder,
106
    VBorder,
107
    HSpeed,
108
    VSpeed,
109
    Object,
110
    Visible,
111
    XPort,
112
    YPort,
113
    WPort,
114
    HPort,
115
    Camera,
116
    SurfaceID
117
}