Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_books_Step_0

(view raw script w/o annotations or w/e)
1
if (global.flag[17 Dalv fate] == 1)
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_cutscene_start
scr_cutscene_start

function scr_cutscene_start() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_scr_frozen_state obj_pl.image_index = 0 obj_pl.image_speed = 0 }
()
8
        if (global.interaction_count_books == 0)
9
        {
10
            obj_dalv2.destination_x_dalv = obj_pl.x
11
            obj_dalv2.destination_y_dalv = obj_pl.y - 40
12
        }
13
        else
14
        {
15
            obj_dalv2.destination_x_dalv = obj_dalv2.default_x_dalvshouse
16
            obj_dalv2.destination_y_dalv = obj_dalv2.default_y_dalvshouse
17
        }
18
        if (obj_dalv2.x == obj_dalv2.destination_x_dalv && obj_dalv2.y == obj_dalv2.destination_y_dalv)
19
            waiter++
20
    }
21
    if (waiter == 2)
22
        image_index = 1
23
    if (waiter == 2)
24
    {
25
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
26
        with (msg)
27
        {
28
            if (global.interaction_count_books == 0)
29
            {
30
                if (!instance_exists(obj_dialoguebox_dummy))
31
                    instance_create(0, 0, obj_dialoguebox_dummy)
32
                portrait = true
33
                sndfnt = 100
34
                message[0] = "* You like those?"
35
                message[1] = "* Those are my projects."
36
                message[2] = "* I sometimes try to write#  books. Like for kids and#  stuff..."
37
                prt[0] = 1776
38
                prt[1] = 1769
39
                prt[2] = 1761
40
            }
41
            else
42
            {
43
                portrait = true
44
                sndfnt = 100
45
                message[0] = "* ..."
46
                prt[0] = 1755
47
            }
48
        }
49
        waiter++
50
    }
51
    if (waiter == 3 && (!instance_exists(obj_dialogue)))
52
    {
53
        if (global.interaction_count_books == 0)
54
        {
55
            global.interaction_count_books++
56
            waiter++
57
        }
58
        else
59
            waiter = 7
60
    }
61
    if (waiter == 4)
62
    {
63
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
64
        with (msg)
65
        {
66
            portrait = false
67
            sndfnt = 99
68
            message[0] = "* (The table is covered in#  colorful pencils and pages#  strewn with cute pictures.)"
69
        }
70
        waiter++
71
    }
72
    if (waiter == 5 && (!instance_exists(obj_dialogue)))
73
        waiter++
74
    if (waiter == 6)
75
    {
76
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
77
        with (msg)
78
        {
79
            portrait = true
80
            sndfnt = 100
81
            message[0] = "* I sometimes kinda forget#  what colors things are#  outside this place..."
82
            message[1] = "* So I just make them up!"
83
            message[2] = "* I think the kids will#  find it more interesting#  like that anyway!"
84
            message[3] = "* ..."
85
            message[4] = "* It might not be as#  educational though..."
86
            prt[0] = 1780
87
            prt[1] = 1776
88
            prt[2] = 1761
89
            prt[3] = 1755
90
            prt[4] = 1780
91
        }
92
        waiter++
93
    }
94
    if (waiter >= 7 && waiter <= 8 && (!instance_exists(obj_dialogue)))
95
    {
96
        obj_dalv2.destination_x_dalv = obj_dalv2.default_x_dalvshouse
97
        obj_dalv2.destination_y_dalv = obj_dalv2.default_y_dalvshouse
98
        if (obj_dalv2.x == obj_dalv2.default_x_dalvshouse && obj_dalv2.y == obj_dalv2.default_y_dalvshouse)
99
            waiter++
100
        with (obj_dialoguebox_dummy)
101
            instance_destroy()
102
    }
103
    if (waiter == 9)
104
    {
105
        global.cutscene = false
106
        waiter = 0
107
        obj_pl.alarm[0] = 1
108
    }
109
}
110
else if (global.flag[17 Dalv fate] != 1 && global.route != 3)
111
{
112
    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)))
113
        waiter = 1
114
    if (waiter == 1)
115
    {
116
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
117
        with (msg)
118
        {
119
            portrait = false
120
            sndfnt = 99
121
            message[0] = "* (The table is covered in#  colorful pencils and pages#  strewn with cute pictures.)"
122
            obj_books.waiter = 2
123
        }
124
    }
125
    if (waiter == 2 && (!instance_exists(obj_dialogue)))
126
    {
127
        global.cutscene = false
128
        waiter = 0
129
        obj_pl.alarm[0] = 1
130
    }
131
}
132
else if (global.route == 3)
133
{
134
    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)))
135
        waiter = 1
136
    if (waiter == 1)
137
    {
138
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
139
        with (msg)
140
        {
141
            portrait = false
142
            sndfnt = 99
143
            message[0] = "* (Childish pictures scattered on#  the table.)"
144
            obj_books.waiter = 2
145
        }
146
    }
147
    if (waiter == 2 && (!instance_exists(obj_dialogue)))
148
    {
149
        global.cutscene = false
150
        waiter = 0
151
        obj_pl.alarm[0] = 1
152
    }
153
}