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
    return;
12
}
13
event_inherited()
14
if (scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_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
32
    interact = true
33
    can_walk = false
34
    waiter = 1
35
}
36
if (waiter == 1)
37
{
38
    image_speed = 0
39
    image_index = 0
40
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
41
    if (global.dunes_flag[12] == 1)
42
    {
43
        with (msg)
44
        {
45
            if (global.route != 3)
46
            {
47
                message[0] = "* Watch it!"
48
                message[1] = "* I have places to be!"
49
                message[2] = "* Got a call about a job in#  Snowdin."
50
                message[3] = "* I was supposed to be there#  yesterday, but the walk is#  really far."
51
                message[4] = "* Wasn't feeling up to it."
52
                message[5] = "* Oh well. On I go!"
53
            }
54
            else
55
            {
56
                message[0] = "* Watch i- "
57
                message[1] = "* Um..."
58
                message[2] = "* Sorry, didn't mean to block#  the path."
59
                message[3] = "* You... take care, I guess."
60
                message[4] = "* (Yeesh...)"
61
            }
62
        }
63
    }
64
    else
65
    {
66
        with (msg)
67
        {
68
            if (global.route != 3)
69
                message[0] = "* Can't talk right now."
70
            else
71
                message[0] = "* I uh... gotta go."
72
        }
73
    }
74
    if (!global.dialogue_open)
75
    {
76
        waiter = 0
77
        if (global.dunes_flag[12] == 1)
78
            global.dunes_flag[12] = 2
79
    }
80
    return;
81
}
82
if (npc_arrived == 1)
83
    fade_out = true
84
if place_meeting((x - 20), y, obj_pl)
85
{
86
    image_speed = 0
87
    image_index = 0
88
    can_walk = false
89
}
90
else if (!global.dialogue_open)
91
    can_walk = true
92
while place_meeting(x, y, obj_pl)
93
    obj_pl.y -= 1
94
if (x < ((__view_get((0 << 0), 0)) + (__view_get((2 << 0), 0))) && global.dunes_flag[12] == 0)
95
    global.dunes_flag[12] = 1