Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_snowdin_09_mo_Step_0

(view raw script w/o annotations or w/e)
1
for (var i = 0; i <= (array_length_1d(timer) - 1); i++)
2
{
3
    if (timer[i] > 0)
4
        timer[i]--
5
    else if (timer[i] != -1)
6
    {
7
        if (i == 0)
8
        {
9
            with (msg)
10
            {
11
                if (message_current == 1)
12
                    instance_destroy()
13
                else
14
                {
15
                    message_current += 1
16
                    cutoff = 0
17
                    other.timer[0] = 60
18
                    return;
19
                }
20
            }
21
        }
22
        if (i == 1)
23
            audio_play_sound(snd_mo_throw, 20, 0)
24
        if (i == 2)
25
            path_start(pt_mo_kiosk, 2, path_action_stop, false)
26
        if (i == 3)
27
            waiter = 9
28
        if (i == 4)
29
        {
30
            waiter = 7
31
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
32
            with (msg)
33
            {
34
                portrait = false
35
                message[0] = "* Much as I'd love to keep#  sellin' pops, I'm all out!"
36
                message[1] = "* Until next time!"
37
            }
38
        }
39
        timer[i] = -1
40
    }
41
}
42
if (path_speed != 0)
43
{
44
    image_speed = 0.2
45
    switch (direction div 90)
46
    {
47
        case 0:
48
            sprite_index = spr_mo_right_yellow
49
            break
50
        case 1:
51
            sprite_index = spr_mo_up_yellow
52
            break
53
        case 2:
54
            sprite_index = spr_mo_left_yellow
55
            break
56
        case 3:
57
            sprite_index = spr_mo_down_yellow
58
            break
59
    }
60
61
}
62
if instance_exists(obj_dialogue)
63
{
64
    if (obj_dialogue.cutoff == string_length(obj_dialogue.message[obj_dialogue.message_current]))
65
    {
66
        image_speed = 0
67
        image_index = 0
68
    }
69
    else
70
        image_speed = 0.2
71
}
72
depth = 10
73
if (global.extra_flag[1] == 1 && global.extra_flag[2] == 1 && global.extra_flag[3] == 1)
74
    global.snowdin_flag[5] = 2
75
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) && waiter == 0)
76
{
77
    waiter = 5
78
    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 }
()
79
}
80
if (slide == 1)
81
{
82
    slide = 2
83
    hsp = -4.8
84
}
85
if (slide == 2)
86
{
87
    if (hsp < 0)
88
        hsp += 0.1
89
    else
90
    {
91
        sprite_index = spr_mo_kick_yellow
92
        image_speed = 0.33
93
        if (floor(image_index) == 3)
94
        {
95
            obj_snowdin_09_mo_stool.slide = 1
96
            slide = 3
97
        }
98
    }
99
}
100
x += hsp
101
if (waiter == 1)
102
{
103
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
104
    with (msg)
105
    {
106
        portrait = false
107
        position = 0
108
        color = true
109
        col_modif[0] = make_color_rgb(72, 132, 212)
110
        message[0] = "* Bam!"
111
        message[1] = "* Who am I? Nobody of note. Ya#  know."
112
        message[2] = "* JUST THE BEST DARN SALESMAN#  EVER!"
113
        message[3] = "* WAM! I'm Mo!"
114
        message_col[3][0] = "           Mo "
115
        message[4] = "* Anyways..."
116
        message[5] = "* The fact that you tried to get#  your mitts on this mug could#  only mean one thing."
117
        message[6] = "* You're looking for a delicious#  little something to hit the#  spot, right?"
118
        message[7] = "* Of course! I know your type!"
119
        message[8] = "* So, you want this here#  beverage?"
120
        ch_msg = 8
121
        ch[1] = "Yes"
122
        ch[2] = "No"
123
        if (outcome == 1 && message_current == 8)
124
        {
125
            message[9] = "* No you don't!"
126
            other.waiter = 2
127
        }
128
        if (outcome == 2 && message_current == 8)
129
        {
130
            message[9] = "* Of course not."
131
            message[10] = "* You and I, we're on the same#  page here."
132
            message[11] = "* This thing? Gross. No one wants#  that."
133
            other.waiter = 2
134
        }
135
    }
136
}
137
if (waiter == 2 && (!instance_exists(obj_dialogue)))
138
{
139
    sprite_index = spr_mo_pour2_yellow
140
    image_speed = 0.35
141
    timer[1] = 10
142
    waiter = -1
143
}
144
if (waiter == 3)
145
{
146
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
147
    with (msg)
148
    {
149
        portrait = false
150
        position = 0
151
        message[0] = "* Liquids? So last season!"
152
        message[1] = "* Solids? PAH! Season before!"
153
        message[2] = "* You want to be fresh and#  revolutionary? I got the latest#  thing!"
154
        message[3] = "* Solids that USED to be liquids!"
155
        message[4] = "* ...And, ya know, haven't been#  sitting out in the forest for#  three weeks."
156
        message[5] = "* I have invented the next big#  thing here!"
157
        message[6] = "* For the incredibly low price of#  15G, you can have your very own#  Hot Chocolate Pop!"
158
        message[7] = "* It was once boring old hot#  chocolate, but now it's frozen#  to the perfect temperature!"
159
        message[8] = "* Have I piqued your interest#  yet?"
160
        ch_msg = 8
161
        ch[1] = "I'm Sold"
162
        ch[2] = "No Thanks"
163
        if (outcome == 1 && message_current == 8)
164
        {
165
            message[9] = "* I knew you would be! Dang, I'm#  good!"
166
            message[10] = "* Let's get down to business."
167
            other.waiter = 4
168
        }
169
        if (outcome == 2 && message_current == 8)
170
        {
171
            message[9] = "* You sure you don't want one?"
172
            message[10] = "* You have to keep up with the#  times, pal! Here, I have an#  idea."
173
            message[11] = "* I'll let you look at them for#  free. Call it a 'holiday#  special.'"
174
            message[12] = "* I don't get a lot of shipments,#  so I only have one of each."
175
            message[13] = "* Let's get down to business."
176
            other.waiter = 4
177
        }
178
    }
179
}
180
if (waiter == 4 && (!instance_exists(obj_dialogue)))
181
{
182
    sprite_index = spr_mo_snap_yellow
183
    image_speed = 0.35
184
    audio_play_sound(snd_mo_snap, 20, 0)
185
    waiter = 5
186
}
187
if (waiter == 5 && path_position == 1)
188
{
189
    path_speed = 0
190
    sprite_index = spr_mo_down_talk_yellow
191
    image_index = 0
192
    image_speed = 0
193
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
194
    with (msg)
195
    {
196
        dialogue_is_minishop = true
197
        portrait = false
198
        position = 0
199
        ch_msg = 0
200
        ch[1] = "Hot Pop"
201
        ch[2] = "Lukewarm Pop"
202
        ch[3] = "Cold Pop"
203
        ch[4] = "Cancel"
204
        if (global.extra_flag[1] == true)
205
            ch[1] = "-SOLD OUT-"
206
        if (global.extra_flag[2] == true)
207
            ch[2] = "-SOLD OUT-"
208
        if (global.extra_flag[3] == true)
209
            ch[3] = "-SOLD OUT-"
210
        message[0] = "* Here's what I got. (15 G)"
211
        if (global.snowdin_flag[5] == 1)
212
        {
213
            ch_msg = 2
214
            message[0] = "* Couldn't stay away?"
215
            message[1] = "* Well-BAM-Take your pick."
216
            message[2] = "* Here's what I got. (15 G)"
217
        }
218
        switch outcome
219
        {
220
            case 1:
221
            case 2:
222
            case 3:
223
                message = 0
224
                cutoff = 0
225
                message_current = 0
226
                ch_msg = -1
227
                if (global.extra_flag[outcome] == false)
228
                {
229
                    if (global.player_gold >= 15 && scr_inventory_check_space
scr_inventory_check_space

function scr_inventory_check_space() //gml_Script_scr_inventory_check_space { var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") return true; else { if (i == 8) return false; i++ continue } } }
())
230
                    {
231
                        message[1] = "* Great choice."
232
                        message[2] = "* You enjoy that Pop, buddy."
233
                        if (outcome == 1)
234
                            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 } } }
("Hot Pop")
235
                        if (outcome == 2)
236
                            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 } } }
("Lukewarm Pop")
237
                        if (outcome == 3)
238
                            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 } } }
("Cold Pop")
239
                        audio_play_sound(snd_shop_purchase, 1, 0)
240
                        global.player_gold -= 15
241
                        global.extra_flag[outcome] = true
242
                    }
243
                    else if (global.player_gold < 15)
244
                        message[1] = "* Sorry, buddy. I'm gonna#  need more G than that."
245
                    else if (!scr_inventory_check_space
scr_inventory_check_space

function scr_inventory_check_space() //gml_Script_scr_inventory_check_space { var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") return true; else { if (i == 8) return false; i++ continue } } }
())
246
                    {
247
                        message[1] = "* Uh-oh, looks like you've got no#  space for this item."
248
                        message[2] = "* Come back when you've made some#  more room."
249
                    }
250
                }
251
                else
252
                    message[1] = "* What a popular item! I wish I#  could sell you more, but I'm#  fresh out."
253
                other.waiter = 6
254
                break
255
            case 4:
256
                message = 0
257
                cutoff = 0
258
                message_current = 0
259
                ch_msg = -1
260
                message[1] = "* Hey, what are ya doing there!"
261
                message[2] = "* That ain't no Pop!"
262
                message[3] = "* You leavin' me? Not interested#  in my wares?"
263
                message[4] = "* Do I not have your favorite#  temperature?"
264
                message[5] = "* Oh, I see. You need some time#  to think about it."
265
                message[6] = "* Well, I'll always be here for#  your gol-"
266
                message[7] = "* ...Business."
267
                message[8] = "* I said business."
268
                other.waiter = 6
269
        }
270
271
    }
272
}
273
if (waiter == 6 && (!instance_exists(obj_dialogue)))
274
{
275
    if (global.snowdin_flag[5] == 2)
276
    {
277
        if (timer[4] == -1)
278
            timer[4] = 30
279
        return;
280
    }
281
    if scr_camera_move
scr_camera_move

function scr_camera_move(argument0, argument1, argument2) //gml_Script_scr_camera_move { if (!instance_exists(obj_camera)) { instance_create(__view_get((9 << 0), 0).x, __view_get((9 << 0), 0).y, obj_camera) __view_set((9 << 0), 0, 1120) } else { obj_camera.x = __view_get((9 << 0), 0).x obj_camera.y = __view_get((9 << 0), 0).y __view_set((9 << 0), 0, 1120) } obj_camera.move = true obj_camera.xx = argument0 obj_camera.yy = argument1 obj_camera.spd = argument2 if (abs(argument0 - obj_camera.x) <= argument2 && abs(argument1 - obj_camera.y) <= argument2) return true; else return false; }
(obj_pl.x, obj_pl.y, 2)
282
    {
283
        waiter = 0
284
        __view_set((9 << 0), 0, 1031)
285
        global.snowdin_flag[5] = 1
286
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
287
    }
288
}
289
if (waiter == 7 && (!instance_exists(obj_dialogue)))
290
{
291
    sprite_index = spr_mo_snap_yellow
292
    image_index = 0
293
    image_speed = 0.35
294
    timer[3] = 50
295
    waiter = 8
296
}
297
if (waiter == 9)
298
{
299
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
300
    with (msg)
301
    {
302
        portrait = false
303
        position = 0
304
        message[0] = "* Mo out!"
305
    }
306
    waiter = 10
307
}
308
if (waiter == 10 && (!instance_exists(obj_dialogue)))
309
{
310
    vspeed = -2
311
    sprite_index = spr_mo_up_yellow
312
    image_speed = 0.35
313
    if (y < -20)
314
    {
315
        global.snowdin_flag[5] = 2
316
        scr_radio_restart
scr_radio_restart

function scr_radio_restart() //gml_Script_scr_radio_restart { with (obj_radio) event_user(0) }
()
317
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
318
        instance_destroy()
319
    }
320
}
321
if (global.snowdin_flag[5] == 1)
322
{
323
    solid = true
324
    depth = (-y)
325
}