Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_miner_uwu_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited()
2
var dialogue_type = 1
3
if (global.dunes_flag[4] >= 1)
4
    dialogue_type = 2
5
if (global.dunes_flag[4] >= 2 || (npc_flag < 3 && scr_item_exists_check
scr_item_exists_check

function scr_item_exists_check(argument0) //gml_Script_scr_item_exists_check { var i = 1 while (i <= 8) { if (global.item_slot[i] == argument0) return true; else { if (i == 8) return false; i += 1 continue } } }
("Pickaxe")))
6
    npc_flag = 6
7
if (dialogue_type == 1)
8
{
9
    if interact
10
    {
11
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
12
        switch npc_flag
13
        {
14
            case 0:
15
                is_talking = 1
16
                with (msg)
17
                {
18
                    portrait = false
19
                    sndfnt = 99
20
                    message[0] = "* Haven't seen you around the#  mines, friend!"
21
                    message[1] = "* Welcome to the greatest place#  in the Underground!"
22
                    message[2] = "* I love it here!"
23
                    message[3] = "* Everyone is so nice and works#  hard; we're a real family!"
24
                }
25
                npc_flag = 1
26
                break
27
            case 1:
28
                is_talking = 1
29
                with (msg)
30
                {
31
                    portrait = false
32
                    sndfnt = 99
33
                    message[0] = "* I like these mines so much that#  I never leave!"
34
                    message[1] = "* Everyone tells me to go home#  but I find the cold, rocky#  floor very comfortable!"
35
                    message[2] = "* And no, they do not pay me for#  overtime!"
36
                }
37
                npc_flag = 2
38
                break
39
            case 2:
40
            case 6:
41
                is_talking = 0
42
                with (msg)
43
                {
44
                    portrait = false
45
                    sndfnt = 99
46
                    message[0] = "* (Whistling)"
47
                }
48
                break
49
        }
50
51
    }
52
}
53
if (dialogue_type == 2)
54
{
55
    if interact
56
    {
57
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
58
        is_talking = 1
59
        if (npc_flag <= 2)
60
            scene = 1
61
        else if (npc_flag == 3)
62
        {
63
            with (msg)
64
            {
65
                message[0] = "* Don't worry about returning my#  pickaxe!"
66
                message[1] = "* I'll just mine with my hands!"
67
            }
68
        }
69
        else if (npc_flag == 4)
70
        {
71
            with (msg)
72
            {
73
                if (!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 } } }
("Pickaxe"))
74
                    message[0] = "* Empty your some of your#  belongings and come back!"
75
                else
76
                {
77
                    other.npc_flag = 3
78
                    other.sprite_index = spr_miner_uwu
79
                    message[0] = "* (Obtained Pickaxe!)"
80
                }
81
            }
82
        }
83
        else if (npc_flag == 5)
84
        {
85
            with (msg)
86
            {
87
                message[0] = "* There's gotta be another way#  you can fix the elevator!"
88
                other.npc_flag = 6
89
            }
90
        }
91
        else if (npc_flag == 6)
92
        {
93
            is_talking = 0
94
            with (msg)
95
                message[0] = "* (Whistling)"
96
        }
97
    }
98
    if (scene > 0)
99
    {
100
        switch scene
101
        {
102
            case 1:
103
                with (msg)
104
                {
105
                    message[0] = "* What can I do you for, friend?"
106
                    ch_msg = 0
107
                    ch[1] = "Elevator"
108
                    ch[2] = "Nothing"
109
                    if (outcome == 1)
110
                    {
111
                        message_reset = true
112
                        other.scene++
113
                    }
114
                    if (outcome == 2)
115
                    {
116
                        message[1] = "* Holler if you need something!"
117
                        other.scene = 0
118
                    }
119
                }
120
                break
121
            case 2:
122
                with (msg)
123
                {
124
                    message[0] = "* Oh fiddlesticks!"
125
                    message[1] = "* I've seen a few pickles in my#  day and this is certainly one#  of them!"
126
                    message[2] = "* Tell you what, I'll give you my#  trusty pickaxe here, if you..."
127
                    message[3] = "* Win a monster trivia game!!"
128
                    message[4] = "* Oooh boy, this will be fun!"
129
                    message[5] = "* All you have to do is answer#  these three questions correctly!"
130
                    message[6] = "* You only get one try so do your#  best!"
131
                    message[7] = "* Question one!"
132
                    message[8] = "* Who is the current Royal#  Scientist?"
133
                    message[9] = "* Choose the correct name!"
134
                    ch_msg = 9
135
                    ch[1] = "ASGORE"
136
                    ch[2] = "Alphys"
137
                    ch[3] = "Dr. Science"
138
                    if (message_current == 3 && (!audio_is_playing(mus_gemstone_fever)))
139
                    {
140
                        audio_sound_gain(obj_radio.current_song, 0, 300)
141
                        audio_play_sound(mus_gemstone_fever, 1, 1)
142
                    }
143
                    if (outcome == 2)
144
                    {
145
                        audio_play_sound(snd_success, 1, 0)
146
                        message_reset = true
147
                        other.scene++
148
                    }
149
                    else if (outcome != 0)
150
                    {
151
                        message_reset = true
152
                        other.scene = 6
153
                    }
154
                }
155
                break
156
            case 3:
157
                with (msg)
158
                {
159
                    message[0] = "* Correct!"
160
                    message[1] = "* Question two!"
161
                    message[2] = "* What is most monster food made#  out of?"
162
                    message[3] = "* Only one answer is correct!"
163
                    ch_msg = 3
164
                    ch[1] = "Magic"
165
                    ch[2] = "Ingredients"
166
                    ch[3] = "Snails"
167
                    if (outcome == 1)
168
                    {
169
                        audio_play_sound(snd_success, 1, 0)
170
                        message_reset = true
171
                        other.scene++
172
                    }
173
                    else if (outcome != 0)
174
                    {
175
                        message_reset = true
176
                        other.scene = 6
177
                    }
178
                }
179
                break
180
            case 4:
181
                with (msg)
182
                {
183
                    message[0] = "* Good job!"
184
                    message[1] = "* Final question!"
185
                    message[2] = "* How many more SOULs does ASGORE#  need to shatter the barrier?"
186
                    message[3] = "* Pick the number of SOULs!"
187
                    ch_msg = 3
188
                    ch[1] = "1"
189
                    ch[2] = "2"
190
                    ch[3] = "3"
191
                    if (outcome == 2)
192
                    {
193
                        audio_play_sound(snd_success, 1, 0)
194
                        message_reset = true
195
                        other.scene++
196
                    }
197
                    else if (outcome != 0)
198
                    {
199
                        message_reset = true
200
                        other.scene = 6
201
                    }
202
                }
203
                break
204
            case 5:
205
                with (msg)
206
                {
207
                    message[0] = "* Congratulations!"
208
                    message[1] = "* You really know your stuff!"
209
                    message[2] = "* Here's my pick as promised!"
210
                    message[3] = "* (Obtained Pickaxe!)"
211
                    if (message_current == 3 && (!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 } } }
("Pickaxe")))
212
                    {
213
                        message[3] = "* Aww! Looks like my pick would#  only weigh you down."
214
                        message[4] = "* Empty your some of your#  belongings and come back!"
215
                        other.npc_flag = 4
216
                        other.scene = 0
217
                        audio_sound_gain(obj_radio.current_song, 1, 600)
218
                        scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len) if instance_exists(obj_audio_fade_helper) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd }
(mus_gemstone_fever, 300)
219
                    }
220
                    else if (message_current == 3)
221
                    {
222
                        other.npc_flag = 3
223
                        other.is_talking = false
224
                        other.scene = 0
225
                        other.sprite_index = spr_miner_uwu
226
                        audio_sound_gain(obj_radio.current_song, 1, 600)
227
                        scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len) if instance_exists(obj_audio_fade_helper) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd }
(mus_gemstone_fever, 300)
228
                    }
229
                }
230
                break
231
            case 6:
232
                with (msg)
233
                {
234
                    message[0] = "* I'm sorry, that was not correct!"
235
                    message[1] = "* I'm sure you tried your best,#  though!"
236
                }
237
                npc_flag = 5
238
                scene = 0
239
                audio_sound_gain(obj_radio.current_song, 1, 600)
240
                scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len) if instance_exists(obj_audio_fade_helper) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd }
(mus_gemstone_fever, 300)
241
                break
242
        }
243
244
    }
245
}
246
if is_talking
247
{
248
    if (sprite_index == spr_miner_uwu)
249
        sprite_index = spr_miner_uwu_talk
250
    if (sprite_index == spr_miner_uwu_pickaxe)
251
        sprite_index = spr_miner_uwu_pickaxe_talk
252
    image_speed = 0.2
253
}
254
else
255
{
256
    if (sprite_index == spr_miner_uwu_talk)
257
        sprite_index = spr_miner_uwu
258
    if (sprite_index == spr_miner_uwu_pickaxe_talk)
259
        sprite_index = spr_miner_uwu_pickaxe
260
    image_speed = 0
261
}