Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_wardrobe_Step_0

(view raw script w/o annotations or w/e)
1
with (other)
2
{
3
    if (global.route != 3 && global.flag[17 Dalv fate] == 1)
4
    {
5
        if (waiter == 0)
6
            sprite_index = spr_wardrobe;
7
        if ((keyboard_multicheck_pressed(0) && 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; } }
() == true) && (waiter == 0 && !instance_exists(obj_dialogue)))
8
            waiter = 1;
9
        if (waiter > 0)
10
        {
11
            if (waiter > 2 && waiter < 30)
12
                waiter++;
13
            if (waiter == 1)
14
            {
15
                scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
16
                with (msg)
17
                {
18
                    if (global.interaction_count_wardrobe == 0)
19
                    {
20
                        if (!instance_exists(obj_dialoguebox_dummy))
21
                            instance_create(0, 0, obj_dialoguebox_dummy);
22
                        portrait = false;
23
                        sndfnt = 99;
24
                        message[0] = "* (It's an intimidating looking#  wardrobe.)";
25
                        message[1] = "* (Open it?)";
26
                        if (outcome == 1 && message_current == 1)
27
                        {
28
                            message[2] = "* (There is a balloon floating#  slowly inside. It has a cute#  little happy face drawn on it.)";
29
                            obj_wardrobe.sprite_index = spr_wardrobalon;
30
                            obj_wardrobe.waiter = 2;
31
                        }
32
                        if (outcome == 2 && message_current == 1)
33
                        {
34
                            message[2] = "* (You respect Dalv's privacy.)";
35
                            global.interaction_count_wardrobe++;
36
                            obj_wardrobe.waiter = 0;
37
                            with (obj_dialoguebox_dummy)
38
                                instance_destroy();
39
                            exit;
40
                        }
41
                        if ((message_current + 1) == 1)
42
                        {
43
                            ch_msg = 1;
44
                            ch[1] = "Yes";
45
                            ch[2] = "No";
46
                        }
47
                    }
48
                    else
49
                    {
50
                        portrait = true;
51
                        sndfnt = 100;
52
                        message[0] = "* ...";
53
                        prt[0] = 1755;
54
                        obj_wardrobe.waiter = 2;
55
                    }
56
                }
57
            }
58
            if (waiter == 2 && !instance_exists(obj_dialogue))
59
            {
60
                if (global.interaction_count_wardrobe == 0)
61
                {
62
                    obj_dalv2.direction = 180;
63
                    scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() { global.cutscene = true; obj_pl.state = scr_frozen_state; obj_pl.image_index = 0; obj_pl.image_speed = 0; }
();
64
                    global.interaction_count_wardrobe++;
65
                    waiter++;
66
                }
67
                else
68
                {
69
                    waiter = 0;
70
                    with (obj_dialoguebox_dummy)
71
                        instance_destroy();
72
                }
73
            }
74
            if (waiter == 30)
75
            {
76
                scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
77
                with (msg)
78
                {
79
                    sndfnt = 100;
80
                    message[0] = "* Hey. um. Would you#  mind giving Pops his#  space?";
81
                    message[1] = "* He likes the dark...";
82
                    prt[0] = 1763;
83
                    prt[1] = 1763;
84
                }
85
                waiter++;
86
            }
87
            if (waiter == 31 && !instance_exists(obj_dialogue))
88
            {
89
                obj_dalv2.direction = 270;
90
                scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
91
                with (msg)
92
                {
93
                    sndfnt = 99;
94
                    message[0] = "* (You wave goodbye to Pops#  before closing the door#  again.)";
95
                    portrait = false;
96
                }
97
                waiter = 32;
98
            }
99
            if (waiter == 32)
100
            {
101
                obj_dalv2.direction = 270;
102
                if (!instance_exists(obj_dialogue))
103
                {
104
                    with (obj_dialoguebox_dummy)
105
                        instance_destroy();
106
                    waiter = 0;
107
                    global.cutscene = false;
108
                }
109
            }
110
        }
111
    }
112
    else if (global.flag[17 Dalv fate] != 1 && global.route != 3)
113
    {
114
        if (waiter == 0)
115
            sprite_index = spr_wardrobe;
116
        if ((keyboard_multicheck_pressed(0) && 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; } }
() == true) && (waiter == 0 && !instance_exists(obj_dialogue)))
117
            waiter = 1;
118
        if (waiter == 1)
119
        {
120
            scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
121
            with (msg)
122
            {
123
                portrait = false;
124
                sndfnt = 99;
125
                message[0] = "* (It's an intimidating looking#  wardrobe.)";
126
                message[1] = "* (Open it?)";
127
                if (outcome == 1 && message_current == 1)
128
                {
129
                    message[2] = "* (There is a balloon floating#  slowly inside. It has a cute#  little happy face drawn on it.)";
130
                    message[3] = "* (You wave goodbye to it#  before closing the door#  again.)";
131
                    obj_wardrobe.sprite_index = spr_wardrobalon;
132
                    obj_wardrobe.waiter = 2;
133
                }
134
                if (outcome == 2 && message_current == 1)
135
                {
136
                    message[2] = "* (You respect Dalv's privacy.)";
137
                    obj_wardrobe.waiter = 2;
138
                }
139
                if ((message_current + 1) == 1)
140
                {
141
                    ch_msg = 1;
142
                    ch[1] = "Yes";
143
                    ch[2] = "No";
144
                }
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
    }
154
    else if (global.route == 3)
155
    {
156
        if (waiter == 0)
157
            sprite_index = spr_wardrobe;
158
        if ((keyboard_multicheck_pressed(0) && 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; } }
() == true) && (waiter == 0 && !instance_exists(obj_dialogue)))
159
            waiter = 1;
160
        if (waiter == 1)
161
        {
162
            global.cutscene = true;
163
            scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
164
            with (msg)
165
            {
166
                if (global.interaction_count_wardrobe == 0)
167
                {
168
                    portrait = false;
169
                    sndfnt = 99;
170
                    message[0] = "* (It's a tacky looking black#  wardrobe.)";
171
                    message[1] = "* (You open it.)";
172
                    message[2] = "* (There is a balloon floating#  slowly inside.)";
173
                    message[3] = "* (You untie it and inhale some#  of the contents.)";
174
                    obj_wardrobe.waiter++;
175
                    global.interaction_count_wardrobe++;
176
                }
177
                else
178
                {
179
                    portrait = false;
180
                    sndfnt = 99;
181
                    message[0] = "* (You should respect the dead.)";
182
                    obj_wardrobe.sprite_index = spr_wardrodeflate;
183
                    obj_wardrobe.image_speed = 0;
184
                    obj_wardrobe.image_index = 16;
185
                    obj_wardrobe.waiter = 6;
186
                }
187
            }
188
        }
189
        if (waiter == 2 && instance_exists(obj_dialogue))
190
        {
191
            if (obj_dialogue.message_current >= 2)
192
            {
193
                sprite_index = spr_wardrobalon;
194
                waiter++;
195
            }
196
        }
197
        if (waiter == 3 && !instance_exists(obj_dialogue))
198
        {
199
            sprite_index = spr_wardrodeflate;
200
            image_speed = 1/3;
201
            image_index = 0;
202
            audio_play_sound(snd_pops_deflate, 1, 0);
203
            waiter++;
204
        }
205
        if (waiter == 5)
206
        {
207
            scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
208
            with (msg)
209
            {
210
                portrait = false;
211
                sndfnt = 99;
212
                message[0] = "* (You now sound funny.)";
213
                message[1] = "* ...";
214
                message[2] = "* (You no longer sound funny.)";
215
                obj_wardrobe.waiter++;
216
            }
217
        }
218
        if (waiter == 6 && !instance_exists(obj_dialogue))
219
        {
220
            global.cutscene = false;
221
            waiter = 0;
222
            obj_pl.alarm[0] = 1;
223
        }
224
    }
225
}