Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dalvsroom_desk_Step_0

(view raw script w/o annotations or w/e)
1
if (global.route != 3)
2
{
3
    if (keyboard_multicheck_pressed(0) && 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; } }
() == true && waiter == 0 && (!instance_exists(obj_dialogue)))
4
        waiter = 1
5
    if (waiter == 1)
6
    {
7
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
8
        with (msg)
9
        {
10
            if (!instance_exists(obj_dialoguebox_dummy))
11
                instance_create(0, 0, obj_dialoguebox_dummy)
12
            portrait = false
13
            sndfnt = 99
14
            message[0] = "* (There is a book of neatly#  written paragraphs on#  the desk.)"
15
            message[1] = "* (They all appear to be very#  similar.)"
16
            message[2] = "* (Read one?)"
17
            if (outcome == 1 && message_current == 2)
18
            {
19
                obj_dalvsroom_desk.waiter = 2
20
                global.cutscene = true
21
            }
22
            else if (outcome == 2 && message_current == 2)
23
                obj_dalvsroom_desk.waiter = 4
24
            if ((message_current + 1) == 2)
25
            {
26
                ch_msg = 2
27
                ch[1] = "Yes"
28
                ch[2] = "No"
29
            }
30
        }
31
    }
32
    if (waiter == 2 && (!instance_exists(obj_dialogue)))
33
        waiter++
34
    if (waiter == 3)
35
    {
36
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
37
        with (msg)
38
        {
39
            portrait = false
40
            sndfnt = 99
41
            message[0] = "* Dalv is a loner living in#  the ruins of Home."
42
            message[1] = "* He enjoys quiet walks in the#  dark, cleaning, and improving#  songs on his organ."
43
            message[2] = "* He wants to share with the#  youth of the Underground..."
44
            message[3] = "* ...the importance of being#  accepting and respecting#  the wishes of others. "
45
            message[4] = "* The rest of the page is#  scribbled out."
46
            with (obj_dalvsroom_desk)
47
                waiter++
48
        }
49
    }
50
    if (waiter == 4 && (!instance_exists(obj_dialogue)))
51
    {
52
        with (obj_dialoguebox_dummy)
53
            instance_destroy()
54
        waiter = 0
55
        global.cutscene = false
56
        obj_pl.alarm[0] = 1
57
    }
58
}
59
else
60
{
61
    if (keyboard_multicheck_pressed(0) && 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; } }
() == true && waiter == 0 && (!instance_exists(obj_dialogue)))
62
        waiter = 1
63
    if (waiter == 1)
64
    {
65
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
66
        with (msg)
67
        {
68
            portrait = false
69
            sndfnt = 99
70
            message[0] = "* (There is a book of neatly#  written paragraphs on the#  desk.)"
71
            message[1] = "* (They all appear to be very#  similar.)"
72
        }
73
        waiter++
74
    }
75
    if (waiter == 2 && (!instance_exists(obj_dialogue)))
76
        waiter++
77
    if (waiter == 3)
78
    {
79
        waiter = 0
80
        obj_pl.alarm[0] = 1
81
    }
82
}