Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_fridge_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_mini_fridge == 0)
9
        {
10
            obj_dalv2.destination_x_dalv = obj_pl.x + 40
11
            obj_dalv2.destination_y_dalv = obj_pl.y
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
    {
23
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
24
        with (msg)
25
        {
26
            if (global.interaction_count_mini_fridge == 0)
27
            {
28
                if (!instance_exists(obj_dialoguebox_dummy))
29
                    instance_create(0, 0, obj_dialoguebox_dummy)
30
                portrait = true
31
                sndfnt = 100
32
                message[0] = "* I don't exactly have a#  huge selection of food."
33
                message[1] = "* I don't get out much... "
34
                message[2] = "* Oh wait!  I have some#  leftovers you can take#  with you."
35
                message[3] = "* I hope you like it! I#  made it for my birthday."
36
                message[4] = "* Sponge Cake is my#  favorite!"
37
                prt[0] = 1763
38
                prt[1] = 1780
39
                prt[2] = 1769
40
                prt[3] = 1769
41
                prt[4] = 1773
42
            }
43
            else
44
            {
45
                portrait = true
46
                sndfnt = 100
47
                message[0] = "* ..."
48
                prt[0] = 1780
49
            }
50
        }
51
        waiter++
52
    }
53
    if (waiter == 3 && (!instance_exists(obj_dialogue)))
54
    {
55
        if (global.interaction_count_mini_fridge == 0)
56
        {
57
            global.interaction_count_mini_fridge++
58
            waiter++
59
        }
60
        else
61
            waiter = 7
62
    }
63
    if (waiter == 4)
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] = "* (It's a sponge covered in#  frosting.)"
71
            message[1] = "* (Take it?)"
72
            if (outcome == 1 && message_current == 1)
73
            {
74
                with (obj_fridge)
75
                    response = "yes"
76
                obj_fridge.image_index = 1
77
                obj_fridge.waiter = 5
78
            }
79
            else if (outcome == 2 && message_current == 1)
80
            {
81
                with (obj_fridge)
82
                    response = "no"
83
                obj_fridge.waiter = 5
84
            }
85
            if ((message_current + 1) == 1)
86
            {
87
                ch_msg = 1
88
                ch[1] = "Yes"
89
                ch[2] = "No"
90
            }
91
        }
92
    }
93
    if (waiter == 5 && (!instance_exists(obj_dialogue)))
94
        waiter++
95
    if (waiter == 6)
96
    {
97
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
98
        with (msg)
99
        {
100
            if (obj_fridge.response == "yes")
101
            {
102
                talker[0] = -4
103
                sndfnt_array[0] = 391
104
                sndfnt_array[1] = 434
105
                sndfnt_array[2] = 434
106
                sndfnt_array[3] = 434
107
                message[0] = "* (You got the Sponge Cake!)"
108
                message[1] = "* ..."
109
                message[2] = "* Sorry I didn't invite#  you, it was last week."
110
                message[3] = "* You can come next year!"
111
                prt[1] = 1755
112
                prt[2] = 1763
113
                prt[3] = 1769
114
                scr_item
scr_item

function scr_item(argument0) //gml_Script_scr_item { nm = argument0 var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") { global.item_slot[i] = nm return true; } else { if (i == 8) return false; i++ continue } } }
("Sponge Cake")
115
                with (obj_fridge)
116
                    waiter++
117
            }
118
            else if (obj_fridge.response == "no")
119
            {
120
                portrait = true
121
                sndfnt = 100
122
                message[0] = "* No?"
123
                message[1] = "* Alright then."
124
                message[2] = "* More for me I suppose."
125
                prt[0] = 1755
126
                prt[1] = 1755
127
                prt[2] = 1776
128
                with (obj_fridge)
129
                    waiter++
130
            }
131
        }
132
    }
133
    if (waiter >= 7 && waiter <= 8 && (!instance_exists(obj_dialogue)))
134
    {
135
        response = "nothing"
136
        obj_fridge.image_index = 0
137
        obj_dalv2.destination_x_dalv = obj_dalv2.default_x_dalvshouse
138
        obj_dalv2.destination_y_dalv = obj_dalv2.default_y_dalvshouse
139
        if (obj_dalv2.x == obj_dalv2.default_x_dalvshouse && obj_dalv2.y == obj_dalv2.default_y_dalvshouse)
140
            waiter++
141
        with (obj_dialoguebox_dummy)
142
            instance_destroy()
143
    }
144
    if (waiter == 9)
145
    {
146
        global.cutscene = false
147
        waiter = 0
148
        obj_pl.alarm[0] = 1
149
    }
150
}
151
else if (global.flag[17 Dalv fate] != 1 && global.route != 3)
152
{
153
    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)))
154
        waiter = 1
155
    if (waiter == 1)
156
    {
157
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
158
        with (msg)
159
        {
160
            portrait = false
161
            sndfnt = 99
162
            message[0] = "* (It's a mini fridge.)"
163
            message[1] = "* (It's mostly empty.)"
164
            obj_fridge.waiter = 2
165
        }
166
    }
167
    if (waiter == 2 && (!instance_exists(obj_dialogue)))
168
    {
169
        global.cutscene = false
170
        waiter = 0
171
        obj_pl.alarm[0] = 1
172
    }
173
}
174
else if (global.route == 3)
175
{
176
    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)))
177
        waiter = 1
178
    if (waiter == 1)
179
    {
180
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
181
        with (msg)
182
        {
183
            portrait = false
184
            sndfnt = 99
185
            message[0] = "* (A cheap mini fridge.)"
186
            message[1] = "* (Nothing inside looks remotely#  edible.)"
187
            obj_fridge.waiter = 2
188
        }
189
    }
190
    if (waiter == 2 && (!instance_exists(obj_dialogue)))
191
    {
192
        global.cutscene = false
193
        waiter = 0
194
        obj_pl.alarm[0] = 1
195
    }
196
}